01.07 · Scroll-Based
Scroll-Triggered Animation
Animations start, follow and pin at set scroll points. Best for landing pages.
Scroll it
Scroll inside the box, or press Play and it scrolls for you.
Inside, the square and dots play while their middle crosses from the start line to the end line, and the card is held while its zone passes. Scroll the box or press Play to watch.
In No triggers the four zones just scroll by; in With triggers the text fades in, the square turns, the card holds and the dots light. Scroll the box or press Play to watch.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add scroll-triggered animations to [the sections of your page]. Split the page into zones and work out from the scroll position whether each zone is still ahead, on screen or already passed. Fade a zone's content in when the zone arrives and hide it again when it has gone. Tie another animation's progress to how far the visitor has scrolled through its zone, so it plays forward and back with the scroll. Pin one card in place while its text steps through a few stages, and light up a row of dots in steps. Leave some space after the last zone so it can finish. If the visitor has reduced motion turned on, show content without fading it.
Your settings
Replace the words in brackets with your own sections.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.