fix(work): restore row visibility after case-study back-navigation - #26
Merged
Merged
Conversation
gsap.from() stamped opacity:0 on mount; if ScrollTrigger's start was already past when the trigger registered (scroll restored to #work), the animation never fired. Fix: CSS owns the hidden state, gsap.to() animates to the visible state — snaps immediately when trigger is past. Also reveal elements explicitly under prefers-reduced-motion so the CSS initial state doesn't leave rows hidden forever. Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
gsap.from()stampedopacity: 0on.work-rowelements immediately on mount (immediateRender: true). On back-navigation, Next.js restores scroll to#workbefore or concurrently with the GSAP effect — the ScrollTrigger start was already past when registered, so the animation never fired and rows stayed invisible..work-row { opacity: 0 }), GSAP usesgsap.to()to animate to the visible state. When a trigger is already past on init,gsap.to()snaps immediately to the target values (opacity: 1, y: 0).prefers-reduced-motionguard now usesgsap.set()to reveal elements instead of an earlyreturnthat would leave them hidden by CSS forever.Test plan
🤖 Generated with Claude Code