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

Celeste64: AP Website Tracker #3563

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions WebHostLib/static/styles/tracker__Celeste64.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:[email protected]&display=swap');

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

color: white;
}

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

margin-left: 0.5rem;
box-shadow: 2px 2px 4px rgba(0, 0, 0);
}

.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 .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;

margin-top: 1rem;
margin-left: 0.5rem;
box-shadow: 2px 2px 4px rgba(0, 0, 0);
}

.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;
}
91 changes: 91 additions & 0 deletions WebHostLib/templates/multitracker__Celeste64.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{% extends "multitracker.html" %}
{% block head %}
{{ super() }}
<script type="application/ecmascript" src="{{ url_for("static", filename="assets/jquery.scrollsync.js") }}"></script>
{% endblock %}

{# Original icons located at https://github.com/PoryGone/Celeste-64-AP-Tracker/tree/main/images #}
{# List all tracker-relevant icons. Format: (Name, Image URL) #}
{% set icons = {
"Strawberry" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/strawberry.png?raw=true",

"Air Dash" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/AirDash.png?raw=true",
"Breakable Blocks" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Breakables_Filled.PNG?raw=true",
"Cassettes" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Cassettes_Filled.PNG?raw=true",
"Climb" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Climb.png?raw=true",
"Coins" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Coins_Filled.PNG?raw=true",
"Dash Refills" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Dash_Filled.png?raw=true",
"Double Dash Refills" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/DoubleDash_Filled.png?raw=true",
"Feathers" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Feather_Filled.png?raw=true",
"Ground Dash" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/GroundDash.png?raw=true",
"Skid Jump" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/SkidJump.png?raw=true",
"Springs" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Springs_Filled.png?raw=true",
"Traffic Blocks" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Traffic_Filled.png?raw=true",

"IsCompleted" : "https://github.com/mrkssr/ap-icons/blob/main/Celeste%2064%20Tracker/items/Baddy.png?raw=true"
} %}

{% set inventory_order = [
"Strawberry",

"Climb",
"Skid Jump",
"Air Dash",
"Ground Dash",

"Cassettes",
"Dash Refills",
"Double Dash Refills",
"Feathers",

"Coins",
"Breakable Blocks",
"Springs",
"Traffic Blocks",

"IsCompleted"
] %}

{% set multi_items = [
"Strawberry"
] %}

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

} %}

{%- 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 %}
{%- if item in icons -%}
<th class="center-column">
<img class="icon-sprite" src="{{ icons[item] }}" alt="{{ item | e }}" title="{{ item | e }}">
</th>
{%- endif %}
{% 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 -%}
<td></td>
{%- endif -%}
{% endfor %}
{% endblock %}
Loading
Loading