From 329311b3563f2189421472e144a0b487a2230b37 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 8 Oct 2026 02:07:43 +0200 Subject: [PATCH] Concept Mill: keep the server-rendered ship dark on deep links The server renders the first ship so the stage is never empty, but on a slow connection a deep link showed it until the requested render decoded. It now stays dark unless it is the ship the hash asks for. Co-Authored-By: Claude Opus 5.5 --- .../components/scripts/aetheriaConceptMill.inline.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/site/quartz/components/scripts/aetheriaConceptMill.inline.ts b/site/quartz/components/scripts/aetheriaConceptMill.inline.ts index b357c57..d775b7d 100644 --- a/site/quartz/components/scripts/aetheriaConceptMill.inline.ts +++ b/site/quartz/components/scripts/aetheriaConceptMill.inline.ts @@ -208,7 +208,10 @@ function setup(root: HTMLElement) { let liveRef = live let nextRef = next function swap(variant: Variant, ship: Ship) { - if (liveRef.getAttribute("src") === variant.image) return + if (liveRef.getAttribute("src") === variant.image) { + liveRef.classList.add("is-live") + return + } const target = nextRef target.alt = `Concept render of the ${ship.name}, ${variant.round}` target.src = variant.image @@ -391,6 +394,9 @@ function setup(root: HTMLElement) { stage.addEventListener("touchstart", onTouchStart, { passive: true }) stage.addEventListener("touchend", onTouchEnd, { passive: true }) + // The server-rendered ship stays dark unless it is the one the hash asks + // for, so a slow deep link never shows the wrong ship first. + live.classList.remove("is-live") const initial = parseHash() select(initial?.i ?? 0, initial?.v, Boolean(initial)) root.classList.add("is-ready")