Add running personal records and historical PR badges

This commit is contained in:
Peter Stockings
2026-10-02 13:52:27 +10:00
parent b902ec6312
commit a82135bc89
10 changed files with 240 additions and 9 deletions
+1 -5
View File
@@ -13,7 +13,6 @@ async function showDashboardRoute() {
const container = document.getElementById("dashboard-route-map");
if (!container?.dataset.url) return;
const status = document.getElementById("dashboard-route-status");
const toggle = document.getElementById("toggle-route-replay");
try {
const response = await fetch(container.dataset.url);
if (!response.ok) throw new Error("Route unavailable");
@@ -57,12 +56,9 @@ async function showDashboardRoute() {
const update = () => {
if (frame !== null) cancelAnimationFrame(frame);
frame = null; previous = null;
toggle.textContent = paused ? "Play replay" : "Pause replay";
status.textContent = paused ? "Replay paused. Explore the recorded route." : "Following the recorded route · 20-second replay";
status.hidden = true;
if (!paused && !document.hidden) frame = requestAnimationFrame(tick);
};
toggle.hidden = false;
toggle.onclick = () => { paused = !paused; update(); };
preference.addEventListener("change", event => { paused = event.matches; update(); });
document.addEventListener("visibilitychange", update);
update();