fix: eliminate gradient flash on real mobile devices - #25
Open
jagadeep298218 wants to merge 2 commits into
Open
Conversation
On real phones, momentum scrolling traverses the 250vh hero section in under a second. Two issues combined to produce a full-screen gradient flash: 1. The reveal (autoAlpha 0→1) and whiteout (autoAlpha 1→0) were separate ScrollTrigger tweens each with 0.6s scrub lag. During fast scrolling they caught up at different times, leaving the gradient at full opacity in the gap. Fixed by using scrub: true (zero lag) on mobile so both tweens track scroll position exactly. 2. The WebGL canvas inside SVG foreignObject was promoted to an independent GPU compositing layer on mobile, ignoring parent opacity/visibility. Fixed by replacing the WebGL path with a CSS gradient on mobile, set via GSAP (not JSX) so it appears atomically with autoAlpha: 0. Additionally, CometTrailBackground is now loaded with next/dynamic ssr: false to prevent the WebGL canvas from appearing in server HTML. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Same root cause as the hero gradient flash: mobile GPUs promote WebGL canvases inside SVG foreignObject to independent compositing layers that ignore SVG masks. Replace WebGL with CSS gradient on mobile and use scrub: true for zero-lag scroll tracking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
scrub: truefor zero-lag scroll tracking. Load CometTrailBackground withnext/dynamicssr: false.scrub: trueinstead of0.6to prevent flash from momentum scrolling.Root cause
Mobile GPUs promote WebGL canvases inside SVG
foreignObjectto independent compositing layers that ignore SVG masks and parent opacity/visibility. Combined with numericscrublag (0.6s), momentum scrolling on real phones causes the gradient to flash full-screen before animations catch up.Test plan
🤖 Generated with Claude Code