This commit is contained in:
2026-10-21 14:21:28 -04:00
parent 613647cb50
commit 8708c9b086
9 changed files with 47 additions and 1 deletions
+9
View File
@@ -336,6 +336,14 @@ function formatDuration(ms) {
return `${Math.round(ms / 1000)}s`;
}
let faviconZone = "green";
function updateFavicon(zoneName) {
if (zoneName === faviconZone) return;
$("zone-favicon").href = `/favicon-${zoneName}.svg`;
faviconZone = zoneName;
}
function setZoneClass(el, zoneName) {
el.className = el.className.replace(/\bzone-\w+/g, "").trim();
el.classList.add(`zone-${zoneName}`);
@@ -432,6 +440,7 @@ function tick() {
cd.textContent = formatMs(remaining);
setZoneClass(cd, zone.name);
setZoneClass($("the-button"), zone.name);
updateFavicon(zone.name);
$("zone-label").textContent = game.ended ? "season finished" : `${zone.name} zone \u00b7 ${zone.points} pt${zone.points === 1 ? "" : "s"}`;
const pct = Math.min(100, Math.max(0, ((game.duration_ms - remaining) / game.duration_ms) * 100));
$("zone-marker").style.left = `${pct}%`;