Menu

Scroll into the picture: a depth hero with CSS perspective, an easing camera and a cursor light
📰

Scroll into the picture: a depth hero with CSS perspective, an easing camera and a cursor light

DEV Community: css·ZEUS LAB·10 days ago
#Bglk7q6S
#devtocss#devto#dev#layer#scroll
Long article (1065 words) — no AI summary yet.
Reading 0:00
15s threshold

A landing hero usually puts a picture behind some text. This one lets you scroll into it: the camera moves through the subject, a light under the pointer shows a second view of the film, and past the subject three cards come out of the depth.

It is plain HTML, CSS and one small script. No WebGL, no animation library. In headless Chrome on our machine, requestAnimationFrame ran 60–61 times per second at each of the seven scroll positions we measured (one second at each), on a 1440×900 and a 390×844 viewport.

Here is how it is built, and the one mistake that cost me an hour.

1.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.