01.19 · Scroll-Based

Zoom Into Image

A small window opens up to fill the box as you scroll. Best for hero images.

Scroll it

Scroll inside the box, or press Play and it scrolls for you.

Scroll down ↓

Where it started

Through the Portal

Keep scrolling

The page moves on ↓

Try it

Change a setting, then scroll again or press Play.

Starting window

How much of the picture shows before you scroll.

Corners

The window's corners straighten as it opens.

More optionsFewer options

A faint outline marks where the window began.

Copy the prompt

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

Add a zoom-into-image effect to [your featured picture]. Pin the picture in place while the visitor scrolls through a section a couple of screens tall, and show only a small window of it at first. As they scroll, open that window outward in step with the scroll until the picture fills the whole frame, then fade in a caption. Uncover the picture by clipping it rather than scaling it up, so it stays sharp, and let scrolling back up close the window again. If the visitor has reduced motion turned on, show the full picture and the caption from the start. 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

  • Hero images
  • Gallery intros
  • Section breaks

Avoid on

  • Small images
  • Text-heavy pages