Style changes.

This commit is contained in:
Ada Werefox 2024-03-14 01:05:15 -05:00
parent 8c300cc72a
commit db8843bdbb
6 changed files with 74 additions and 57 deletions

View File

@ -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) => {

View File

@ -1,7 +1,7 @@
{% extends "index.html" %}
{% load static %}
{% block content %}
<div class="container monospace py-4 space-y-2 text-[#eee] [text-shadow:_1px_1px_0_rgb(0_0_0_/_50%)]">
<div class="container monospace py-4 space-y-2 text-[#E0FFFF] [text-shadow:_1px_1px_0_rgb(0_0_0_/_50%)]">
<div class="p-2 rounded-lg bg-white bg-opacity-10 shadow-lg shadow-bluelight-background-dark">
{% if debug != '' %}
<div class="space-y-2 px-2">

View File

@ -1,7 +1,7 @@
<button type="button"
class="rounded-xl {{ is_hidden }}"
id="{{ scene }}-summary">
<div class="p-2 *:mr-auto *:justify-start *:text-left min-h-full flex flex-col rounded-lg bg-gradient-to-tr shadow-sm shadow-[#242424] {{ extra_classes }}">
<div class="p-2 *:mr-auto *:justify-start *:text-left min-h-full flex flex-col rounded-lg bg-gradient-to-tl shadow-sm shadow-[#242424] {{ extra_classes }}">
<div class="summary-title">{{ scene }}:</div>
<div class="summary-checks">
Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }}

View File

@ -5,11 +5,17 @@
{% include "tracker/summary/block.html" with extra_classes="" is_hidden="hidden" %}
{% elif scene != "Entrances" and scene != "Checks" %}
{% if scene_data.Totals.Checks.Undiscovered > 0 and scene_data.Totals.Entrances.Undiscovered > 0 %}
{% include "tracker/summary/block.html" with extra_classes="from-highlight-both-translucent-light to-highlight-both-translucent-dark" is_hidden="" %}
{% if scene_data.Totals.Checks.Undiscovered == scene_data.Totals.Checks.Total and scene_data.Totals.Entrances.Undiscovered == scene_data.Totals.Entrances.Total %}
{% include "tracker/summary/block.html" with extra_classes="from-highlight-undiscovered-light to-highlight-undiscovered-dark text-highlight-undiscovered-text" is_hidden="" %}
{% else %}
{% include "tracker/summary/block.html" with extra_classes="from-highlight-both-light to-highlight-both-dark text-highlight-both-text" is_hidden="" %}
{% endif %}
{% elif scene_data.Totals.Checks.Undiscovered > 0 %}
{% include "tracker/summary/block.html" with extra_classes="from-highlight-checks-translucent-light to-highlight-checks-translucent-dark" is_hidden="" %}
{% include "tracker/summary/block.html" with extra_classes="from-highlight-checks-light to-highlight-checks-dark text-highlight-checks-text" is_hidden="" %}
{% elif scene_data.Totals.Entrances.Undiscovered > 0 %}
{% include "tracker/summary/block.html" with extra_classes="from-highlight-entrances-translucent-light to-highlight-entrances-translucent-dark" is_hidden="" %}
{% include "tracker/summary/block.html" with extra_classes="from-highlight-entrances-light to-highlight-entrances-dark text-highlight-entrances-text" is_hidden="" %}
{% else %}
{% include "tracker/summary/block.html" with extra_classes="from-highlight-empty-light to-highlight-empty-dark text-highlight-empty-text" is_hidden="" %}
{% endif %}
{% endif %}
{% endfor %}

View File

@ -27,8 +27,6 @@ def session_key(session, key):
f'Session {key} set to: {session[key]}')
return session[key]
is_hidden = True
def index(request):
request_data = None
@ -43,7 +41,6 @@ def index(request):
with open('empty_spoiler.json', 'r') as t:
try:
request_data = t.read()
is_hidden = False
except:
return
@ -51,7 +48,6 @@ def index(request):
with open('empty_spoiler.json', 'r') as t:
try:
tracker_output = loads(t.read())
is_hidden = False
except:
return
@ -61,7 +57,6 @@ def index(request):
with open('empty_spoiler.json', 'r') as t:
try:
tracker_output = loads(t.read())
is_hidden = False
except:
return
with open('tracker/static/tracker/data/holy_cross_codes.json', 'r') as t:
@ -96,7 +91,7 @@ def index(request):
context = {
'backend_filepath': backend_filepath,
'server_address': listen_address,
'is_hidden': is_hidden,
# 'is_hidden': is_hidden,
'debug': tracker_debug,
'default_codes': cross_codes['Default'],
'tracked_codes': tracker_codes,

View File

@ -85,25 +85,32 @@ module.exports = {
},
highlight: {
checks: {
text: "hsl(210, 92.86%, 90%)",
light: "hsla(293.9,72.3%,45%,1)",
DEFAULT: "#A431B1",
translucent: {
light: "#A431B1E8",
dark: "#A431B1A0",
},
dark: "hsla(293.9,72.3%,30%,1)",
},
entrances: {
text: "hsla(41.86,95.56%,90%,1)",
light: "hsla(23.9,85%,40%,1)",
DEFAULT: "#B16431",
translucent: {
light: "#B16431E8",
dark: "#B16431B0",
},
dark: "hsla(23.9,85%,25%,1)",
},
both: {
text: "hsla(116.4,75.76%,90%,1)",
light: "hsla(113.9,72.3%,40%,1)",
DEFAULT: "#3EB131",
translucent: {
light: "#3EB131E8",
dark: "#3EB13190",
},
dark: "hsla(113.9,72.3%,25%,1)",
},
undiscovered: {
text: "hsla(0,0%,96%,1)",
light: "hsla(0,0%,45%,1)",
dark: "hsla(0,0%,20%,1)",
},
empty: {
text: "hsla(0,100%,100%,1)",
light: "hsla(0,100%,100%,0.05)",
dark: "hsla(0,100%,100%,0.17)",
},
},
"holy-cross": {