Lab 03
Scroll animation generator for GSAP ScrollTriggerTune scroll motionon real content.
Five of the setups I use most, built with GSAP and ScrollTrigger, with every knob exposed. Change the easing, the scrub, the pin, the trigger points. Watch the frame rate. Then copy the exact code.
GSAP for this setup
gsap.from(".card", {
y: 80,
scale: 0.92,
autoAlpha: 0,
duration: 1,
stagger: 0.12,
ease: "power3.out",
scrollTrigger: {
trigger: section,
start: "top 85%",
},
});Scrub
Ties the animation to the scrollbar. Off means it plays once when the trigger is hit; a number adds smoothing in seconds.
Pin
Holds the section in place while the scroll distance plays out. The stage uses transform pinning, the same as this site.
Markers
Shows where start and end are measured. Turn them on whenever a trigger fires at the wrong moment.
A scroll animation generator for GSAP ScrollTrigger
This scroll animation generator lets you tune five real GSAP ScrollTrigger setups on a live stage before you write any code. Change the easing, scrub, pin and trigger points, scroll inside the stage to see the result, then copy the GSAP code for exactly what you see.
- 01
Pick a setup
Choose one of five presets: Cards stack, Horizontal scroll, Parallax layers, Text reveal or Pinned timeline. Each one loads with sensible defaults.
- 02
Tune it on the stage
Adjust the ease, duration, stagger, scrub, start point and scroll distance. Turn pinning and markers on or off. Scroll inside the stage and watch the progress bar and the frame rate meter.
- 03
Copy the code
The code panel updates with every change. Press Copy to get the GSAP code for the current setup, with only the ScrollTrigger options that matter for it.
Website scroll animation: the five patterns
Most website scroll animation falls into a few patterns: elements that fade or slide in as they enter the screen (often called animate on scroll), a parallax scrolling effect where layers move at different speeds, text that reveals line by line, a horizontal scrolling section, and a pinned section where a timeline plays while the page holds still. The presets here cover all five, so you can see each one on real content before you build it.
For simple entrance animations, CSS can be enough: animation-timeline: view() in browsers that support CSS scroll-driven animations, or a small IntersectionObserver that adds a class. Use GSAP ScrollTrigger when you need pinning, scrubbing tied to the scrollbar, or several animations that have to stay in sync, which is where CSS gets hard to manage.
What the controls do
Scrub ties the animation to the scrollbar. Off plays it once when the trigger is hit, on follows the scrollbar exactly, and smooth adds a delay in seconds so the animation catches up. Pin holds the section in place while the scroll distance plays out. Markers show where the start and end are measured, which is the fastest way to debug a trigger that fires at the wrong time.
Start sets where the top of the section meets the viewport, written as top 85%. Scroll distance sets how long a pinned or scrubbed section lasts, written as end: "+=200%" in the output.
What the generated code looks like
The output is plain GSAP: a gsap.from(), gsap.to(), gsap.fromTo() or a timeline with a scrollTrigger object. The text reveal uses SplitText.create() with line masks. Since GSAP 3.13 every plugin, SplitText included, is free.
The code expects a section element (and a heading for the text reveal) and registered plugins. In React or Next.js, run it inside useGSAP() so it is cleaned up on unmount. My guide to pinning a section in React shows the full component.
When to use each setup
Use Cards stack and Text reveal for content that should arrive once, with scrub off. Use Horizontal scroll for a row of work or features that is wider than the screen. Use Parallax layers for depth in a hero or a section break, and keep the movement small. Use Pinned timeline when one panel has to explain a few steps in order, such as how a product works.
Whatever you pick, respect people who reduce motion in their system settings. Wrap the code in gsap.matchMedia() with (prefers-reduced-motion: no-preference) and show the final state otherwise.
Frequently asked questions
Does this generate React code?
It generates plain GSAP code that works in any framework. In React or Next.js, register ScrollTrigger once, put the code inside a useGSAP() hook scoped to a ref, and replace the section variable with your ref's element. The hook reverts the animation when the component unmounts.
Why does my pinned section jump or overlap the next one?
Usually because the page height changed after ScrollTrigger measured it, for example when images or fonts load late. Call ScrollTrigger.refresh() after they load, set image sizes in CSS, and turn on markers to check the start and end. Create triggers in the order they appear on the page.
What is the difference between scrub true and a number?
With scrub: true the animation follows the scrollbar exactly, so it stops the moment you stop scrolling. With a number such as scrub: 1, the animation takes that many seconds to catch up, which feels smoother with a mouse wheel. The smooth option in the generator sets that number.
Will these scroll animations run at 60fps?
The presets animate only transforms and opacity, which the browser can usually keep smooth. The stage shows a live frame rate so you can check on your own device. Heavy images, filters and very large pinned sections are the usual causes of dropped frames, so test on a mid-range phone too.
Need this built into your site?
I build tools like this one, and the sites around them. Tell me what you need and I will reply with a plan and a fixed price.