ScrollPremium

Converging Parallax

Three blurred discs stacked at the centre of a tray glide at three paces — 160, 80 and 240 px over the travel — and meet exactly halfway: offset at the start, superimposed in the middle, offset the other way at the end. The second one also crosses from left to right. Three animations on scroll(), zero JavaScript.

CSSParallaxLayers

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

Red, green, blue: three spotlights coming together — training sheet for a lighting crew — Converging Parallax example 1

① Red, green, blue: three spotlights coming together — training sheet for a lighting crew

WhenA sheet from a theatre's volunteer training handbook: four paragraphs on colour mixing on the right, and on the left a black backdrop where three beams stay in view while you read.
WhyAdditive mixing is understood by watching it happen. The three discs, switched to opaque red, green and blue, first overlap two by two — yellow, cyan, magenta — then merge halfway through into one white disc, just as the text reaches “all three”. The rest of the sheet parts them on the other side.
SettingsDiscs brought down to 98 px, opaque, in a hard-edged gradient; mix-blend-mode: screen on the layers. The three layers sit in a pinned 264 × 318 px frame added by the scene (position: sticky, overflow: clip, black background): they stay on screen and only the code's offsets move them. A 540 × 318 px area, 462 px of travel. Capture: 96 px/s by a timer in the scene.
Focusing with a rangefinder — tutorial for a film camera, on a phone — Converging Parallax example 2

② Focusing with a rangefinder — tutorial for a film camera, on a phone

WhenA four-step tutorial read on a phone. At the top of the screen a viewfinder patch stays put: a lamp post, and its yellow double set to one side. The steps scroll beneath.
WhyOn a rangefinder you turn the ring until two images become one; go too far and they part again. That is the path of the middle disc: offset, merged at mid-scroll, offset the other way. The scrolling thumb plays the ring, and the “it is sharp” step comes on screen when the two globes coincide.
SettingsA single layer is used, the middle disc's, shrunk to 42 px and recoloured yellow. Its slanted path (30 px sideways for 40 px of height) is brought back to horizontal by rotating the layer 53.13°: the yellow globe goes from −50 to +50 px. The fixed globe is drawn by the scene; the patch (104 px tall) sits in a pinned strip. A 190 × 318 px area, 534 px of travel. Capture: 84 px/s, timer in the scene.
First names of this month's babies — screen in a maternity unit's lobby — Converging Parallax example 3

③ First names of this month's babies — screen in a maternity unit's lobby

WhenScreen in the reception lobby: under a fixed title, the first names of the children born during the month climb slowly, each with its date, in a loop.
WhyA list of first names on a flat pastel would look like an office notice. Three large peach, pink and lilac glows drift behind the names, gather into one soft patch in the middle of the list, then come apart: enough life for a screen watched while waiting, not enough to disturb the reading of the names, which stay in dark text.
SettingsDiscs enlarged to 360, 270 and 210 px, pastel gradients at 85% opacity. The layers sit in a pinned frame the size of the area (position: sticky; margin-bottom: -360px); the code's .sdc-parallax-text block serves as the title, pinned as well. A 540 × 360 px area, 491 px of travel. The automatic scrolling (66 px/s) comes from a timer in the scene: the effect follows scrolling, it does not create it.

How it works

The .sdc-parallax-content tray (800 px) holds three .sdc-parallax-layer layers, each on position: absolute; inset: 0 and centred with flexbox, hence three discs laid on the same point: 200, 140 and 100 px across, in violet, pink and cyan radial gradients. Each disc has its own animation on animation-timeline: scroll(), and all of them are symmetrical around zero: translateY from 80 to −80 px for the first, from 120 to −120 px for the third, and for the second 40 to −40 px with a translateX from −30 to 30 px. Above them, .sdc-parallax-text carries a heading and a sentence in the flow, on z-index: 5: that one is not animated.

Symmetrical values have a clear consequence: at 50% of the travel the three offsets are zero at the same time. Read in Chromium 149 and in WebKit 26.5 alike: at 100 px of scrolling, +49.2 px for the large disc, +73.8 for the small one, and the middle one 18.5 px to the left and 24.6 px lower; at 260 px, 0 / 0 / 0, three concentric discs in the middle of the frame; at 400 px, −43.1, −64.6 and the middle one 16.2 px to the right. Relative to the content they climb 31%, 46% and 15% faster. In the 280 px frame: the heading alone up to 77 px, the discs from 77 to 443 px (all of them whole only from 230 to 290 px), then 77 px of empty frame.

As it was sold, the effect stood still in Chromium and in WebKit: the discs were concentric from start to finish. The cause fits in one word, overflow: hidden on the tray, which made it the scroll container nearest to the discs — a container with no travel, hence an inactive timeline. The line became overflow: clip, which crops without hijacking scroll(), and the figures above date from after that fix. The rest is upkeep: selectors under .fx-0557-root, animations renamed fx0557Move, MoveSlow, MoveFast, a focusable area, the sentence raised from 40 to 60% white.

Accessibility

  • Reduced motion: prefers-reduced-motion: reduce removes the three animations. The discs then stay stacked at the centre of the tray, in the state they otherwise only reach at mid-scroll, and scroll with the content. The heading was never animated; it does not change.
  • Decoration only: the three layers carry aria-hidden="true" and contain no text. The discs are pale by construction — 50% opacity over a gradient already at 40%, i.e. 1.2 to 1.35:1 against the background (computed): do not entrust them with any information. The white heading reaches 19.8:1 and the sentence 7.3:1.
  • Keyboard: the area takes focus with Tab (tabindex="0"), shows a violet outline and is browsed with the arrow keys; the discs respond as they do to the wheel. Behaviour recorded in Chromium, Firefox and WebKit, which used to pass the area by before this addition.
  • Touch: native finger scrolling (150 px swiped, 152 px recorded in touch emulation). At 390 px wide the sideways drift of the middle disc (±30 px) stays inside the tray: no horizontal bar, neither in the area nor on the page.

Browser compatibility

No script. It takes animation-timeline: scroll(): Chrome and Edge 115, Safari 26, Firefox 159 according to MDN; overflow: clip has been around longer (Chrome 90, Firefox 81, Safari 16). Same positions to a tenth of a pixel in Chromium 149 and WebKit 26.5. In Firefox 151 the discs do not move: you come across them, concentric, in the middle of the tray. Not tried: Firefox 159+, real Safari, phones.

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

Outside the @supports (animation-timeline: scroll()) block the discs have no transform at all: they stay superimposed at the centre of the tray. It is a presentable state — a three-ring target — but the meeting, which is the whole effect, does not happen. The heading and the sentence show in every case.

The code

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

index.html — structure
<div class="fx-0557-root">
  <div class="sdc-scroll-container" tabindex="0" role="region" aria-label="…">
    <div class="sdc-parallax-content">
      <div class="sdc-parallax-layer" aria-hidden="true">
        <div class="sdc-parallax-circle sdc-parallax-circle--1"></div>
      </div>
      … two more layers: --2, --3
      <div class="sdc-parallax-text">
        <h3>…</h3>
        <p>…</p>
      </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 / propertyDefaultEffect
Amplitudes (CSS — @keyframes fx0557Move, fx0557MoveSlow, fx0557MoveFast) ±80 px, ±40 px, ±120 px The wider the gap, the faster the disc. As long as start and end are opposite, the meeting happens at mid-scroll; 40 → −120 moves it to the quarter, 120 → −40 to three quarters.
Sideways drift (CSS — translateX(-30px) → translateX(30px) in fx0557MoveSlow) 60 px from left to right, middle disc only Remove it for three vertical paths; add one of opposite sign to another disc so that they cross. Rotating the layer (transform: rotate() on .sdc-parallax-layer) changes the axis of the path.
Discs (CSS — .sdc-parallax-circle--1 to --3, .sdc-parallax-circle { opacity }) 200, 140 and 100 px; violet, pink, cyan; opacity .5 Size, colour and opacity are set per disc. Opaque and on mix-blend-mode: screen, they blend instead of covering each other.
Travel (CSS — .sdc-parallax-content { height: 800px }) 800 px, i.e. 520 px of travel Since offsets are in pixels, a shorter tray concentrates the motion. Keep overflow: clip on this block: with hidden, nothing moves any more.
Heading (HTML + CSS — .sdc-parallax-text) 19 px heading and 12 px sentence, 100 px from the top, above the discs It scrolls with the content. To keep it in place while the discs pass behind, give it position: sticky; top: 0.
Hint (HTML — span.sdc-scroll-hint) “Scroll ↓” over the bottom of the frame Needed in the demo, since the discs only arrive after 77 px; to be removed elsewhere.

FAQ

Parallax sets two planes against each other: a gradient background sliding by ±60 px, and a column of three cards appearing one by one with view(). It is a backdrop behind content. Here there is no revealed content and no view(): three objects of the same kind, on three paths that cross at one point. Choose Parallax to dress a list, this one when the meeting itself tells something — colours blending, two images coinciding. For text in parallax, see Parallax Layers CSS.
They are centred in an 800 px tray of which the frame shows 280: at rest they are below the fold, and they leave through the top before the end. The demo treats them as scenery you pass. To keep them in sight, put the three layers in a block of your own, on position: sticky; top: 0, as tall as the area: only the offsets move them then. The three examples on this page are built that way.
Almost certainly that frame is on overflow: hidden (or auto, or scroll). For the browser it then becomes the scrolling area nearest to the discs, and scroll() reads its position — which never changes. Replace it with overflow: clip: same cropping, rounded corners included, without the hijack. That was the flaw of the original code, and we reproduced it once ourselves while building the examples.