Progress Reveal Text
A 40 px word pinned to the top of its area fills with violet from left to right, through its letters, in step with scrolling: 0% at the top, 100% at the bottom (409 px of travel in the demo). One registered CSS property, --sb-progress, driven by animation-timeline: scroll(); a script of about fifteen lines takes over where the timeline is missing.
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 word .sb-progress-text is transparent (-webkit-text-fill-color: transparent) and its background, cut to the shape of the letters by background-clip: text, is a gradient with two colours placed at the same spot: linear-gradient(90deg, #8b5cf6 var(--sb-progress), rgba(255,255,255,.15) var(--sb-progress)). Two stops on top of each other give a hard edge; that edge sits at --sb-progress of the word's width. The whole effect is about moving that percentage.
A percentage stored in a plain variable does not animate: the browser treats it as text and jumps from the first value to the last. The rule @property --sb-progress { syntax: '<percentage>'; inherits: false; initial-value: 0% } declares its type, so the fx0539ProgressFill animation (0% to 100%, linear, both) can interpolate it. animation-timeline: scroll() swaps the clock for the position of the nearest scrolling area, here .sdc-scroll-container (280 px tall; its 689 px of content set the travel at 409 px). Read in the demo: edge at 14.7% after 60 px scrolled, 34.2% at 140, 63.6% at 260, 100% at 409. Scrolling back up empties the word at the same pace.
The word is position: sticky; top: 16px: it stays in view while the subtitle and the four blocks pass underneath. Outside the animation, the base rule sets --sb-progress: 100%, so the word shows full whenever nothing drives it — an area too short to scroll (measured), a browser with neither the timeline nor the script. The supplied script only runs when CSS.supports('animation-timeline', 'scroll()') says no: it pauses the same animation and sets its currentTime on every scroll event, root by root. On Firefox 151 it yields the same percentages as the CSS path, to the hundredth.
Accessibility
- Reading: the word is real text in a
div, read as is whatever its fill. The fill itself is announced to nobody — norole="progressbar", no value. If it carries information (“you are halfway”), state it in plain text elsewhere. - Contrast: the unfilled part is white at 15% on
#0a0a0f, that is 1.5:1 — at the top of the travel the word is guessed more than read. The filled part (#8b5cf6) reaches 4.7:1, enough for text this size. If the word must be readable on arrival, raise the gradient's base colour to about 45% white (4.5:1). The subtitle at 40% white sits at 3.8:1 for 12.5 px. - Keyboard: the scrolling area carries
tabindex="0",role="region"and anaria-labelto adapt: Tab stops on it in Chromium 149, Firefox 151 and WebKit 26.5, which skipped it before the attribute was added. The arrows then scroll it (down arrow: 40 px in Chromium, 51 px in Firefox; End: bottom of travel). On focus, the area gets a 2 px violet outline (#a78bfa) drawn inside it, from a:focus-visiblerule you can recolour to your brand. - Reduced motion: a
prefers-reduced-motionrule stops the “Scroll ↓” hint from blinking (it rests at 75% opacity) and turns off the area's smooth scrolling. The fill itself stays: it only moves under the reader's finger or wheel, never on its own (measured under emulation: 34.2% at 140 px, as without the rule). To freeze it anyway, addanimation: none !importanton.sb-progress-textinside that block: the word then shows full (the!importantis for the fallback script, which writes an inline style).
Browser compatibility
Three building blocks: animation-timeline: scroll() (Chrome and Edge 115, Safari 26, Firefox 159 according to the MDN tables), @property (Chrome 85, Safari 16.4, Firefox 128) and background-clip: text, also written with the -webkit- prefix. Checked here: Chromium 149 and WebKit 26.5 in pure CSS, Firefox 151 through the script — same values in all three. Firefox 159 and later were not opened.
Without the timeline: the script replays the fill (it needs @property). With neither timeline nor script: the word is fully violet and still (measured, Firefox 151 without JavaScript). Without @property (Firefox before 128, Safari before 16.4): the percentage does not interpolate, the word would switch from empty to full in one go — not verified.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0539-root">
<div class="sdc-scroll-container" tabindex="0" role="region" aria-label="…">
<div class="sb-progress-content">
<div class="sb-progress-text">…</div>
<div class="sb-progress-sub">…</div>
<div class="sb-progress-blocks">
<div class="sb-progress-block"></div>
… ×4
</div>
</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 |
|---|---|---|
Colours (CSS — the two stops of the linear-gradient on .sb-progress-text) |
#8b5cf6 filled, white at 15% empty |
Change both colours and keep var(--sb-progress) on each. A 15% base leaves the word almost invisible at the start; at 45% it reads before being filled. |
| Edge (CSS — position of the second stop) | hard (two stops at the same percentage) | calc(var(--sb-progress) + 12%) on the second stop blends the boundary over 12% of the word (tried: the edge becomes a soft gradient). |
| Direction (CSS — gradient angle) | 90deg, left to right |
0deg fills from bottom to top, like a rising level (tried); 270deg starts from the right. On text spanning several lines, all lines advance together: the gradient covers the box, not each line. |
Driving area (CSS — height and overflow-y on .sdc-scroll-container) |
the 280 px box | Remove these two declarations: scroll() climbs up to the page and the word follows the window's scrolling (tried: 50% at mid-page). Keep it sticky then, or make it position: fixed. |
Pinning (CSS — position: sticky; top: 16px) |
pinned 16 px from the top of the area | Without sticky the word leaves with the content and exits the frame after about a hundred pixels. Inside a sticky band of your own, set it back to position: static. |
Travel length (CSS — content of .sb-progress-content) |
689 px of content, 409 px of travel | The tray no longer has a fixed height: it follows whatever you put in it. Add blocks, or some bottom padding (padding-bottom), to stretch the fill. If everything fits in the area, there is no travel left and the word shows full. |
Hint (HTML — span.sdc-scroll-hint) |
“Scroll ↓”, white, blinking between 50% and 85% opacity (5.3:1 at its faintest) | A plain span placed at the bottom of the frame: delete it in a real page, its CSS rule then has nothing to style. |
FAQ
--sb-progress: 100%. Two usual causes: the content fits in the area (no travel, so no active timeline), or the word is not inside an element that scrolls. Give the parent a fixed height and overflow-y: auto, or let the page scroll..fx-0539-root follows its own area: with two copies, scrolling the second leaves the first untouched (measured, including with the fallback script, which attaches root by root). One precaution: @property registers --sb-progress for the whole document. If your stylesheet already uses that name with another type, rename it in the effect's CSS.