ScrollPremium

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.

CSSScaleView

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

Work packages of a bathroom renovation quote — a tradesman's client area — Scale on Scroll example 1

① Work packages of a bathroom renovation quote — a tradesman's client area

WhenA tradesman's client area: the quote is split into seven work packages (strip-out, plumbing, electrics, tiling…) in a scrolling column, next to a fixed block holding the total and the sign button.
WhyThe pictogram names the trade before you read the label, and the amount is aligned on the right. Each package swells in: it feels like going through the quote item by item, while the total, outside the area, does not move.
SettingsThe code's animation unchanged. A 352 × 316 px area, seven 324 × 68 px cards turned into a three-column grid (42 px tile, text, amount): the swell lasts 34 px. Light theme, teal tile. 277 px of travel, covered at 64 px/s in the capture by a timer in the scene; in real use it is the wheel.
Dress code before you come in — screen on the door of a school chemistry lab — Scale on Scroll example 2

② Dress code before you come in — screen on the door of a school chemistry lab

WhenA screen fixed to the door of a school lab: six dress rules (lab coat, goggles, hair tied back, closed shoes…) scroll by on their own while the class waits in the corridor.
WhyOn safety signage it is the pictogram you recognise from afar: here a 68 px blue disc ringed in white. The next rule rises small and pale and then takes its size: the eye is drawn to the bottom of the screen with no flashing and no jump.
SettingsA 540 × 302 px area, six 496 × 98 px cards in two columns (68 px disc, 21 px text): the swell runs over 49 px. The automatic scrolling at 58 px/s is a timer in the scene; it is part of the use case, nobody touches this screen.
On-board services — mobile guide of a night coach line — Scale on Scroll example 3

③ On-board services — mobile guide of a night coach line

WhenThe guide of a night line read on a phone before departure: ten services (Wi-Fi, USB socket, reclining seat, blanket, toilet…) as tiles, two per row.
WhyA pictogram tile is scanned faster than a list, and two neighbouring tiles swell together since they come in together: the grid fills in row by row under the finger, with no per-column setting.
SettingsThe tray turned into a two-column grid (10 px gap), a 254 × 270 px area, ten tiles 110 px wide and 107 to 125 px tall: the swell runs over 54 to 62 px depending on the row. 355 px of travel. In the capture the area moves at 52 px/s thanks to the scene's timer.

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: reduce the card no longer changes size; the keyframe becomes fx0558Fade and the rule sets transform: 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 svg carries aria-hidden="true" and focusable="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: 0 is still read by a screen reader. The heading is an h4 to 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.

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✓ Static cards at full size (measured in Firefox 151)
iOS 26+ / Android Chrome 115+✓ Not verified on a device (drag measured in emulation)

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):

index.html — structure
<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 / propertyDefaultEffect
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

In the animation, not at all: same start at 70% and zero opacity, same keyframe, same 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.
It straddles the bottom edge of the frame: 47 px of its 149 px are in, and it takes 74 to finish. So it sits at 63% opacity and 89% of its size. 28 px of scrolling are enough to complete it. To have it full from the start, reduce the tray's top padding (60 px) or give the area 310 px.
There is nothing to load: the drawing is written in the HTML, with no file and no icon font, and the code makes no request. A pictogram can only go missing if you swap it for an external 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.