From 2cdcf95822e128433a9f3bb5aebdf3a42772233f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 7 Apr 2026 16:57:04 -0500 Subject: [PATCH] fix: don't repeat reveal animation on scroll for tank sandbox --- .../components/TankSandbox/components/Lighting.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Lighting.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Lighting.tsx index 7e69f49c6..a5d6fa550 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Lighting.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Lighting.tsx @@ -38,19 +38,19 @@ export function Lighting() { draft.revealed = true; }); - t0.current = clock.elapsedTime - REVEAL_ANIMATION_TIME; + t0.current = performance.now() / 1000 - REVEAL_ANIMATION_TIME; }, []); useFrame(({ invalidate }) => { if (transition.current) { transition.current = false; - t0.current = clock.elapsedTime; + t0.current = performance.now() / 1000; } const x = clamp( - (clock.elapsedTime - t0.current) / animationTime.current, + (performance.now() / 1000 - t0.current) / animationTime.current, 0, - 2 + 2, ); const t = (0.5 * Math.sin(Math.PI * (x + 0.5)) + 0.5) ** 2;