perf(landing): stop the background animation only after it fully fades out#318
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
How
homepage/index.tsx: the ref/rAF scroll-fade setsdata-bg-hiddenon<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 whiledata-bg-hidden(or tab hidden); keeps the 30fps cap + low-res.globals.css:html[data-bg-hidden] [class*="animate-aurora"] { animation-play-state: paused }.tscclean ·jest362 · lint clean. Independent of #317 (mouse-effect); they touch different lines and merge cleanly in any order.🤖 Generated with Claude Code