Circle Reveal
A colored disc opens from the center of the screen until it covers it, the page changes underneath, then it closes on the new one: a cartoon iris in clip-path: circle(), 1.2 s, a layer that covers then uncovers — CSS + 1.5 KB of JavaScript.
Updated
This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Transitions has 52 effects, including 9 free. Explore the category →
3 usage examples



How it works
Above pages A and B sits the .circle-reveal-overlay layer: a magenta to orange gradient (#d946ef → #f97316) cut by clip-path: circle(0 at 50% 50%), so invisible at rest. It fills the whole .transition-preview screen (z-index: 10), but a zero-radius circle shows none of it.
On click, the layer gets .animating and plays @keyframes circleReveal over 1.2 s ease-in-out: the radius goes from 0 to 150% at 45%, stays open until 55%, then back to 0. A percentage radius is computed on the box diagonal divided by √2; at 150%, the circle reaches past all four corners whatever the screen's shape. At 0.6 s, when the disc covers everything, the script toggles .is-b on .transition-preview: page B replaces A underneath, and the disc closes on it. So it is not the new page appearing inside the circle, it is a layer that covers then uncovers: the eye follows the color disc, not a blend of both pages.
B stays on screen once the iris has passed: .is-b is only removed on the next click, which opens the disc again and brings A back. At swap time, the radius read is indeed circle(150% at 50% 50%) in all three test engines (Chromium 151, Firefox 153, WebKit 26.5): no corner of the old page shows.
Accessibility
- Reduced motion: with
prefers-reduced-motion: reduce, the disc stays closed; the script goes straight to B, with a 150 ms fade between the two pages (measured: layer still, B shown in under 250 ms). - Keyboard and screen readers: as with Fade Through (fx-0685), the button keeps focus during the iris and the hidden page stays out of the accessibility tree;
aria-live="polite"on.transition-previewhas B read at swap time if needed. - Color: the full disc fills the screen for 0.12 s. On a dark interface, a saturated gradient that large can dazzle: a more muted tint (see Customize) keeps the effect.
Browser compatibility
CSS (@keyframes on clip-path: circle(), inset) + 1.5 KB of JavaScript, no dependency. Measured in Chromium 151, Firefox 153 and WebKit 26.5: disc at 150% at swap time, page B held, back to A on the next click, focus kept, direct swap under reduced motion. Unprefixed clip-path animation exists since Chrome 55, Firefox 54 and Safari 12.1; inset raises the minimums to Chrome 87, Firefox 66, Safari 14.1.
Without JavaScript, page A stays on screen and the button does nothing: provide a regular link to the next page. Without inset (Safari before 14.1), write top: 0; right: 0; bottom: 0; left: 0 on .transition-content and .transition-overlay.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="cr-stage">
<div class="transition-preview">
<div class="transition-content old-content">Page A</div>
<div class="transition-content new-content">Page B</div>
<div class="transition-overlay circle-reveal-overlay"></div>
</div>
<button type="button" class="trigger-btn">Trigger Transition</button>
</div>
One-time payment, no subscription — the code is yours forever
Customize
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
Disc color (CSS — .circle-reveal-overlay { background }) |
#d946ef → #f97316 gradient | Black for a shutter, a brand color for a signature. A tint darker than both pages makes the change easier on the eye. |
Iris center (CSS — at 50% 50%, to change in the three steps and the resting rule) |
center of the screen | at 100% 0% starts from the top right corner (often where a button sits); then raise the maximum radius to 250% to cover the opposite corner. |
Duration (CSS — animation: … 1.2s; JS — SWAP_AT, END_AT) |
1.2 s; swap at 600 ms, end at 1,200 ms | Change all three together, SWAP_AT at half. 0.8 s for a brisk gesture, 1.6 s for an opening title. |
Pause with the disc open (CSS — 45% and 55% steps) |
0.12 s | 35% / 65% keeps the full disc for 0.36 s, long enough to show a centered logo. |
Content (HTML — .old-content, .new-content) |
"Page A" and "Page B" on two gradients | Any HTML. For more than two pages, fill the hidden layer before the click. |
FAQ
circle(), a percentage radius refers to the box diagonal divided by √2, not to its width. Centered, the circle must reach half the diagonal to cover the corners: about 71% of that reference. 150% leaves a comfortable margin, and the disc already covers the whole screen well before 45% of the animation. If you move the center to a corner, you need about 142%, hence the advised 250%.ended event and call stage.querySelector('.trigger-btn').click(): the iris closes on the last frame, the swap happens under the disc, and you can start the next episode in .new-content at the same moment.