Compare commits

...

2 Commits

Author SHA1 Message Date
4dd9e43638 Ooops wrong monitor. 2024-03-02 19:54:20 -06:00
6f06455cf6 Organized elements more. Added overview panel. 2024-03-02 19:45:57 -06:00
4 changed files with 85 additions and 1099 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@ TunicTransitionTracker
settings.json
**/db.sqlite3
**/node_modules/**
**/dist/**
spoiler.json

View File

@ -3,56 +3,76 @@
{% block content %}
<div class="container monospace">
<div class="m-4 pl-2 pr-2 ring-4 rounded-md text-[#eee] bg-bluelight-translucent-dark ring-bluelight-dark">
<div class="flex flex-col">
<div class="m-4 ring-4 rounded-md text-[#eee] bg-bluelight-translucent-dark ring-bluelight-dark">
<div class="p-4 flex flex-col space-y-4">
<div class="flex pt-4 text-2xl mx-2">
<span class="relative inline-block align-middle h-8 w-8"><img src="{% static 'tracker/images/neofox_flag_trans_256.png' %}" alt="A trans pride fox emoji." /></span>
&nbsp;Tunic Transition Tracker
</div>
<hr class="m-2 mb-0 border-2 border-[#2fd5ff27] rounded-md" />
<div class="flex mx-3 my-2 text-xl">
Checks: {{ totals.Checks.Undiscovered }}/{{ totals.Checks.Total }} Entrances: {{ totals.Entrances.Undiscovered }}/{{ totals.Entrances.Total }}
<br />Current Area: {{ scene }}
<hr class="border-2 border-bluelight-translucent-dark rounded-md" />
<div class="p-4 flex flex-col max-w-full space-y-2 md:space-y-4 text-md rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
<div class="text-lg">Overview</div>
<div class="flex flex-col md:flex-row md:space-x-4 space-y-2 md:space-y-0">
<div class="flex basis-1/2">Checks: {{ totals.Checks.Undiscovered }}/{{ totals.Checks.Total }}</div>
<div class="flex basis-1/2">Entrances: {{ totals.Entrances.Undiscovered }}/{{ totals.Entrances.Total }}</div>
</div>
<div class="mx-4 mb-4 p-1 flex flex-col space-y-4">
<details open class="px-4 max-w-full rounded-md ring-4 bg-bluelight-translucent ring-[#2fd5ff10] text-[#eee]">
<summary class="justify-start p-2 text-lg">Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }} Entrances: {{ scene_data.Totals.Entrances.Undiscovered }}/{{ scene_data.Totals.Entrances.Total }}</summary>
<hr class="mb-2 border-2 border-[#2fd5ff27] rounded-md" />
<div class="flex flex-row justify-center space-x-4">
<div class="my-2 flex flex-col basis-1/2 space-y-2 overflow-x-auto">
<div class="text-md">Checks</div>
<hr class="border-2 border-[#2fd5ff27] rounded-md" />
<hr class="border-2 border-bluelight-translucent-dark rounded-md" />
<details class="group p-2 flex flex-col space-y-4 rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
<summary class="text-lg">Breakdown</summary>
<div class="grid gap-4 md:grid-cols-3 grid-flow-row">
{% for scene, scene_totals in totals.items %}
{% if scene != 'Entrances' and scene != 'Checks' %}
<div class="p-2 flex flex-col rounded-md ring-4 ring-bluelight-dark bg-opacity-50 {% if scene_totals.Checks.Undiscovered > 0 and scene_totals.Entrances.Undiscovered > 0 %}bg-green-900{% elif scene_totals.Checks.Undiscovered > 0 %}bg-yellow-900{% elif scene_totals.Entrances.Undiscovered > 0 %}bg-blue-900{% else %}{% endif %}">
<div>{{ scene }}:</div>
<div>Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}</div>
<div>Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}</div>
</div>
<div class="my-2 flex flex-col basis-1/2 space-y-2 overflow-x-auto">
<div class="text-md">Entrances</div>
<hr class="border-2 border-[#2fd5ff27] rounded-md" />
</div>
</div>
<div class="flex flex-row justify-center space-x-4">
<div class="pb-4 flex flex-col basis-1/2 space-y-2 overscroll-x-auto">
{% for check_name, check in scene_data.Checks.items %}
{% if not check.Check %}
<ul class="min-w-max bg-bluelight-translucent rounded-sm px-1">❌ {{ check_name }}</ul>
{% endif %}
{% endfor %}
</div>
<div class="pb-4 flex flex-col basis-1/2 space-y-2 overflow-x-auto">
{% for entrance_origin, entrance_destination in scene_data.Entrances.items %}
{% if not entrance_destination.Entrance != '' %}
<ul class="min-w-max bg-bluelight-translucent rounded-sm px-1">❌ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}</ul>
{% endif %}
{% endfor %}
</div>
</div>
</details>
<div class="pb-4 flex flex-col space-y-2 overscroll-x-auto">
{% for entrance_origin, entrance_destination in scene_data.Entrances.items %}
{% if entrance_destination.Entrance %}
<ul class="min-w-max bg-bluelight rounded-sm px-1">✔️ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}</ul>
</div>
<div class="p-4 flex flex-col max-w-full rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
<div class="flex text-lg">{{ scene }}</div>
<div class="flex flex-col md:flex-row justify-center md:space-x-4">
<div class="flex flex-col basis-1/2 overflow-hidden">
<div class="my-2 flex flex-col space-y-2">
<div class="text-md">Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }}</div>
<hr class="border-2 border-bluelight-translucent-dark rounded-md" />
</div>
<div class="pb-4 flex flex-col space-y-2 overflow-x-scroll">
{% for check_name, check in scene_data.Checks.items %}
{% if not check.Check %}
<ul class="min-w-max bg-bluelight-translucent rounded-md px-1">❌ {{ check_name }}</ul>
{% endif %}
{% endfor %}
</div>
<details class="group flex max-w-full rounded-md ring-4 bg-bluelight-translucent ring-[#2fd5ff10] text-[#eee]">
</div>
<div class="flex flex-col basis-1/2 overflow-hidden">
<div class="my-2 flex flex-col space-y-2">
<div class="text-md">Entrances: {{ scene_data.Totals.Entrances.Undiscovered }}/{{ scene_data.Totals.Entrances.Total }}</div>
<hr class="border-2 border-bluelight-translucent-dark rounded-md" />
</div>
<div class="pb-4 flex flex-col space-y-2 overflow-x-scroll">
{% for entrance_origin, entrance_destination in scene_data.Entrances.items %}
{% if not entrance_destination.Entrance != '' %}
<ul class="min-w-max bg-bluelight-translucent rounded-md px-1">❌ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}</ul>
{% endif %}
{% endfor %}
</div>
</div>
</div>
<div class="overflow-x-scroll">
<div class="flex flex-col space-y-2 mx-auto min-w-max">
{% for entrance_origin, entrance_destination in scene_data.Entrances.items %}
{% if entrance_destination.Entrance %}
<ul class="bg-bluelight rounded-md px-1">✔️ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}</ul>
{% endif %}
{% endfor %}
</div>
</div>
</div>
<details class="group flex max-w-full rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
<summary class="justify-start p-2">Tracker Debug</summary>
<div class="p-2 pl-4 pr-4 flex flex-col space-y-2">
<div>
@ -70,5 +90,4 @@
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -10,13 +10,30 @@ import requests
def index(request):
tracker_output = loads(requests.get('http://localhost:8000/spoiler').text)
# with open('structure_final_final_v10.json', 'r') as t:
# with open('spoiler.json', 'r') as t:
# tracker_output = loads(t.read())
tracker_debug = tracker_output["Debug"]
tracker_totals = tracker_output["Totals"]
tracker_current_scene = tracker_output["Scene"]
tracker_current_scene_data = tracker_output["Scenes"][tracker_current_scene]
template = loader.get_template("tracker/index.html")
for i in tracker_output["Scenes"]:
if i != tracker_current_scene:
checks_total = tracker_output["Scenes"][i]["Totals"]["Checks"]["Total"]
checks_undiscovered = tracker_output["Scenes"][i]["Totals"]["Checks"]["Undiscovered"]
entrances_total = tracker_output["Scenes"][i]["Totals"]["Entrances"]["Total"]
entrances_undiscovered = tracker_output["Scenes"][i]["Totals"]["Entrances"]["Undiscovered"]
temp_data = {
"Checks": {
"Total": checks_total,
"Undiscovered": checks_undiscovered
},
"Entrances": {
"Total": entrances_total,
"Undiscovered": entrances_undiscovered
}
}
tracker_totals[i] = temp_data
temp_tracker_checks = tracker_current_scene_data["Checks"]
for i, check in enumerate(temp_tracker_checks.keys()):
temp_data = {

File diff suppressed because it is too large Load Diff