ScrollPremium

Zoom Into Content

A whole group — heading, sentence, button — coming in from the back of the screen: starting at 30% of its size, transparent and blurred by 8 px, it is sharp and full-size when its centre reaches the middle of a 280 px frame. Blocks are separated by 200 px of empty space, so only one fills the frame at a time. view(), range entry → cover 50%, CSS only.

CSSview()Zoom

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Scroll has 74 effects, including 12 free. Explore the category →

3 usage examples

Three outings aboard a traditional sailing boat — home page of a maritime heritage association — Zoom Into Content example 1

① Three outings aboard a traditional sailing boat — home page of a maritime heritage association

WhenHome page of an association that sails an old rigged boat: three outings (the half-day, the sunset, the day to the islands), each with its title, one sentence and its booking button.
WhyEach outing takes the screen in turn and arrives like a boat drawing near: first a blurred smudge at the bottom of the frame, then the sharp title in the centre. The original block (title, sentence, button) is used as is, with one extra marker line. Only one call to action is readable at a time.
SettingsA 540 × 316 px area, three 540 × 192 px .zoom-content blocks, 62 px spacers at both ends and 110 px between blocks: each zoom lasts 254 px of scrolling. A 33 px title, its gradient recoloured white and pale blue. 604 px of travel, covered at 165 px/s in the capture by a timer in the scene.
Word of the day, revealed with one click — an app for learning Breton — Zoom Into Content example 2

② Word of the day, revealed with one click — an app for learning Breton

WhenA vocabulary app: a riddle shows in a card, with a “Reveal the word” button below it. On click, the Breton word of the day replaces the riddle, with its translation and an example.
WhyThe answer does not pop up at once: the riddle leaves through the top and the word comes in from the back, blurred then sharp, which leaves a brief moment to think “I knew it”. The button merely sends the area to the end of its travel; the zoom finishes exactly there, the word centred in the card.
SettingsA 298 × 214 px area with no visible scrollbar. The riddle is an ordinary 214 px block, not animated; 70 px below, a single 298 × 170 px .zoom-content block (52 px title), then 22 px. 262 px of travel, the zoom over the last 192. The 2.5 s trip is animated by the scene's script (slower than the browser's smooth scrolling, so the zoom can be seen); in the capture a timer clicks the button every 7 s.
Track records, one at a time — sidebar box on a velodrome's page — Zoom Into Content example 3

③ Track records, one at a time — sidebar box on a velodrome's page

WhenA velodrome's page: the programme of a meeting fills the main column; on the right, a dark 170 px box cycles through the track records.
WhyIn a narrow box one figure at a time is enough: the time grows from the back, stops sharp in the centre, then makes way for the next. The zoom gives depth to a small component without disturbing the reading of the programme beside it, since nothing moves outside the box.
SettingsA 170 × 244 px area, four 170 × 160 px blocks (event, time at 32 px, name and date), 42 px spacers at both ends and 40 px between blocks: the zoom runs over 202 px. Title gradient in yellow and orange. 600 px of travel; the automatic scrolling at 108 px/s is a timer in the scene, and it is part of the use case.

How it works

The .zoom-container area (280 px, vertical scrolling) lines up blocks and gaps: a 30 px spacer, the .zoom-content block (a gradient title, a sentence, a link button, 130 px in all), a 200 px spacer, the .zoom-second block (one paragraph, 81 px), a last 200 px spacer. It is not each line that is animated but the block as a whole: title, sentence and button grow together, from the centre of the block.

Under @supports (animation-timeline: view()), both blocks start at transform: scale(.3); opacity: 0; filter: blur(8px) and the fx0570Zoom keyframe brings the three values back to normal. The animation-range: entry cover 50% range begins when the top of the block meets the bottom of the frame and ends when its centre passes the middle. For the second block that is 180 px: read at 81 px of scrolling for the start, 261 px for the end, with 22% opacity, 46% size and 6.2 px of blur at 120 px on the way, then 67%, 77% and 2.7 px at 200 px.

The first block, for its part, does not zoom in the demo: placed 30 px below the top of the frame, its centre is already above the middle on load, so it is sharp from the outset. The zoom is for what comes in from below. A block leaving through the bottom when you scroll back up replays the path in reverse; a block that left through the top stays sharp. The travel follows the content (361 px) and two copies on a page scroll separately, since selectors and keyframe belong to this root.

Accessibility

  • Reduced motion: a zoom from 30% to 100% with blur is among the motions to avoid. Under prefers-reduced-motion: reduce the rule sets transform: none; filter: none and swaps the keyframe for fx0570Fade: measured at 120 px of scrolling, second block at 22% opacity, no scale and no blur. What is left is a fade in place.
  • Legibility along the way: until the block reaches the middle of the frame, its text is small and blurred. Do not put inside an animated block something that must be read at first glance the moment it shows, and avoid a block taller than the frame (see the FAQ): its first lines would reach the top of the screen still blurred.
  • Keyboard: the area takes focus (tabindex="0", role="region", aria-label, 2 px violet outline) in all three engines; four down-arrow presses move it 160 px in Chromium, 204 px in Firefox. The block's button is a real link (<a href>) with its white focus outline: replace its href="#".
  • Reading and contrast: a transparent or shrunk block is read normally by a screen reader. The title is a div to turn into a heading of your level. The title gradient runs from 4.4:1 to 5.7:1 on the background (enough for text of that size), the sentence sits at 7.3:1, the button's white text between 4.2:1 and 4.5:1.
  • Touch: native scrolling, 151 px of travel for a 150 px drag in Chromium emulation at 390 px wide, where the block spans the full width of the frame.

Browser compatibility

CSS only. The zoom needs animation-timeline: view() and animation-range: Chrome and Edge 115, Safari 26, Firefox 159 per MDN. Same readings in Chromium 149 and WebKit 26.5 (second block at .22 opacity, .46 size and 6.2 px of blur at 120 px in both). Firefox 151: both blocks are sharp and full-size, the area scrolls over 355 px. The gradient title is written with -webkit-background-clip: text, understood by all these engines; the background: … text shorthand of the original code has only been read by Chrome since version 120.

Chrome 115+✓ Full (measured in Chromium 149)
Edge 115+✓ Not verified (same engine as Chrome)
Safari 26+✓ Full in the WebKit 26.5 test build; real Safari not verified
Firefox 159+✓ Not verified (support announced by MDN)
Firefox up to 158✓ Sharp blocks, no zoom (measured in Firefox 151)
iOS 26+ / Android Chrome 115+✓ Not verified on a device (drag measured in emulation)

The three starting values (scale, opacity, blur) only exist under @supports: a browser without view() shows ordinary blocks, separated by their spacers. The content is therefore always readable; it simply does not arrive “from the back”.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0570-root">
  <div class="zoom-container" tabindex="0" role="region" aria-label="…">
    <div class="zoom-spacer-start"></div>
    <div class="zoom-content">
      <div class="zoom-hero-title">…</div>
      <div class="zoom-hero-subtitle">…</div>
      <a class="zoom-hero-btn" href="#">…</a>
    </div>
    <div class="zoom-spacer-end"></div>
    <div class="zoom-second">
      <p>…</p>
    </div>
    <div class="zoom-spacer-end"></div>
  </div>
  <span class="slr-scroll-hint" aria-hidden="true">…</span>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Starting size (CSS — scale(.3), under @supports and in fx0570Zoom) .3 Write the same value in both places. .6 gives a quieter approach; below .2 the block is a mere dot during the first third of the path.
Blur (CSS — filter: blur(8px), same two places) 8 px blur(0) keeps a sharp zoom, lighter to compute on a large block. Beyond 12 px the text stays unreadable for a good half of the range.
Range (CSS — animation-range: entry cover 50%) from the bottom edge to the middle of the frame: 180 px for an 81 px block The length is (frame height + block height) ÷ 2. entry cover 30% finishes lower in the frame; entry alone finishes as soon as the block is in.
Spacers (CSS — .zoom-spacer-start { height: 30px }, .zoom-spacer-end { height: 200px }) 30 px before, 200 px between blocks and after 200 px isolate each block in a 280 px frame. Tried with 200 px before the first block: it opens mid-zoom (39% opacity, 57% size, 4.9 px of blur) and completes in 125 px.
Animated blocks (HTML — the .zoom-content class) two blocks: .zoom-content and .zoom-second Put .zoom-content on as many blocks as you like, each tracks its own position. The title, sentence and button are optional: any content can be zoomed.
Area (CSS — .zoom-container { height: 280px }) 280 px Keep a height in pixels or give the parent a fixed height: as a percentage inside a parent with no height, nothing scrolls. Without height or overflow, view() follows the page's scrolling.
Hint (HTML — span.slr-scroll-hint) “Scroll to zoom” A demo marker that bounces by 4 px at the bottom of the root. Remove it in production.

FAQ

The range is the same (entry cover 50%), and so is the focusing. What changes: Blur to Clear only touches blur (10 px) and opacity, with no size change at all, on a list of closely packed blocks. Zoom Into Content adds a zoom from 30%, trims the blur to 8 px and applies it to a complete group — title, sentence, button — isolated by 200 px of empty space. The former suits a list that must not deform; this one a few strong messages shown one by one. View Timeline Scale is the third setting of the family: a 70% scale, no blur.
Because it has already arrived. The range ends when the block's centre passes the middle of the frame (140 px); yet the first block opens 30 px from the top, its centre at 95 px. So it is past the end of its animation as soon as the page loads. To see it zoom, start it lower: with a 200 px starting spacer it opens at 39% opacity and completes its zoom within 125 px of scrolling.
It turns sharp too late. The range waits for its centre to reach the middle of the frame: for a 400 px block in a 280 px frame, that takes 340 px of path. Measured: when its top reaches the top of the frame it is still at about 85% opacity, 90% size and 1.2 px of blur, and it only settles 60 px further on. Split long content into several blocks, or shorten the range (entry cover 30%).