Skip to content

perf(landing): stop the background animation only after it fully fades out#318

Merged
QSchlegel merged 1 commit into
preprodfrom
claude/landing-stop-after-fade
Jun 15, 2026
Merged

perf(landing): stop the background animation only after it fully fades out#318
QSchlegel merged 1 commit into
preprodfrom
claude/landing-stop-after-fade

Conversation

@QSchlegel

Copy link
Copy Markdown
Collaborator

Re-opens a change that was lost: this was pushed onto #316 after #316 had already been merged, so it never reached preprod. (#316 only merged its first commit, "drop pause-on-scroll".)

Behavior

  • While visible or fading (incl. during scroll): the aurora + marble keep animating continuously.
  • After it fully fades out: once the scroll fade hits 0 opacity, the animation stops ~800ms later — imperceptible because the layer is already invisible — freeing the GPU for the rest of the long landing page.
  • Scrolling back up: resumes instantly the moment it starts fading back in.

How

  • homepage/index.tsx: the ref/rAF scroll-fade sets data-bg-hidden on <html> ~800ms after both layers reach 0 opacity, clears it immediately when visible again (still no React re-render on scroll).
  • marble-field.tsx: the WebGL loop skips its draw while data-bg-hidden (or tab hidden); keeps the 30fps cap + low-res.
  • globals.css: html[data-bg-hidden] [class*="animate-aurora"] { animation-play-state: paused }.

tsc clean · jest 362 · lint clean. Independent of #317 (mouse-effect); they touch different lines and merge cleanly in any order.

🤖 Generated with Claude Code

…s out

Builds on dropping the pause-on-scroll: instead of stopping the animation while
scrolling (jarring), keep it running the whole time it's visible or fading, and
only stop it once it has fully faded out — a beat later (~800ms), when it's
invisible so the stop is imperceptible.

PageHomepage sets data-bg-hidden on <html> ~800ms after the scroll fade reaches
0 opacity, and clears it instantly the moment the background starts fading back
in. While the flag is set the marble shader skips its draws and the aurora's
animations are paused (globals.css). Net: smooth continuous motion whenever you
can see it, zero GPU spent on it once it's gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
multisig Building Building Preview, Comment Jun 15, 2026 11:17am

Request Review

@QSchlegel QSchlegel merged commit 956b797 into preprod Jun 15, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant