Description
The Work section uses a GSAP ScrollTrigger timeline with Lenis smooth scrolling. When a user opens a project modal and closes it, the animation resets to its initial state and scrolling no longer drives the animation - the timeline becomes completely detached from scroll position.
Current workaround: Restart timeline + scroll to 83% + refresh ScrollTrigger (feels like a band-aid, not a solution).
Reproduction
- Scroll into Work section to trigger animation (panels slide, laptop opens, chips appear)
- Click a chip → modal opens
- Close modal
- Animation reset, scrolling doesn't update it
Suspected Root Causes
- ScrollTrigger losing sync with scroll position during modal open/close
- Lenis
.stop()/.start() affecting ScrollTrigger tracking
- Modal
overflow: hidden causing desync
- Timeline being killed or paused during modal transition
What I Need to Learn (80/20)
- ScrollTrigger lifecycle - How it tracks scroll, what
refresh()/update() do, why it detaches
- Lenis + ScrollTrigger sync - How they interact, proper pause/resume patterns
- React + GSAP cleanup - Proper disposal patterns
- Debugging tools - Using markers, console logs, progress monitoring
Desired Outcome
Mental model to:
- Understand why the animation state is lost
- Fix it properly without workarounds
- Debug similar issues confidently
Milestones
Stack: React 18, GSAP 3.12, Lenis 1.0, R3F
Tags: gsap, scrolltrigger, lenis, react, animation, modal
Description
The Work section uses a GSAP ScrollTrigger timeline with Lenis smooth scrolling. When a user opens a project modal and closes it, the animation resets to its initial state and scrolling no longer drives the animation - the timeline becomes completely detached from scroll position.
Current workaround: Restart timeline + scroll to 83% + refresh ScrollTrigger (feels like a band-aid, not a solution).
Reproduction
Suspected Root Causes
.stop()/.start()affecting ScrollTrigger trackingoverflow: hiddencausing desyncWhat I Need to Learn (80/20)
refresh()/update()do, why it detachesDesired Outcome
Mental model to:
Milestones
Stack: React 18, GSAP 3.12, Lenis 1.0, R3F
Tags:
gsap,scrolltrigger,lenis,react,animation,modal