diff --git a/tunictracker/tracker/static/tracker/assets/refresh.js b/tunictracker/tracker/static/tracker/assets/refresh.js index 1073c93..1b13960 100644 --- a/tunictracker/tracker/static/tracker/assets/refresh.js +++ b/tunictracker/tracker/static/tracker/assets/refresh.js @@ -77,16 +77,6 @@ async function get_updated_filepath() { ); } -// This won't work properly. For now, the user will need to input themselves. -// async function get_filepath() { -// try { -// const filepath_selection = await window.showDirectoryPicker(); -// console.log(filepath_selection); -// } catch { -// console.log("Browser does not support showDirectoryPicker()"); -// } -// } - async function get_updated_server_address() { fetch(`${document.URL}get/address`) .then( @@ -366,30 +356,59 @@ async function refresh_elements(cross_codes) { // Apply color coding to summary block summary_block.firstElementChild.classList.remove( - "from-highlight-both-translucent-light", - "from-highlight-checks-translucent-light", - "from-highlight-entrances-translucent-light", - "to-highlight-both-translucent-dark", - "to-highlight-checks-translucent-dark", - "to-highlight-entrances-translucent-dark" + "from-highlight-both-light", + "from-highlight-checks-light", + "from-highlight-entrances-light", + "from-highlight-empty-light", + "from-highlight-undiscovered-light", + "to-highlight-both-dark", + "to-highlight-checks-dark", + "to-highlight-entrances-dark", + "to-highlight-empty-dark", + "to-highlight-undiscovered-dark", + "text-highlight-both-text", + "text-highlight-checks-text", + "text-highlight-entrances-text", + "text-highlight-empty-text", + "text-highlight-undiscovered-text" ); if ( scene_checks_undiscovered > 0 && scene_entrances_undiscovered > 0 ) { - summary_block.firstElementChild.classList.add( - "from-highlight-both-translucent-light", - "to-highlight-both-translucent-dark" - ); + if ( + scene_checks_total == scene_checks_undiscovered && + scene_entrances_total == scene_entrances_undiscovered + ) { + summary_block.firstElementChild.classList.add( + "from-highlight-undiscovered-light", + "to-highlight-undiscovered-dark", + "text-highlight-undiscovered-text" + ); + } else { + summary_block.firstElementChild.classList.add( + "from-highlight-both-light", + "to-highlight-both-dark", + "text-highlight-both-text" + ); + } } else if (scene_checks_undiscovered > 0) { summary_block.firstElementChild.classList.add( - "from-highlight-checks-translucent-light", - "to-highlight-checks-translucent-dark" + "from-highlight-checks-light", + "to-highlight-checks-dark", + "text-highlight-checks-text" ); } else if (scene_entrances_undiscovered > 0) { summary_block.firstElementChild.classList.add( - "from-highlight-entrances-translucent-light", - "to-highlight-entrances-translucent-dark" + "from-highlight-entrances-light", + "to-highlight-entrances-dark", + "text-highlight-entrances-text" + ); + } else { + summary_block.firstElementChild.classList.add( + "from-highlight-empty-light", + "to-highlight-empty-dark", + "text-highlight-empty-text" ); } @@ -464,16 +483,6 @@ async function refresh_elements(cross_codes) { document.getElementById(`${scene}-summary`).onclick = () => { show_breakdown(scene); }; - // Object.keys(all_scenes[scene].Entrances).forEach((entrance) => { - // if (all_scenes[scene].Entrances[entrance].Door != "") { - // let test = document.getElementById(`${entrance}-mapped`); - // console.log(all_scenes[scene].Entrances[entrance].Scene); - // document.getElementById(`${entrance}-mapped`).onclick = () => { - // console.log("aaaaa"); - // // show_breakdown(all_scenes[scene].Entrances[entrance].Scene); - // }; - // } - // }); }); }, (error) => { diff --git a/tunictracker/tracker/templates/tracker/index.html b/tunictracker/tracker/templates/tracker/index.html index 1b1a83b..bbd05bc 100644 --- a/tunictracker/tracker/templates/tracker/index.html +++ b/tunictracker/tracker/templates/tracker/index.html @@ -1,7 +1,7 @@ {% extends "index.html" %} {% load static %} {% block content %} -
+
{% if debug != '' %}
diff --git a/tunictracker/tracker/templates/tracker/summary/block.html b/tunictracker/tracker/templates/tracker/summary/block.html index 729f571..8a4aba9 100644 --- a/tunictracker/tracker/templates/tracker/summary/block.html +++ b/tunictracker/tracker/templates/tracker/summary/block.html @@ -1,7 +1,7 @@