Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undertale: AP Website Tracker #3493

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
222 changes: 222 additions & 0 deletions WebHostLib/static/styles/tracker__Undertale.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:[email protected]&display=swap');

.tracker-container {
width: 500px;
box-sizing: border-box;
font-family: "Lexend Deca", Arial, Helvetica, sans-serif;
border: 2px solid black;
border-radius: 4px;
resize: both;

background-color: #000000;
color: white;
}

.hidden {
display: none !important;
}

/** Tracker Grid **/
/* .grid {
background-color: black;
display: grid;
grid-template-columns: repeat(1fr, 5);
grid-template-rows: repeat(1fr, 3);
grid-column-gap: 5px;
grid-row-gap: 5px;
grid-template-areas:
'col1 col1 col1 col1 col1'
'col2 col3 col4 col5 col6'
'col2 col3 col4 col8 col7';
} */

/* .sub-grid {
display: grid;
grid-template-columns: repeat(1fr, 3);
grid-template-rows: repeat(1fr, 6);
grid-column-gap: 5px;
grid-row-gap: 5px;
grid-template-areas:
'sub-col1 sub-col4 sub-col4'
'sub-col2 sub-col4 sub-col4'
'sub-col3 sub-col5 sub-col5'
'sub-col3 sub-col5 sub-col5'
'sub-col3 sub-col6 sub-col6'
'sub-col3 sub-col6 sub-col6';
} */

/* [class^='col-'], [class^='sub-col-'] {
min-height: 40px;
display: flex;
align-items: center;
justify-content: center;
} */

/* .col-1 { grid-area: col1; }
.col-2 { grid-area: col2; }
.col-3 { grid-area: col3; }
.col-4 { grid-area: col4; }
.col-5 { grid-area: col5; }
.col-6 { grid-area: col6; }
.col-7 { grid-area: col7; }
.col-8 { grid-area: col8; }
.col-9 { grid-area: col9; }

.sub-col-1 { grid-area: sub-col1; }
.sub-col-2 { grid-area: sub-col2; }
.sub-col-3 { grid-area: sub-col3; }
.sub-col-4 { grid-area: sub-col4; }
.sub-col-5 { grid-area: sub-col5; } */

/* .grid::after {
content: "";
clear: both;
display: table;
} */

/** Inventory Grid ****************************************************************************************************/
.inventory-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
padding: 1rem;
gap: 1rem;
}

.inventory-grid:nth-child(1) {
grid-template-columns: repeat(6, minmax(0, 1fr));
}

.inventory-grid:nth-child(2) .item div {
color: orange;
border: 3px solid orange;
width: 100px;
padding: 3px;
text-align: center;
vertical-align: middle;
font-weight: 600;
}

.sub-col-3 .inventory-grid, .sub-col-4 .inventory-grid, .sub-col-5 .inventory-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-grid .item {
position: relative;
display: flex;
justify-content: center;
height: 48px;
}

.inventory-grid .dual-item {
display: flex;
justify-content: center;
}

.inventory-grid .missing {
/* Missing items will be in full grayscale to signify "uncollected". */
filter: grayscale(100%) contrast(75%) brightness(75%);
}

.inventory-grid .collected {
color: lightgreen;
}

.inventory-grid .item img,
.inventory-grid .dual-item img {
display: flex;
align-items: center;
text-align: center;
font-size: 0.8rem;
text-shadow: 0 1px 2px black;
font-weight: bold;
image-rendering: crisp-edges;
background-size: contain;
background-repeat: no-repeat;
}

.inventory-grid .dual-item img {
height: 48px;
margin: 0 -4px;
}

.inventory-grid .dual-item img:first-child {
align-self: flex-end;
}

.inventory-grid .item .quantity {
position: absolute;
bottom: 0;
right: 0;
text-align: right;
font-weight: 600;
font-size: 1.75rem;
line-height: 1.75rem;
text-shadow:
-1px -1px 0 #000,
1px -1px 0 #000,
-1px 1px 0 #000,
1px 1px 0 #000;
user-select: none;
}

/** Regions List ******************************************************************************************************/
.regions-list {
padding: 1rem;
}

.regions-list summary {
list-style: none;
display: flex;
gap: 0.5rem;
cursor: pointer;
}

.regions-list summary::before {
content: "⯈";
width: 1em;
flex-shrink: 0;
}

.regions-list details {
font-weight: 300;
}

.regions-list details[open] > summary::before {
content: "⯆";
}

.regions-list .region {
width: 100%;
display: grid;
grid-template-columns: 20fr 8fr 2fr 2fr;
align-items: center;
gap: 4px;
text-align: center;
font-weight: 300;
box-sizing: border-box;
}

.regions-list .region :first-child {
text-align: left;
font-weight: 500;
}

.regions-list .region.region-header {
margin-left: 24px;
width: calc(100% - 24px);
padding: 2px;
}

.regions-list .location-rows {
border-top: 1px solid white;
display: grid;
grid-template-columns: auto 32px;
font-weight: 300;
padding: 2px 8px;
margin-top: 4px;
font-size: 0.8rem;
}

.regions-list .location-rows :nth-child(even) {
text-align: right;
}
96 changes: 96 additions & 0 deletions WebHostLib/templates/multitracker__Undertale.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{% extends "multitracker.html" %}
{% block head %}
{{ super() }}
<script type="application/ecmascript" src="{{ url_for("static", filename="assets/jquery.scrollsync.js") }}"></script>
<script type="application/ecmascript" src="{{ url_for("static", filename="assets/lttpMultiTracker.js") }}"></script>
{% endblock %}

{# List all tracker-relevant icons. Format: (Name, Image URL) #}
{% set icons = {
"Ruins Key" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeyRuins.png?raw=true",
"Snowdin Key" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeySnowdin.png?raw=true",
"Waterfall Key" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeyWaterfall.png?raw=true",
"Hotland Key" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeyHotland.png?raw=true",
"Core Key" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeyCore.png?raw=true",
"New Home Key" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeyNewHome.png?raw=true",
"New Home Key Left" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeyNewHomeLeft.png?raw=true",
"New Home Key Right" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeyNewHomeRight.png?raw=true",
"Key Piece" : "https://github.com/mrkssr/ap-icons/blob/main/Undertale%20Tracker/Keys/active/KeyPiece.png?raw=true",

"IsCompleted" : "https://static.wikia.nocookie.net/undertale/images/0/0b/Annoying_Dog_sprite.gif"
} %}

{% set inventory_order = [
"Ruins Key",
"Snowdin Key",
"Waterfall Key",
"Hotland Key",
"Core Key",
"New Home Key",
"IsCompleted"
] %}

{% set multi_items = [

] %}

{# Most have a duplicated 0th entry for when we have none of that item to still load the correct icon/name. #}
{% set progressive_order = {

} %}

{% set allItems = {

} %}

{%- block custom_table_headers %}
{#- macro that creates a table header with display name and image -#}
{%- macro make_header(name, img_src) %}
<th class="center-column">
<img height="24" src="{{ img_src }}" title="{{ name }}" alt="{{ name }}">
</th>
{% endmacro -%}

{#- call the macro to build the table header -#}
{%- for item in inventory_order %}
<th class="center-column">
{%- if item in icons -%}
<img class="icon-sprite" src="{{ icons[item] }}" alt="{{ item | e }}" title="{{ item | e }}">
{% else %}
{{ item }}
{%- endif %}
</th>
{% endfor -%}
{% endblock %}

{# build each row of custom entries #}
{% block custom_table_row scoped %}
{%- for item in inventory_order -%}
{%- if inventories[(team, player)][item] -%}
<td class="center-column item-acquired">
{% if item in multi_items %}
{{ inventories[(team, player)][item] }}
{% else %}
✔️
{% endif %}
</td>
{%- else -%}
{% if item == "New Home Key" and inventories[(team, player)]["Key Piece"] > 0 %}
<td class="center-column item-acquired">
{{ inventories[(team, player)]["Key Piece"] }}
<img class="icon-sprite" style="height: 20px;" src="{{ icons["Key Piece"] }}" alt="{{ item | e }}" title="{{ item | e }}">
</td>
{% elif item == "New Home Key" and inventories[(team, player)]["Left Home Key"] %}
<td class="center-column item-acquired">
<img class="icon-sprite" style="height: 20px;" src="{{ icons["New Home Key Left"] }}" alt="{{ item | e }}" title="{{ item | e }}">
</td>
{% elif item == "New Home Key" and inventories[(team, player)]["Right Home Key"] %}
<td class="center-column item-acquired">
<img class="icon-sprite" style="height: 20px;" src="{{ icons["New Home Key Right"] }}" alt="{{ item | e }}" title="{{ item | e }}">
</td>
{% else %}
<td></td>
{% endif %}
{%- endif -%}
{% endfor %}
{% endblock %}
Loading
Loading