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.

0%25%50%75%How far you scrolled100%

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.

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 GitHub

What it is

The full explanation is in README.md.

Good for

  • Product tours
  • Explainers
  • Step-by-step diagrams

Avoid on

  • Short sections
  • Key information