MotionMiddleweight
Scroll-driven animation
Scrolling is the timeline.
Scrolling is the timeline. As the reader moves down the page a scene rotates, a camera travels, a story unfolds, and it all runs backwards when they scroll up. Most long product pages use it.
- Breaks when
- jank without smooth scrollmobile address bar resizes the viewport
- Also called
- ScrollTrigger, scrub, scroll-timeline, Lenis
Prompts
Pinned scene, scrubbed model
GSAP ScrollTrigger pinning a full-viewport Three.js canvas for 300 vh: scrub 0.6, the model rotates 1.5 turns and the camera dollies from z = 6 to z = 2.5 across the pin, with three HTML captions fading in at 20%, 50% and 80% of progress. Use Lenis for smoothing and call ScrollTrigger.update on its scroll event. Recompute on resize with ScrollTrigger.refresh; guard against the iOS address-bar resize by ignoring height changes under 120 px.
CSS-only scroll timeline
Implement a scroll-driven progress bar and a parallax header with pure CSS animation-timeline: scroll() for the bar, view() for the header entering the viewport. No JavaScript. Provide the @supports fallback that shows the static end state where animation-timeline is unsupported.
Horizontal section inside a vertical page
A horizontal gallery of 6 panels that scrolls sideways while the page scrolls down: pin the section for 6 × 100 vh, translate the track with scrub, and snap to panels with ScrollTrigger snap { snapTo: 1/5, duration: 0.4 }. Panel images use loading="lazy" and the track uses will-change: transform only while pinned.Related
Resources · 3
- GSAP ScrollTriggergreensocksite · code · demoAug 5, 2026
- Lenis smooth scrollPair with ScrollTrigger; fixes scrub jank.darkroomengineeringGitHub · code · demoAug 3, 2026
- scroll-driven-animations.styleCSS-only scroll timelines, no JS.bramussite · code · demoJun 5, 2026