Circular Reveal Card
A card that is, as a whole, a two-state button: on click, the second state opens as a circle from the center and covers the first in 0.8 s; another click closes the circle. A clip-path animated in CSS, 0.7 KB of JavaScript to keep the state.
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
The .crv-toggle card is a 280 × 180 px <button> holding two stacked .crv-state layers. State A is underneath. State B is on top, but clipped by clip-path: circle(0 at 50% 50%): a zero-radius circle at the center of the card, hence invisible. Each carries its own content, an icon badge and a label in the demo.
The script only adds or removes the .crv-on class on click. CSS takes over: the circle goes to circle(100% ...) through a 0.8 s transition (cubic-bezier(.4, 0, .2, 1)), and state B shows through it. Since it is a transition and not an animation, a second click along the way heads back from the radius reached (two clicks 120 ms apart return to state A with no jump).
A 100% radius is larger than the card: on 280 × 180 px it is 235 px, while the corners sit 166 px from the center. So the circle has covered everything at 365 ms, and the remaining 435 ms happen out of view. Closing is the reverse: nothing moves on screen for the first 220 milliseconds, then the circle closes. These instants are identical in Chromium 149, Firefox 151 and WebKit 26.5 (10 px of radius at 100 ms, 132 px at 300 ms). The Customize section says how to remove that dead time.
Accessibility
- Reduced motion: the circle is dropped (
clip-path: none) and state B comes in through a 150 ms opacity fade; the toggle still works (opacity at 0.4 after 60 ms, at 1 before 320 ms). - Keyboard: it is a native button, so Tab reaches it (in Safari, only with the “Press Tab to highlight each item on a webpage” setting, otherwise Option + Tab), Enter and Space toggle it, without one line of script for that. 2 px purple outline on keyboard focus, offset by 3 px to stay readable on both states.
- Screen readers: the button carries
aria-pressed, and the script sets the covered state toaria-hidden. The name read is therefore always that of the state shown ("Day mode", then "Night mode" in the demo), the same one you see: a voice command such as "click Day mode" finds the button. - Card content: because it is a
<button>, it cannot contain a link, a field or another button. Text, icons, images and SVG only.
Browser compatibility
CSS (clip-path: circle() animated by transition, inset) + 0.7 KB of JavaScript (classList.toggle). Opening, closing, reversing midway, keyboard and reduced motion give the same readings in Chromium 149, Firefox 151 and WebKit 26.5. Unprefixed clip-path needs Safari 9.1, but inset is what sets the floor: Chrome 87, Firefox 66, Safari 14.1. The slight blur behind the icon badge (backdrop-filter, written without a prefix) is only applied by Safari from version 18; before that, the badge stays a plain translucent disc.
Without JavaScript, the card stays on state A. In a browser that does not know clip-path, state B would hide state A permanently: no browser still maintained is in that case.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="crv-root">
<button class="crv-toggle" type="button" aria-pressed="false">
<span class="crv-state crv-state-a">
<span class="crv-content">
<span class="crv-icon" aria-hidden="true">…</span>
<span class="crv-text">…</span>
</span>
</span>
<span class="crv-state crv-state-b" aria-hidden="true">
<span class="crv-content">
<span class="crv-icon" aria-hidden="true">…</span>
<span class="crv-text">…</span>
</span>
</span>
</button>
<span class="crv-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 |
|---|---|---|
Final radius (CSS — circle(100% at 50% 50%) in the .crv-on rule) |
100% | With 71%, the circle stops right at the corners, whatever the card's shape: opening then uses the whole duration (card covered at 735 ms instead of 365) and closing shows from 35 ms instead of 220. |
Circle center (CSS — at 50% 50%, in both .crv-state-b rules) |
center of the card | at 100% 0 starts it from the top right corner. The radius must follow: 100% no longer covers the card from a corner, 142% is needed (checked: card covered, no dead time). |
Duration and curve (CSS — transition: clip-path .8s cubic-bezier(.4, 0, .2, 1)) |
0.8 s | 0.4 s suits a small button; beyond one second, keep a 71% radius so the wait on closing does not grow as much. |
Card size (CSS — .crv-toggle { width; height; border-radius }) |
280 × 180 px, 16 px rounding | Radii are percentages: the card can become an 80 px tile or a 500 px picture with no other change. |
Starting state (HTML — crv-on class on .crv-toggle) |
absent: state A is shown | To start on state B, also write aria-pressed="true", aria-hidden="true" on .crv-state-a and remove it from .crv-state-b: the script only sets them on the first click. |
FAQ
button.click() on the .crv-toggle you want. The effect's script then updates the class, aria-pressed and the aria-hidden values as for a real click. Avoid setting crv-on by hand with classList: the circle would open, but the attributes read by screen readers would stay on the old state.