CSS Scroll Image Zoom Parallax — Frame Reveal, No JS
CSS Scroll Timeline Image Zoom Parallax · Scroll · Plain HTML, CSS & JS · Live preview
About this UI Snippet
CSS Scroll Timeline Image Zoom Parallax — A Frame-Reveal Hero With No JavaScript

This hero starts as a small, rounded window onto a fjord, with a huge "Into the wild" title across it and four photo cards floating in the dark around it. As you scroll, the window opens to full-bleed while the photo inside settles from a deep zoom, the two title lines slide apart, the cards drift upward at different speeds and fade, and a caption rises in with numbers that count up. A thin progress bar tracks the page. All of it is CSS: there is no scroll listener and no library.
One named timeline for the whole hero
.izp-hero is 340vh tall and declares view-timeline: --izp-hero block. Its child .izp-stage is position: sticky; top: 0 and one viewport tall, so it stays on screen while the hero scrolls through. Every animated layer inside uses animation-timeline: --izp-hero with animation-range: contain 0% contain 100%. For an element taller than the viewport, the contain range is exactly the stretch where it covers the whole screen, which is also exactly the time the stage is stuck. The sequence therefore starts when the hero reaches the top and ends when it leaves, wherever the hero sits on the page. (Timing it with scroll(root) percentages instead would break as soon as there is content above or below.)
Choreography with keyframe percentages
All layers share the same range, and the timing lives in the keyframes. The window opens over the first 55%, the title is gone by 40%, the cards fade between 40% and 65%, the scrim darkens from 50% to 75%, the caption arrives between 58% and 78%, and the numbers count from 62% to 84%. Changing the pace of one layer is a matter of moving its percentages.
The window: clip-path plus a counter-zoom
.izp-frame animates clip-path: inset(17% 28% round 28px) to inset(0 round 0), so the visible area grows from a centred card to the full screen. The photo inside scales from 1.45 down to about 1 at the same time. Because the frame grows while the picture shrinks, the scene seems to come toward you rather than just getting bigger, and then a slow zoom to 1.14 keeps it alive until the end. The inset values are custom properties, so the phone layout uses a taller, narrower window.
A title that splits, and cards at different depths
The two title lines slide out to opposite sides with translateX(±60vw). The title uses mix-blend-mode: difference, so it stays white over the dark page and turns into a negative of the photo where it crosses the window. Each card shares one izp-float keyframe but reads its own --izp-rise distance (from -70vh to -130vh). Cards that travel further look closer, which gives a parallax effect from a single keyframe.
Numbers that count up in CSS
Each stat holds its target in an inline --to variable. A registered @property --izp-n with syntax: '<integer>' can be animated from 0 to var(--to), and counter-reset: izp var(--izp-n) together with content: counter(izp) prints the current value. Each item has an aria-label with the real number, so screen readers do not depend on generated content.
Built as progressive enhancement
The base CSS is the finished hero: a full-bleed photo, scrim, caption and final numbers in a single viewport. The whole sequence sits inside @media (prefers-reduced-motion: no-preference) and @supports (animation-timeline: view()). Browsers without scroll-driven animations, and anyone who asks for reduced motion, get a complete, still hero instead of a half-animated one, and the extra cards and title are not shown to them at all. For a different take on the idea, see CSS-Only Parallax Perspective Section, which builds parallax depth from 3D transforms, or the Three.js Scroll City Flyover for a full WebGL scroll story.
What's included
Features
Step by step
How to Use
- 1Paste the HTML and CSSThere is no JavaScript. The hero opens as a small framed photo with a large title and four floating cards.
- 2Scroll through the heroThe window opens to full screen, the title splits, the cards float away, and the caption and counting numbers come in.
- 3Scroll back upEverything rewinds exactly, because each layer reads its progress from the live scroll position.
- 4Use your own photosReplace the picsum.photos URLs on .izp-img and the four .izp-card images, and update the alt text.
- 5Change the numbersEdit the --to value, unit and label on each .izp-stat, and the aria-label that screen readers read.
- 6Retime the sequenceMove the percentages inside the @keyframes, or make .izp-hero taller (340vh) to slow the whole thing down.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
scroll(root) measures the whole page, so percentages only match the hero when nothing else is on the page. A view-timeline declared on the hero measures the hero itself, and the contain range covers exactly the time it fills the viewport, which is when the sticky stage is stuck. The sequence then lines up no matter what comes before or after it.
Each stat stores its target in --to. A custom property registered with @property and syntax '<integer>' can be animated, so a keyframe takes --izp-n from 0 to var(--to). counter-reset turns that integer into a CSS counter, and ::after prints it with content: counter(izp). Each list item has an aria-label so screen readers get the real value.
The base CSS is the end state: a full-bleed photo with its caption and final numbers in one screen-height hero. All of the sticky, timeline and animation rules live inside @media (prefers-reduced-motion: no-preference) and @supports (animation-timeline: view()), so those visitors get a finished, still hero, and the extra title and cards are hidden.
If the frame only grew, the photo would just get bigger. Scaling the photo down from 1.45 to about 1 while the clip-path opens makes the scene appear to come toward the viewer, like a camera dolly. A gentle zoom to 1.14 afterwards keeps it moving until the hero ends.
Change the height of .izp-hero: more height means more scrolling for the same sequence. To change only one part, move that layer's keyframe percentages, for example ending izp-open at 45% instead of 55% for a quicker reveal.
Chrome, Edge and other Chromium browsers support scroll-driven animations, and Safari added them in version 26. Firefox has them behind a flag, so Firefox users currently see the still version.
Copy & paste
Source Code
<div class="izp-progress" aria-hidden="true"></div>
<section class="izp-hero">
<div class="izp-stage">
<div class="izp-frame">
<img class="izp-img" src="https://picsum.photos/id/1015/2000/1300" alt="A deep blue fjord between steep granite cliffs" fetchpriority="high">
<div class="izp-scrim" aria-hidden="true"></div>
</div>
<h1 class="izp-title"><span>Into</span><span>the wild</span></h1>
<figure class="izp-card izp-card--a" aria-hidden="true"><img src="https://picsum.photos/id/1036/420/525" alt="" loading="lazy"></figure>
<figure class="izp-card izp-card--b" aria-hidden="true"><img src="https://picsum.photos/id/1039/420/525" alt="" loading="lazy"></figure>
<figure class="izp-card izp-card--c" aria-hidden="true"><img src="https://picsum.photos/id/1043/420/525" alt="" loading="lazy"></figure>
<figure class="izp-card izp-card--d" aria-hidden="true"><img src="https://picsum.photos/id/1044/420/525" alt="" loading="lazy"></figure>
<div class="izp-caption">
<span class="izp-eyebrow">Lysefjord, Norway</span>
<h2>Stand 604 metres above the water.</h2>
<p>Scrolling opens the window. One <code>view()</code> timeline drives the frame, the photo, the floating shots and these numbers. No JavaScript.</p>
<ul class="izp-stats">
<li class="izp-stat" style="--to:604" aria-label="604 metres cliff height"><strong><span class="izp-num"></span> m</strong><span>Cliff height</span></li>
<li class="izp-stat" style="--to:42" aria-label="42 kilometres fjord length"><strong><span class="izp-num"></span> km</strong><span>Fjord length</span></li>
<li class="izp-stat" style="--to:8" aria-label="8 kilometre hike"><strong><span class="izp-num"></span> km</strong><span>Hike</span></li>
</ul>
</div>
<p class="izp-cue" aria-hidden="true"><span></span>Scroll</p>
</div>
</section>
<section class="izp-after">
<h2>Back to the page</h2>
<p>The whole sequence lives inside the hero's own scroll distance. Once it has passed, the page scrolls normally again.</p>
</section>*{box-sizing:border-box;margin:0;padding:0}
html,body{background:#07070b}
body{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#f4f2fb}
img{display:block}
code{background:rgba(240,171,252,.14);color:#f5c6f0;padding:2px 6px;border-radius:5px;font-size:.9em;font-family:ui-monospace,Consolas,monospace}
/* ---------- Base = finished state ----------
Without scroll-driven animation support, or with reduced motion,
you get this: a full-bleed photo with its caption and numbers. */
.izp-progress{display:none}
.izp-hero{position:relative;height:100vh;height:100dvh}
.izp-stage{position:relative;height:100vh;height:100dvh;overflow:hidden;isolation:isolate}
.izp-frame{position:absolute;inset:0;z-index:1;overflow:hidden}
.izp-img{width:100%;height:100%;object-fit:cover;transform-origin:50% 55%}
.izp-scrim{position:absolute;inset:0;background:
linear-gradient(to top,rgba(5,4,10,.92) 0%,rgba(5,4,10,.5) 34%,transparent 62%),
linear-gradient(to right,rgba(5,4,10,.6) 0%,transparent 55%)}
.izp-title,.izp-card,.izp-cue{display:none}
.izp-caption{position:absolute;z-index:4;left:0;bottom:0;max-width:720px;display:flex;flex-direction:column;gap:14px;padding:0 clamp(20px,7vw,96px) clamp(28px,9vh,80px)}
.izp-eyebrow{font-size:12px;font-weight:600;letter-spacing:.2em;text-transform:uppercase;color:#f0abfc}
.izp-caption h2{font-size:clamp(30px,5vw,58px);line-height:1.03;letter-spacing:-.03em;text-shadow:0 4px 30px rgba(0,0,0,.5)}
.izp-caption p{color:#e4dff2;font-size:16px;line-height:1.7;max-width:480px}
.izp-stats{display:flex;gap:clamp(20px,4vw,48px);list-style:none;margin-top:10px;padding-top:18px;border-top:1px solid rgba(255,255,255,.14)}
.izp-stat strong{display:block;font-size:clamp(22px,2.6vw,32px);font-weight:800;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.izp-stat > span{font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:#b9b1d6}
/* The numbers are CSS counters, so they can count up on scroll (below). */
@property --izp-n{syntax:'<integer>';inherits:false;initial-value:0}
.izp-stat{--izp-n:var(--to);counter-reset:izp var(--izp-n)}
.izp-num::after{content:counter(izp)}
.izp-after{min-height:70vh;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;text-align:center;padding:48px 24px;max-width:560px;margin:0 auto}
.izp-after h2{font-size:clamp(24px,3vw,32px);letter-spacing:-.02em}
.izp-after p{color:#a79fc4;font-size:15.5px;line-height:1.75}
/* ---------- Enhanced: the scroll-driven sequence ---------- */
@media (prefers-reduced-motion:no-preference){
@supports (animation-timeline:view()){
/* The hero is tall; its stage sticks while the hero scrolls through.
view-timeline names that journey so every layer inside can use it. */
.izp-hero{height:340vh;view-timeline:--izp-hero block}
.izp-stage{position:sticky;top:0}
.izp-stage{--izp-x:28%;--izp-y:17%}
/* "contain" = the stretch where the hero fully covers the viewport,
which is exactly while the stage is stuck. */
.izp-frame,.izp-img,.izp-scrim,.izp-title span,.izp-card,.izp-caption,.izp-stat,.izp-cue{
animation-timing-function:linear;animation-fill-mode:both;
animation-timeline:--izp-hero;animation-range:contain 0% contain 100%;
}
.izp-frame{animation-name:izp-open}
.izp-img{animation-name:izp-settle}
.izp-scrim{animation-name:izp-dim}
.izp-caption{animation-name:izp-caption}
.izp-stat{animation-name:izp-count}
.izp-cue{display:flex;animation-name:izp-cue}
.izp-title{display:flex;position:absolute;inset:0;z-index:3;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;
font-size:clamp(56px,12.5vw,200px);font-weight:900;line-height:.86;letter-spacing:-.05em;text-transform:uppercase;color:#fff;mix-blend-mode:difference}
.izp-title span{display:block;animation-name:izp-left}
.izp-title span + span{animation-name:izp-right}
.izp-card{display:block;position:absolute;z-index:2;width:clamp(110px,13vw,210px);aspect-ratio:4/5;border-radius:18px;overflow:hidden;
box-shadow:0 30px 60px -20px rgba(0,0,0,.85);outline:1px solid rgba(255,255,255,.14);outline-offset:-1px;animation-name:izp-float}
.izp-card img{width:100%;height:100%;object-fit:cover}
/* Each card rises a different distance = a different depth. */
.izp-card--a{left:5%;top:11%;rotate:-6deg;--izp-rise:-70vh}
.izp-card--b{right:6%;top:15%;rotate:5deg;--izp-rise:-95vh}
.izp-card--c{left:9%;bottom:8%;rotate:4deg;--izp-rise:-130vh}
.izp-card--d{right:9%;bottom:12%;rotate:-4deg;--izp-rise:-110vh}
.izp-progress{display:block;position:fixed;top:0;left:0;right:0;height:3px;z-index:20;
background:linear-gradient(90deg,#f0abfc,#fb923c);transform-origin:left;
animation:izp-grow linear both;animation-timeline:scroll(root)}
.izp-cue{position:absolute;z-index:4;left:50%;bottom:26px;translate:-50% 0;flex-direction:column;align-items:center;gap:10px;
font-size:11px;font-weight:600;letter-spacing:.24em;text-transform:uppercase;color:rgba(255,255,255,.65)}
.izp-cue span{width:1px;height:38px;background:linear-gradient(#fff,transparent);transform-origin:top;animation:izp-drip 1.8s ease-in-out infinite}
@media (max-width:700px){
.izp-stage{--izp-x:7%;--izp-y:24%}
.izp-card{display:none}
}
}
}
@keyframes izp-open{
0%{clip-path:inset(var(--izp-y) var(--izp-x) round 28px)}
55%,100%{clip-path:inset(0 0 round 0)}
}
@keyframes izp-settle{
0%{transform:scale(1.45)}
55%{transform:scale(1.04)}
100%{transform:scale(1.14) translateY(-2%)}
}
@keyframes izp-dim{0%,50%{opacity:0}75%,100%{opacity:1}}
@keyframes izp-left{0%{transform:none;opacity:1}40%,100%{transform:translateX(-60vw);opacity:0}}
@keyframes izp-right{0%{transform:none;opacity:1}40%,100%{transform:translateX(60vw);opacity:0}}
@keyframes izp-float{
0%{transform:none;opacity:1}
40%{opacity:1}
65%,100%{transform:translateY(var(--izp-rise)) scale(.92);opacity:0}
}
@keyframes izp-caption{0%,58%{opacity:0;transform:translateY(40px)}78%,100%{opacity:1;transform:none}}
@keyframes izp-count{0%,62%{--izp-n:0}84%,100%{--izp-n:var(--to)}}
@keyframes izp-cue{0%{opacity:1}8%,100%{opacity:0}}
@keyframes izp-grow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes izp-drip{0%{transform:scaleY(0);opacity:1}60%{transform:scaleY(1);opacity:1}100%{transform:scaleY(1);opacity:0}}// No JavaScript. Every movement in this hero comes from CSS:
// a view-timeline on .izp-hero drives the frame, photo, title, cards,
// caption and counters, and scroll(root) drives the top progress bar.Extend with AI
Take This Snippet Further With AI
You do not have to work out scroll-driven choreography by trial and error. Paste this snippet's HTML and CSS into an AI assistant like Claude and ask it why the hero uses a named view-timeline with a contain range instead of scroll(root), how the integer @property makes the numbers count, or why the photo scales down while the window opens. It can also help you extend the hero: add a second chapter where the photo pans to another part of the fjord, reveal a call-to-action button at the end, blur and darken the photo as the caption arrives, or swap the four cards for a looping strip of thumbnails.
Prompt to recreate it
Copy this into your AI assistant of choice to build the effect from scratch, or as a jumping-off point for your own variant:
Build a scroll-driven "frame reveal" hero in plain HTML and CSS with no JavaScript, using CSS scroll-driven animations.
Requirements:
- Base CSS is the finished state: a one-screen hero with a full-bleed photo (img, object-fit: cover), a bottom-and-left darkening scrim, and a bottom-left caption with an eyebrow, a heading, a short paragraph and three stats. This is what browsers without support and reduced-motion users see.
- Put all motion inside @media (prefers-reduced-motion: no-preference) and @supports (animation-timeline: view()).
- In that block, make the hero about 340vh tall with view-timeline: --izp-hero block, and a sticky (top: 0) full-viewport stage inside it. Every animated layer uses animation-timeline: --izp-hero, animation-range: contain 0% contain 100%, linear timing and fill-mode both; do the choreography with keyframe percentages.
- Frame: clip-path from inset(17% 28% round 28px) to inset(0 round 0) by 55% (use custom properties for the inset so phones can start taller and narrower). Photo inside: scale 1.45 to 1.04 by 55%, then to 1.14 with a slight upward drift by 100%.
- A huge two-line uppercase title centred over the frame with mix-blend-mode: difference; the lines slide out to -60vw and +60vw and fade by 40%.
- Four rotated photo cards in the dark margins around the frame that rise by different distances (a per-card --rise variable, -70vh to -130vh), shrink slightly and fade between 40% and 65%. Hide them on narrow screens.
- Scrim fades in from 50% to 75%, caption rises and fades in from 58% to 78%.
- Stats count up from 62% to 84% using a registered @property integer animated from 0 to an inline --to value, shown with counter-reset and content: counter(). Give each stat an aria-label with the real value.
- A scroll cue with an animated line that fades out in the first 8%, and a thin gradient progress bar fixed to the top driven by animation-timeline: scroll(root).
- A normal content section after the hero.Want to tighten it up first? Run this prompt through the AI Prompt Studio to score it across 8 quality dimensions, catch anti-patterns, and tune the wording for Claude, ChatGPT, or Gemini before you paste it in.