01.12 · Scroll-Based

Reveal on Scroll

Cards appear as they cross a line in the box. Best for long landing pages.

Scroll it

Scroll inside the box, or press Play. Back to top hides the cards again.

Try it

Change a setting, then scroll again or press Play.

Trigger line

How far up the box a card must come to appear.

Cards hide again below the line and replay each time.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add reveal-on-scroll animations to [the sections or cards on your page]. Keep each element in a hidden starting state, such as faded, shifted, shrunk, blurred or clipped, until it rises past a trigger line inside the view, then let it settle into its normal state. Watch the elements with the browser's intersection observer rather than on every scroll, and count an element that is already above the line as crossed, so a fast scroll never skips one. Reveal each element once, or every time it crosses, as the settings say. If the visitor has reduced motion turned on, show each element without movement. 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

  • Landing pages
  • Feature lists
  • Blog sections

Avoid on

  • Key information
  • Forms