01.08 · Scroll-Based
Scrub Animation
Scroll plays it forward and back, like dragging a video. Best for product tours.
Scroll it
Scroll inside the box, down and back up, or press Play and it scrolls for you.
Inside, the dot on the graph shows how far the plane has flown for how far you scrolled; with Even the line is straight. Scroll the box or press Play to watch.
Plays by itself flies the whole route on its own once you start scrolling; Follows the scroll goes only as far as you scroll, and back. Scroll the box or press Play to watch.
Try it
Change a setting, then scroll again or press Play.
Feel
Even follows the scroll exactly; the others reshape it.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a scroll-scrubbed animation to [your illustration or product explainer]. Hold the scene in view while the visitor scrolls through a taller section, and turn how far they have scrolled into a progress value from 0 to 1. Draw the whole route up front, place the moving object at the point on it that matches the progress, facing along the path, and fill in the part already traveled. Nothing plays on a timer: scrolling back simply moves it back. Shape the progress with the easing given in the settings. If the visitor has reduced motion turned on, drop decorative effects but keep the object following the scroll. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
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.