From a79ed28dc2dd79d4f169b2231acd25c2f223308d Mon Sep 17 00:00:00 2001 From: Ada Werefox Date: Sat, 6 Apr 2024 23:13:36 -0500 Subject: [PATCH] Cross codes now highlight when you are in range to input them. --- .../tracker/static/tracker/assets/main.js | 20 +++++++++++++++---- .../tracker/templates/tracker/index.html | 2 +- .../static_src/tailwind.config.js | 10 ++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/tunictracker/tracker/static/tracker/assets/main.js b/tunictracker/tracker/static/tracker/assets/main.js index 90583d4..48ded28 100644 --- a/tunictracker/tracker/static/tracker/assets/main.js +++ b/tunictracker/tracker/static/tracker/assets/main.js @@ -261,11 +261,23 @@ async function update_codes(codes) { .getElementById("codes-list") .querySelector(`[data-codename="${code}"]`) .classList.add(`order-last`); + } else { + document + .getElementById("codes-list") + .querySelector(`[data-codename="${code}"]`) + .classList.add(`order-${index + 1}`); + } + if (codes[code].InRange) { + document + .getElementById("codes-list") + .querySelector(`[data-codename="${code}"]`) + .classList.add(`bg-[#ffe28558]`); + } else { + document + .getElementById("codes-list") + .querySelector(`[data-codename="${code}"]`) + .classList.remove(`bg-[#ffe28558]`); } - document - .getElementById("codes-list") - .querySelector(`[data-codename="${code}"]`) - .classList.add(`order-[${index + 1}]`); document .getElementById("codes-list") .querySelector(`[data-codename="${code}"]`).dataset.order = index + 1; diff --git a/tunictracker/tracker/templates/tracker/index.html b/tunictracker/tracker/templates/tracker/index.html index 51be5e0..0e69d1e 100644 --- a/tunictracker/tracker/templates/tracker/index.html +++ b/tunictracker/tracker/templates/tracker/index.html @@ -132,7 +132,7 @@ {% endfor %} {% endcomment %} - {% comment %}
{% endcomment %} + {% comment %}
{% endcomment %} {% include "tracker/src/index.html" with tracker_fe_link="https://gitea.werefox.cafe/ada/tunic-tracker-redux" tracker_be_link="https://github.com/spaceglace/TunicTransitionTracker" %} {% endblock content %} diff --git a/tunictracker/werefoxtheme/static_src/tailwind.config.js b/tunictracker/werefoxtheme/static_src/tailwind.config.js index 310824d..31f941a 100644 --- a/tunictracker/werefoxtheme/static_src/tailwind.config.js +++ b/tunictracker/werefoxtheme/static_src/tailwind.config.js @@ -222,6 +222,16 @@ module.exports = { "0%, 100%": { transform: "translate(0, 0) rotate(0)" }, }, }, + order: { + 13: "13", + 14: "14", + 15: "15", + 16: "16", + 17: "17", + 18: "18", + 19: "19", + 20: "20", + }, }, }, plugins: [