Sticky Reveal Stack
Five 90 px cards that rise and fade in, then stay pinned each 10 px lower than the one before: the stack builds at 50, 60, 70, 80 and 90 px from the top of a 280 px frame, in 394 px of scrolling out of a 450 px travel. position: sticky for the stacking, view() for the entrance, two spacers to set the travel. Zero 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 .stack-container area (280 px tall, 20 px of padding) holds, in order, a 40 px spacer, five 90 px .stack-card elements 16 px apart, then a 120 px spacer. Each card is position: sticky with a top that grows by 10 px from one card to the next (30, 40, 50, 60, 70 px, set by :nth-child(2) to (6), the first child being the spacer). The area's padding adds to it: the cards come to rest at 50, 60, 70, 80 and 90 px from the top of the frame. The next one rises over it and leaves only 10 px of the previous card showing.
The entrance is a second, independent mechanism. Under @supports (animation-timeline: view()), the card starts at opacity: 0; transform: translateY(40px) scale(.92) and the fx0568Reveal keyframe brings it back into place over the entry entry 80% range, i.e. 72 px for a 90 px card. Read pixel by pixel: the fourth card shows up at 99 px of scrolling and is done at 170 px, the fifth runs from 205 to 276 px. On load two cards are in place and the third peeks at 11% opacity under the edge.
The travel comes from the content, not from a fixed height: 450 px here. The cards pin at 10, 106, 202, 298 and 394 px of scrolling; the remaining 56 px leave the finished stack on screen, from 50 to 180 px. It is the bottom spacer that lets the last card reach its notch. Scrolling back up undoes the stack in reverse order, and a card leaving through the bottom goes back through its fade. Two copies on one page each stack on their own: measured, the second at 450 px, the first still at 0.
Accessibility
- Reduced motion: under
prefers-reduced-motion: reducethe card no longer rises 40 px or grows; the rule setstransform: noneand thefx0568Fadekeyframe only touches opacity (fourth card at 31%, no transform, at 120 px of scrolling). The stacking stays, since it is layout tied to scrolling the person does themselves. The hint at the bottom stops bouncing. - Contrast to fix on your side: the white 14.4 px bold text sits on gradients that get lighter towards the right. It reaches 4.47:1 at the left edge of the first card (just under the 4.5:1 threshold), then drops to 3.0:1, 2.7:1 and as low as 2.5:1 on the light ends (
#818cf8,#a78bfa,#e879f9). Centred in the card, it lies mid-gradient. Darken the end colour or switch to dark text. - Keyboard: Tab stops on the area (
tabindex="0",role="region",aria-label), with a 2 px violet outline in all three engines. Four down-arrow presses: 160 px in Chromium, 204 px in Firefox, enough to pin the second card. - Reading: a covered card is not removed from the page. A screen reader reads all five in HTML order, whether they are visible, transparent or hidden under another. Their text is plain
divcontent: give it a heading level if each card opens a section. - Touch: native scrolling of the area, 150 px for a 150 px drag in Chromium emulation at 390 px. The cards are then 311 px wide (85% of the frame).
Browser compatibility
CSS only. The stacking relies on position: sticky and works everywhere; only the entrance fade needs animation-timeline: view() and animation-range (Chrome and Edge 115, Safari 26, Firefox 159 per MDN). Chromium 149 and WebKit 26.5: same positions and same opacities. Firefox 151: no fade, the cards are opaque from the start, but they pin at the same notches (50 to 90 px at the end of the travel).
The fallback is a stack without the fade: the zero opacity and the starting offset are only written under @supports, whereas position: sticky and the notches are in the base rules. A browser without view() therefore keeps most of the effect, and no card can stay invisible.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0568-root">
<div class="stack-container" tabindex="0" role="region" aria-label="…">
<div class="stack-spacer-top"></div>
<div class="stack-card">…</div>
… ×5
<div class="stack-spacer-bottom"></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 / property | Default | Effect |
|---|---|---|
Pinning notches (CSS — top of .stack-card:nth-child(2) to (6)) |
30, 40, 50, 60, 70 px (+ the area's 20 px padding) | The step between two values is the visible height of each covered card. Tried with a 34 px step: the first four settle at 50, 84, 118 and 152 px, but the fifth gets stuck at 154 px, the 280 px frame is too short — enlarge it at the same time. |
Bottom spacer (CSS — .stack-spacer-bottom { height: 120px }) |
120 px | It has to let the last card rise to its notch. Tried in a 400 px area: with 120 px it stops at 154 px instead of 90; with 220 px it pins. Count the area's height minus 180 px. |
| Number of cards (HTML + CSS) | 5 cards, 5 :nth-child rules |
A sixth card without its rule has neither fill nor notch: tried, it pins at 40 px, transparent, above the others. Add .stack-card:nth-child(7) { top: 80px; background: … }. |
Card size (CSS — .stack-card { height: 90px; width: 85% }) |
90 px tall, 85% wide | The entrance range follows the height: 165 px for a 206 px card. A card taller than the area minus its notch cannot stay pinned whole. |
Starting state (CSS — translateY(40px) scale(.92) under @supports and in fx0568Reveal) |
40 px lower, 92%, transparent | Change both places together. translateY(0) scale(1) keeps only the fade; beyond 80 px the card seems to arrive from far away. |
Entrance range (CSS — animation-range: entry entry 80%) |
80% of the entry, 72 px | entry entry 40%: the card is sharp almost at once. entry alone: it only finishes once fully in, hence closer to its notch. |
Hint (HTML — span.slr-scroll-hint) |
“Scroll to stack” | A demo marker that bounces by 4 px. Remove the tag in a page people already scroll. |
FAQ
entry entry 80% range) and the same position: sticky stacking in 10 px steps. Here the cards are 90 px at 85% width against 80 px at 90%, they pin between 50 and 90 px from the top against 10 to 50, and above all the travel is set by two spacers instead of a 1,000 px tray: it ends 56 px after the last card, where Card Stack leaves several hundred pixels of empty scrolling (720 px of travel according to its page). If you own one, you can get the other by changing four values.align-items: flex-start). But notches add up: with a 34 px step the fifth card should settle at 186 px and end at 276 px; measured, it stops at 154 px because the area's bottom padding and the card's margin leave it no room. Give the area 320 px then, or stack four cards.height: 100%, inside a root that only has a minimum height, the area pasted into a blank page would take the 730 px of its content: there would be nothing to scroll, and neither sticky nor view() would have any reason to act. If you turn it into a percentage, give its parent a fixed height.