Scale on Scroll
Three pictogram cards — a 48 px violet tile, a line-drawn SVG, a heading, one line — that grow from 70% to 100% as they come in through the bottom of a 280 px frame. A 149 px card, the swell wrapped up in 74 px of scrolling. Same view() animation as Scale In; what is added here is the card template. CSS only.
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
What this effect brings of its own is a complete card. Each .sdc-scale-card (260 px wide, 24 px of padding, 16 px corners) stacks a 48 px .sdc-scale-icon tile with a translucent violet fill, a 24 px svg drawn with a 1.5 px stroke in #8b5cf6, an h4 and a paragraph. The three cards are centred in the .sdc-scale-content tray, 24 px apart with 60 px of padding above and below, inside the 280 px .sdc-scroll-container area.
The animation is one rule under @supports (animation-timeline: view()): start at transform: scale(.7); opacity: 0, the fx0558ScaleUp keyframe bringing both back to 1, range animation-range: entry entry 50%. The whole card is transformed, so the pictogram grows with it (from 17 to 24 px on screen). The range is counted in card heights: for 149 px, the swell takes 74 px. Read pixel by pixel: the third card starts to show at 127 px of scrolling and reaches its size at 201 px.
On load the first card is full, the second is cut by the bottom edge at 63% opacity and 89% of its size, the third waits below. Scrolling back up shrinks a card leaving through the bottom; a card that went past the top of the frame stays full (animation-fill-mode: both). The tray takes the height of its content: the travel stops at 335 px, the last card whole and 71 px from the top. Selectors are written under the root and the keyframe carries the effect's number: with two copies on a page, the second scrolled to 335 px without the first leaving 0.
Accessibility
- Reduced motion: under
prefers-reduced-motion: reducethe card no longer changes size; the keyframe becomesfx0558Fadeand the rule setstransform: none. Measured at rest in that mode: second card at 63% opacity with no transform at all. What remains is a fade that follows the scroll. The hint at the bottom stops pulsing. - Pictograms: every
svgcarriesaria-hidden="true"andfocusable="false", because it repeats the card's heading. If a pictogram is the only thing carrying the meaning, drop those attributes and give it a<title>. The violet stroke on its tile sits at 3.7:1, above the 3:1 asked of a drawing. - Keyboard: Tab stops on the area (
tabindex="0",role="region",aria-label) in Chromium, Firefox and WebKit, with a 2 px violet outline. Four down-arrow presses: 160 px in Chromium, 204 px in Firefox, enough to bring the third card in. - Reading: all three cards are in the page from the start, and a card at
opacity: 0is still read by a screen reader. The heading is anh4to realign with your page's hierarchy; the grey line sits at 5.3:1 on the card background. - Touch: a 150 px drag moved the area by 149 px in Chromium touch emulation at 390 px wide. The 260 px card fits that width with a 65 px margin on each side.
Browser compatibility
CSS only, inline SVG. The swell depends on animation-timeline: view() and animation-range: Chrome and Edge 115, Safari 26, Firefox 159 per MDN. Chromium 149 and WebKit 26.5 give the same values (second card at .63 and .89 at rest, third at .56 and .87 at 168 px). Firefox 151 skips the @supports block: three cards at full size, pictograms included, with no animation.
Nothing to write: the .7 scale and the zero opacity are only declared inside @supports. A browser that does not know view() receives neither and shows the cards as they are. The card template itself needs nothing beyond flexbox and SVG.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0558-root">
<div class="sdc-scroll-container" tabindex="0" role="region" aria-label="…">
<div class="sdc-scale-content">
<div class="sdc-scale-card">
<div class="sdc-scale-icon">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">…</svg>
</div>
<h4>…</h4>
<p>…</p>
</div>
… ×3
</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 |
|---|---|---|
Pictogram (HTML — svg inside .sdc-scale-icon) |
viewBox 0 0 24 24, line drawing | Replace the path elements with your drawing, on the same 24 grid. The CSS forces fill: none and a 1.5 stroke: a solid pictogram needs fill: currentColor; stroke: none on the svg. |
Tile (CSS — .sdc-scale-icon and .sdc-scale-icon svg { stroke }) |
48 px, fill rgba(139, 92, 246, .15), stroke #8b5cf6 | Change both colours together to keep the stroke readable on its fill. border-radius: 50% gives a disc; 68 px with a 36 px svg suits a screen read from a distance. |
Starting size (CSS — transform: scale(.7) under @supports) |
.7 | Closer to 1 the swell is barely noticeable; around .4 the card bursts in and its pictogram starts at 10 px. The end state stays scale(1). |
Range (CSS — animation-range: entry entry 50%) |
first half of the entry: 74 px for a 149 px card | The length follows the card's height: 34 px for a 68 px row, 49 px for 98 px. entry alone waits until the whole card is in. |
Animate the pictogram only (CSS — move the rule onto .sdc-scale-icon) |
the whole card is animated | Tried: card static, the rule carried by the tile with animation-range: entry. The tile of the third card shows at 152 px and is done at 199 px, the text no longer moves. |
Card layout (CSS — .sdc-scale-card) |
260 px, content centred in a column | display: grid; grid-template-columns: 42px 1fr auto lays the card out as a row (pictogram, text, value). A grid on the tray gives tiles side by side. |
Hint (HTML — span.sdc-scroll-hint) |
“Scroll ↓” | Demo text, hidden from screen readers. Remove the tag once the area sits in a real page. |
FAQ
entry entry 50% range, same 260 px width. The difference is in the HTML you get. Scale In ships five 87 px text blocks; Scale on Scroll ships three 149 px pictogram cards, with the tile, the SVG and their styles. Since the range is counted in card heights, the swell lasts 74 px here against 43 px there. If you already own Scale In you have the animation; this one saves you the card template.img; in that case give it a fixed width and height, so the card keeps its 149 px and the range does not shift while it loads.