Skip to content

fix(work): restore row visibility after case-study back-navigation - #26

Merged
FafLikeASir merged 1 commit into
mainfrom
fix/work-rows-invisible-after-back-nav
Jun 26, 2026
Merged

fix(work): restore row visibility after case-study back-navigation#26
FafLikeASir merged 1 commit into
mainfrom
fix/work-rows-invisible-after-back-nav

Conversation

@FafLikeASir

Copy link
Copy Markdown
Owner

Summary

  • gsap.from() stamped opacity: 0 on .work-row elements immediately on mount (immediateRender: true). On back-navigation, Next.js restores scroll to #work before or concurrently with the GSAP effect — the ScrollTrigger start was already past when registered, so the animation never fired and rows stayed invisible.
  • Fix: CSS owns the initial hidden state (.work-row { opacity: 0 }), GSAP uses gsap.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-motion guard now uses gsap.set() to reveal elements instead of an early return that would leave them hidden by CSS forever.

Test plan

  • Fresh load → scroll to Work section → rows animate in normally
  • Click "Read case study" → navigate to case study page
  • Click "← Back" → rows immediately visible on return
  • Browser Back button → same result
  • Enable prefers-reduced-motion → rows visible on load, no animation

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
rahan Building Building Preview, Comment Jun 26, 2026 2:10am

@FafLikeASir
FafLikeASir merged commit 50ec631 into main Jun 26, 2026
2 of 3 checks passed
@FafLikeASir
FafLikeASir deleted the fix/work-rows-invisible-after-back-nav branch June 26, 2026 02:10
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