Scale In
Five centred 260 px blocks in a 280 px scrolling frame: each starts at 70% of its size, invisible, and swells to full size while its first half crosses the bottom edge — 43 px of scrolling for an 87 px block. animation-timeline: view(), range entry 0% → entry 50%, no JavaScript.
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



How it works
The HTML is three levels under the .fx-0536-root root: the .sdc-scroll-container area (280 px tall, overflow-y: auto), the .sb-scalein-content tray (centred flex column, 24 px between blocks, 60 px of padding top and bottom) and five 260 px .sb-scalein-box blocks holding a heading and one line. A “Scroll ↓” hint sits over the bottom of the frame. All the motion lives in one rule: opacity: 0; transform: scale(.7) as the starting state, the fx0536ScaleIn keyframe that brings it back to opacity: 1; scale(1), and animation-timeline: view(), which swaps the clock for the block's position inside the area.
The animation-range: entry entry 50% range sets how long the swelling lasts. entry begins when the block's top edge meets the bottom edge of the area and ends once the whole block is inside; stopping at 50% means the block is full-size and opaque while half of it still sticks out. Measured on the demo: on load blocks 1 and 2 are in place and the 3rd waits just below the frame; after 40 px of scrolling it sits at 87% opacity and scale .96, and at 44 px it is done. The block grows from its centre (default transform-origin) and never pushes its neighbours, since transform leaves layout alone.
Nothing is played once and for all: progress is a function of position. Scrolling back up shrinks the block as it leaves through the bottom, scrolling down swells it again, and a block that left through the top stays full (animation-fill-mode: both). The rule is wrapped in @supports (animation-timeline: view()): a browser that does not know the property never receives the starting state and shows five ordinary blocks. Every selector is written under the root and the @keyframes carry the effect's number, so two copies on one page each scroll on their own (measured: the 2nd at 371 px, the 1st still at 0).
Accessibility
- Reduced motion: under
prefers-reduced-motion: reducethe block no longer changes size. The code swaps the keyframe forfx0536Fadeand setstransform: none, leaving a scroll-linked fade (measured: block 4 at 16% opacity, no transform, at 120 px). The hint stops pulsing and keyboard scrolling is no longer smoothed. - Keyboard: the area carries
tabindex="0",role="region"and anaria-label. Tab stops on it in Chromium, Firefox and WebKit, with a 2 px violet outline; the arrow keys then scroll it (4 presses: 160 px in Chromium, 204 px in Firefox). Without thattabindex, WebKit skipped the area. Rewrite thearia-labelto match your content. - Touch: nothing special to plan for, this is native scrolling. A 150 px finger drag scrolls the area by the same amount (measured with Chromium touch emulation, 390 px wide) and the blocks swell under the finger. At either end the gesture is handed to the page, which is how a nested scroller normally behaves.
- Reading: a block at
opacity: 0stays in the accessibility tree, so a screen reader reads all five blocks without waiting for the scroll. The headings areh4: match their level to your page. The secondary text (white at 50% over the block background) sits at roughly 5.3:1; the hint, hidden from screen readers, swings between 50% and 85% opacity and stays readable at its low point.
Browser compatibility
CSS only. The swelling needs animation-timeline: view() and animation-range: Chrome and Edge 115, Safari 26, Firefox 159 according to MDN data. Measured here in Chromium 149 and WebKit 26.5 (same values to the pixel: block 4 at .16 opacity and .75 scale at 120 px). In Firefox 151, @supports answers no: the five blocks are shown at full size with no animation and the area scrolls normally. Firefox 159 and later were not tried.
The fallback is already in the code: without animation-timeline, the rule under @supports is dropped as a whole, so neither the .7 scale nor the zero opacity applies. No block can stay hidden. Nothing to add, unless you insist on an animation in old browsers — that would take an IntersectionObserver, which this code does not include.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0536-root">
<div class="sdc-scroll-container" tabindex="0" role="region" aria-label="…">
<div class="sb-scalein-content">
<div class="sb-scalein-box">
<h4>…</h4>
<p>…</p>
</div>
… ×5
</div>
</div>
<span class="sdc-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 / property | Default | Effect |
|---|---|---|
Starting size (CSS — transform: scale(.7) under @supports) |
.7 | .9 gives a barely noticeable swell, for a dense list; .4 makes the block burst in. The keyframe always ends at scale(1): change the starting state only. |
Range (CSS — animation-range: entry entry 50%) |
entry 0% → entry 50% (43 px for an 87 px block) | The length depends on the block's height: 117 px for a 234 px card. entry 0% entry 100% only finishes once the block is fully in; beyond that (cover) you get the behaviour of View Timeline Scale. |
Anchor point (CSS — to add: transform-origin) |
centre of the block | transform-origin: 50% 100% grows the block from its bottom edge, 0 50% from the left. Handy when blocks are aligned to an edge rather than centred. |
Axis (CSS — animation-timeline: view()) |
vertical | view(inline) follows horizontal scrolling (a row of chips, a carousel): also switch the area to overflow-x: auto and the tray to a row. view(block 40px) pulls the edges in by 40 px: the swell only starts once the block has risen 40 px into the area. |
Scrolling area (CSS — .sdc-scroll-container { height: 280px }) |
280 px, tray as tall as its content | Remove height and overflow-y: view() then latches onto the page scroll. Keep at least one block below the bottom edge, otherwise nothing has a reason to swell. |
Block width (CSS — .sb-scalein-box { width: 260px }) |
260 px, centred | width: auto with align-items: stretch on the tray for full-width blocks; or a grid on the tray, each cell swelling on its own account. |
Hint (HTML — span.sdc-scroll-hint) |
“Scroll ↓”, 2 s pulse | It is a demo marker laid over the bottom of the frame: delete the span in production, or translate it. |
FAQ
entry entry 50% range does: the swell takes up the first half of the entry. The benefit is practical — the block's heading is readable at its size before the block is fully in, and a block stopped across the bottom edge does not look broken. If you would rather have it finish exactly when it is in, write animation-range: entry.:nth-child(3n+2) { animation-range: entry 10% entry 60% } — animation-delay does not count in pixels on a scroll timeline.