01.24 · Scroll-Based
SVG Line Draw on Scroll
A line draws itself along a route as you scroll. Best for timelines.
Scroll it
Scroll inside the box, or press Play and it scrolls for you.
Inside, ticks cut the route into tenths and the bright dot is the pen tip; the bars compare how far you scrolled with how much is drawn. Scroll the box or press Play to watch.
Already drawn shows the whole route from the start; Draws on scroll draws the line as you go. Scroll the box or press Play to watch.
Try it
Change a setting, then scroll again or press Play.
Feel
Even keeps the tip with your scroll; Smooth runs ahead.
Labeled points pop in as the line reaches them.
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-drawn route to [your timeline, journey or process steps]. Draw a long winding path down the page with a faint dashed copy underneath, and reveal the solid line in step with the scroll so its tip travels down with the visitor. Measure the path's length once and reveal it by sliding a single dash that is exactly as long as the path. When the settings include them, place labeled stops along the path and pop each one in as the line reaches it; scrolling back up erases the line and hides them again. If the visitor has reduced motion turned on, show each stop without the pop. 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.