ScrollPremium

Scroll-Driven Fade

The block rises 60 px while fading in for the whole of its entry into the frame, no more, no less: it reaches its place at the exact moment it is fully in. 87 px of scrolling for an 87 px block, animation-range: entry on animation-timeline: view(), not one line of JavaScript.

CSSViewFade

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

Agenda of a residents' general meeting — online notice — Scroll-Driven Fade example 1

① Agenda of a residents' general meeting — online notice

WhenOnline notice from a managing agent: on the left the date, the venue and the postal vote button; on the right the agenda, nine numbered resolutions with their majority rule and amount, which the co-owner reads while scrolling.
WhyEach resolution finishes rising at the moment it is entirely visible: you read a complete line, never one that is still moving. Long resolutions (two-line titles) take a little longer of their own accord, with no per-block setting.
SettingsThe code's animation unchanged (60 px, range entry). A 370 × 314 px area beside a 170 px panel, nine cards 338 px wide and 59 to 76 px tall, 10 px apart: a rise over 59 to 76 px depending on the card. Capture: scrolling at 50 px/s by a timer in the scene, in place of the wheel.
Next offers after “Show more” — a seasonal jobs site in a ski resort — Scroll-Driven Fade example 2

② Next offers after “Show more” — a seasonal jobs site in a ski resort

WhenJob listing for a resort's winter season: four offers in a two-column grid, and under the list a “Show 4 more offers” button that adds four and scrolls down to them.
WhyThe new offers do not just appear under the finger: they rise and fade in while the list moves down, which shows where they are and that they have just arrived. The rise lasts the whole entry of the cards, roughly the trip triggered by the button.
SettingsThe code's animation unchanged. A 540 × 250 px area, two-column grid, 248 × 108 px cards: a rise over 108 px. The button is wired by the scene: it removes the hidden attribute from the next four offers, then moves the area down in 1.1 s. In the capture a timer clicks in place of the visitor every 1.9 s and starts over after two batches.
Latest updates — a local news site column that scrolls by itself — Scroll-Driven Fade example 3

③ Latest updates — a local news site column that scrolls by itself

WhenArticle page of a local news site: the article on the left, and on the right a narrow “Live updates” column where the day's timestamped items scroll by themselves while you read.
WhyIn a 181 px column that is always moving, headlines popping in at the edge would catch the eye of whoever is reading the article. Here each item slips in, rising gently, and only becomes crisp once it is whole: the column is alive without demanding attention.
SettingsThe code's animation unchanged. A 181 × 320 px column with no scrollbar, ten items 157 px wide and 69 to 84 px tall, separated by a rule: a rise over 69 to 84 px. The automatic scrolling (32 px/s) is a timer in the scene; the effect does not move the column forward.

How it works

A 280 px scrolling area, a centred column tray (.sb-sdfade-content) and five 260 px blocks (.sb-sdfade-box). Each block starts at opacity: 0 and translateY(60px); the fx0545FadeUp keyframe brings it back to its place, opaque. Progress is plugged into animation-timeline: view() with the range animation-range: entry, no percentage: from the moment the top of the block crosses the bottom of the area to the moment its bottom edge crosses it in turn.

The motion therefore lasts exactly the block's height. An 87 px block takes 87 px of scrolling to settle, a 108 px card takes 108: tall blocks rise for long, short ones quickly, with no tuning. Since the block makes up 60 px of lag during that trip, it moves on screen about 1.7 times faster than the rest of the list, then falls in line. Recorded on the demo, block 3: 11% opacity and 53 px behind after 40 px of scrolling, 57% and 26 px after 80 px, in place at 120 px.

A less obvious consequence: you almost never see a very pale block. Below 41% opacity, its offset still keeps it under the bottom edge; it emerges already half visible and finishes brightening as it reaches its place. When the demo opens, block 2 is at 94% and 4 px from its position, block 3 is hidden. The tray takes the height of its content (399 px of travel) and the animated rule sits under @supports, so nothing is hidden from browsers that do not follow.

Accessibility

  • Reduced motion: no more rising. The prefers-reduced-motion: reduce query cancels the translation (transform: none) and swaps the animation for fx0545Fade, which only touches opacity: the block brightens in place as it enters. Without the offset it is then visible from the edge, very pale at first — recorded: block 2 at 94%, block 3 at 0% just below the frame.
  • Keyboard: the area is a tab stop (tabindex="0") with a visible outline; once on it, the arrow keys scroll and the blocks rise. Three engines tried, three identical behaviours, whereas WebKit passed the area by in the original code. A screen reader announces it as a region carrying the supplied aria-label.
  • Content added later: if a script inserts blocks into the area (a “Show more” button), those that already land inside the frame appear straight in their current state, without playing the rise. Also tell screen readers about the addition (aria-live on a message, or moving focus): the sold code does not handle that.
  • Touch and legibility: native finger scrolling, recorded with touch emulation. The white heading is strongly contrasted over the block background; the grey line (white at 50%) sits around 5.3:1 once the block has settled. The bottom hint, hidden from screen readers, stays readable at its minimum (50% opacity).

Browser compatibility

Pure CSS. The rise depends on two recent properties, animation-timeline and animation-range: Chrome 115, Edge 115, Safari 26; Firefox 159 according to MDN. Chromium 149 and WebKit 26.5 give the same figures (block 4 at 68% and 19 px behind after 200 px). In Firefox 151 the @supports test fails: five visible, still blocks, scrollable area. The Firefox versions that announce support were not available for the test.

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✓ Visible, static blocks (measured in Firefox 151)
iOS 26+ / Android Chrome 115+✓ Not verified on a device

Nothing to plan. The zero opacity and the 60 px offset are declared inside @supports (animation-timeline: view()); a browser that fails that test keeps the blocks opaque, in their place. The page stays readable and complete, only without the rise.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0545-root">
  <div class="sdc-scroll-container" tabindex="0" role="region" aria-label="…">
    <div class="sb-sdfade-content">
      <div class="sb-sdfade-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 / propertyDefaultEffect
Height of the rise (CSS — transform: translateY(60px)) 60 px With 20 px the block shows earlier (from 19% opacity for an 87 px block) and the motion becomes a mere shiver; with 120 px it only emerges at 58% and catches up with the list almost 2.4 times faster.
Range (CSS — animation-range: entry) the whole entry (0 → 100%) entry 0% entry 50% gives the short version of Fade Up, done at mid-entry. entry 20% entry 100% delays the start without changing the finish.
Block width (CSS — .sb-sdfade-box { width: 260px }) 260 px, centred width: auto and align-items: stretch on the tray for a full-width list; a grid on the tray makes each row rise as one.
Scrolling area (CSS — .sdc-scroll-container { height: 280px }) 280 px Remove height and overflow-y to follow the page scroll: each block finishes rising when its bottom edge passes the bottom of the screen.
Curve (CSS — animation-timing-function: linear) linear ease-out makes the block emerge earlier and settles it softly; ease-in keeps it under the edge almost to the end, then makes it spring out.
Dressing (CSS — .sb-sdfade-box) white background at 4%, border at 8%, 14 px corners, centred text All of it can be replaced: light background, left alignment, a dividing rule instead of a card. The animation depends on none of these values.

FAQ

The range, hence the duration. Fade Up completes the same 60 px rise over the first half of the entry (43 px): the block is in place while half of it still sticks out. Here it lasts the whole entry (87 px) and ends exactly when the block is whole. The blocks are also centred at 260 px instead of filling the width. It is the same effect with another setting: if you own one, changing animation-range gives you the other.
Because it has 60 px of lag to make up while it enters. Over 87 px of scrolling it covers 87 + 60 = 147 px on screen, 1.7 times the speed of the list. The taller the block, the closer that ratio gets to 1: a 250 px card only goes 1.24 times faster. For a calmer motion, reduce the offset rather than the range.
Only if they enter by scrolling. A block's state depends on its position: inserted in the visible part, it shows straight at the matching opacity, with no motion. So insert the new blocks below the bottom edge, then scroll the area down to them — that is what the job offers scene does, with a few lines of script that are not part of the sold code.