Distortion✨ Premium

Holographic Badge

Round medallion ringed by a spinning multicoloured band, with a white glint sweeping its centre; the ring speeds up on hover. CSS only.

CSSBadgeFoil

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Distortion has 31 effects, including 5 free. Explore the category →

3 usage examples

“Verified seller” seal next to a name on a second-hand site (Revendelle) — Holographic Badge example 1

① “Verified seller” seal next to a name on a second-hand site (Revendelle)

WhenOn a seller's profile, a small 40 px medallion spins next to her name, above her rating, her number of sales and her items for sale.
WhyA moving ring stands out at once on a page full of photos, without a big banner; its iridescent look recalls an authenticity hologram.
Settings--hlb-size: 40px, --hlb-ring: 2px, --hlb-font: .95rem, root inline in the heading (transparent background, zero height); in the centre “✓” followed by hidden text “Verified seller”.
Walking-challenge medal after “Confirm my day” (Arpentine) — Holographic Badge example 2

② Walking-challenge medal after “Confirm my day” (Arpentine)

WhenThe walker is at 198.6 km out of 200; she confirms today's 6.8 km and the result screen shows the large “200 km · NOVEMBER” medal with her stats and a share button.
WhyThe reward arrives at the moment of the action: a shining, spinning medal is worth more than a green tick for a month of effort.
Settings--hlb-size: 168px, --hlb-ring: 4px, --hlb-font: 1.75rem, face #0f2e25. The root sits in the result screen, which the page shows when “Confirm my day” is clicked.
Heads-or-tails coin that decides who starts an online game (Quarteval) — Holographic Badge example 3

③ Heads-or-tails coin that decides who starts an online game (Quarteval)

WhenBefore the first move of an online board game, the coin is a “Toss” button; its ring races when the mouse hovers it, and the click announces who starts.
WhyThe ring speeding up under the pointer invites the click, like a coin spun between your fingers.
SettingsMedallion inside a <button> (visible keyboard focus), --hlb-size: 150px, --hlb-fast: .7s, face #13233b. The toss and the message are handled by the page.

How it works

The .hlb-badge medallion (160 px) is a dark disc. Its ::before pseudo-element is a magenta, cyan, yellow, green and pink conic gradient at 70% opacity that spins on itself in 4 seconds (--hlb-speed). The ::after pseudo-element covers that disc, inset by 3 px (--hlb-ring): only the ring stays visible, and its colours seem to flow around.

In the centre, the .hlb-inner disc (75% of the diameter) holds the real text, a very light coloured tint and a thin white circle. Its own ::before is a diagonal white band crossing it every 3 seconds (--hlb-shine), like a glint on metallic foil.

When the medallion is hovered, the ring goes to one turn per second (--hlb-fast). The same speed-up happens when the medallion sits in a link or button that gets keyboard focus. Without hover, everything turns on its own, continuously.

Accessibility

  • Real text: the central word (“VERIFIED” by default) is in the HTML and read by screen readers; replace it with a word in your language. For a symbol such as “✓”, add visually hidden text that says what it means.
  • Not a button: by default the medallion is only an indicator, so it can't be reached with the keyboard, on purpose. If it should lead somewhere or trigger an action, put it inside an <a> or a <button>: keyboard focus then speeds up the ring like hover.
  • Touch: on a bare medallion, a finger doesn't speed up the ring in WebKit (measured), while Chromium and Firefox apply hover on touch. Inside a button, it speeds up in all three engines (measured).
  • Reduced motion: with prefers-reduced-motion: reduce, the ring stops and the glint stays still at 30% opacity; the medallion and its text remain displayed (measured on two copies: 4 looping animations → 0).
  • No flashing: rotation and glint are slow and continuous, with no sudden change of brightness.

Browser compatibility

CSS only, no JavaScript. Measured in Chromium 151, Firefox 153 and Playwright's WebKit 26.5: 0 errors, two independent copies, hover, 390 px and reduced motion. Minimum versions per @mdn/browser-compat-data: the conic gradient (Firefox 83) and the inset property (Chrome 87, Safari 14.1) set the floor.

Chrome 87+✓ Full (measured in version 151)
Firefox 83+✓ Full (measured in version 153)
Safari 14.1+✓ Full (measured in Playwright's WebKit 26.5)
Edge 87+✓ Full (Chromium engine)
Safari iOS 14.5+✓ Full; speed-up on tap only inside a link or button (measured in touch WebKit)
Chrome Android 87+✓ Full (Chromium engine)

Without conic gradients, the ring isn't painted: the dark disc, the inner disc and its text remain. Without inset, replace it with equal top, right, bottom and left values.

The code

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

index.html — structure
<div class="fx-0269-root">
  <div class="hlb-badge">
    <div class="hlb-inner">VERIFIED</div>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
--hlb-size 160px Medallion diameter; the inner disc follows (75%).
--hlb-ring 3px Thickness of the visible ring.
--hlb-speed and --hlb-fast 4s and 1s Duration of one turn of the ring at rest, then on hover or focus.
--hlb-shine 3s Duration of one pass of the white glint over the inner disc.
--hlb-font .9rem Size of the central text (uppercase, 2 px letter spacing).
--hlb-face #1a1a2e Colour of the medallion's face, under the ring and around the inner disc.
--hlb-bg and --hlb-min-h #0a0a0f and 300px Root background and minimum height; transparent and 0 to place it in a line of text or a card.
Content of .hlb-inner VERIFIED A word, a score, a symbol: whatever you put there is centred under the glint.

FAQ

Put the root inside your heading and set --hlb-size: 40px, --hlb-ring: 2px, --hlb-bg: transparent, --hlb-min-h: 0, then display: inline-flex, width: auto and vertical-align: middle on the root (otherwise it drops to its own line). Below 40 px, keep a single character in the centre.
Safari only applies hover under a finger to clickable elements. If the speed-up matters to you, put the medallion in a <button> or an <a> (measured: a tap then speeds up the ring in all three engines).
They are written in the conic-gradient of .hlb-badge::before: replace the colour list there, repeating the first colour at the end to avoid a seam.