From 9fca3330b5d31f18a3bca87c10b264b4314202f6 Mon Sep 17 00:00:00 2001 From: simonweigold Date: Tue, 4 Aug 2026 14:36:37 +0200 Subject: [PATCH] Keep dots present instead of fading and re-appearing again after animation --- .../src/components/LifecycleAnimation.tsx | 123 +++++++++--------- 1 file changed, 60 insertions(+), 63 deletions(-) diff --git a/apps/website/src/components/LifecycleAnimation.tsx b/apps/website/src/components/LifecycleAnimation.tsx index 65b7d22..ba18c60 100644 --- a/apps/website/src/components/LifecycleAnimation.tsx +++ b/apps/website/src/components/LifecycleAnimation.tsx @@ -21,6 +21,7 @@ export default function LifecycleAnimation({ onFlyStart, onComplete }: Lifecycle if (!svg) return; const scene = q("#scene"); + const stageElements = q("#stage-elements"); const dots = qa("#dots .dot"); const bodies = dots.map( (g) => g.querySelector(".bd") as SVGCircleElement, @@ -41,6 +42,7 @@ export default function LifecycleAnimation({ onFlyStart, onComplete }: Lifecycle if ( !scene || + !stageElements || dots.length !== 5 || bodies.some((b) => !b) || !track || @@ -485,7 +487,7 @@ export default function LifecycleAnimation({ onFlyStart, onComplete }: Lifecycle bodies[i].setAttribute("fill", dotColor(lit)); } - scene.style.opacity = (1 - seg(t, T.holdEnd, T.fadeEnd)).toFixed(3); + stageElements.style.opacity = (1 - seg(t, T.holdEnd, T.fadeEnd)).toFixed(3); const ph = phaseAt(t); setCaption(ph.name, ph.line); @@ -549,8 +551,8 @@ export default function LifecycleAnimation({ onFlyStart, onComplete }: Lifecycle const svgRect = svg.getBoundingClientRect(); const unitX = 820 / svgRect.width; - // Reveal only the dots for the flight - scene.style.opacity = "1"; + // Hide the remaining stage elements so only the dots fly + stageElements.style.opacity = "0"; score.style.opacity = "0"; head.style.opacity = "0"; guide.style.opacity = "0"; @@ -595,13 +597,6 @@ export default function LifecycleAnimation({ onFlyStart, onComplete }: Lifecycle cleanupTimer = window.setTimeout(() => { onComplete?.(); - dots.forEach((dot) => { - dot.animate([{ opacity: 1 }, { opacity: 0 }], { - duration: 200, - easing: "ease-in", - fill: "forwards", - }); - }); }, 900); } @@ -657,60 +652,62 @@ export default function LifecycleAnimation({ onFlyStart, onComplete }: Lifecycle aria-label="Animated loop showing a reasoning kit assembling from five dots into a row, executing by passing a document through each step, moving into a gauge that is scored, and improving from 74 to 94." > - - - - - - - - 94 - - - - - - - - - + + + + + + + + + 94 + + + + + + + + + + + -