Glassmorphism✨ Premium

Iridescent Glass Panel

A 220 × 150 px frosted glass panel crossed by rainbow reflections: a magenta-cyan-blue-amber conic gradient, blended in screen mode, whose center sits under the pointer and whose angle turns with it — like a soap-bubble film that changes as you move, with a mouse or a finger.

CSSMouseIridescent

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Glassmorphism has 47 effects, including 6 free. Explore the category →

3 usage examples

Authenticity hologram on a named ticket — a festival's ticketing app — Iridescent Glass Panel example 1

① Authenticity hologram on a named ticket — a festival's ticketing app

WhenAt the festival gate, the attendee opens her ticket in the app: an iridescent “Genuine” badge reacts when she runs her finger over it.
WhyReflections that follow the gesture mimic the anti-copy hologram of a paper ticket: the steward sees the colors turn under the finger, which a frozen screenshot cannot reproduce. The glass badge lets the ticket's printed guilloche show through behind it, blurred, like a real holographic foil.
Settings178 × 124 px panel on the ticket, over a pink and violet guilloche that the glass blurs; text in wine red. Light ticket: reflections raised to 45% and switched to mix-blend-mode: overlay — in screen mode at 25%, they washed out on the pale background. Simulated movement for the capture.
A watch's mother-of-pearl dial — a watchmaker's product page — Iridescent Glass Panel example 2

② A watch's mother-of-pearl dial — a watchmaker's product page

WhenOn the “Nacre 36” page, the customer hovers over the watch's white mother-of-pearl dial.
WhyMother-of-pearl changes hue with the angle: that is what sets it apart from a white dial, and what a still photo does not show. The conic gradient turning with the pointer reproduces that play; the glass blurs the engraved sunburst underneath and makes it milky, as under a sapphire crystal.
SettingsRound panel (border-radius: 50%) of 224 px, over a pastel repeating-conic-gradient sunburst inside a steel case; indices, hands and engraved name inside the panel, in dark gray. Original reflection settings (25%, screen).
The cover of a “Light” special issue — a photography magazine — Iridescent Glass Panel example 3

③ The cover of a “Light” special issue — a photography magazine

WhenIn the digital newsstand, the special issue's cover reacts on hover, among the other titles.
WhyThe issue's theme — light broken into colors — is shown by the cover itself: a prism and its fan of colors under the glass, and rainbow reflections that turn as you move. The cover stands out from the other titles without a word more.
SettingsPanel over the whole cover (248 × 332 px), blur brought down to 5 px so the prism stays recognizable; title, issue number and price inside the panel, above the reflections.

How it works

The .lg-iridescent panel is a pane of glass: 5% white fill, backdrop-filter: blur(14px) (with -webkit-), 15% white border, 16 px corners, overflow: hidden, crosshair cursor. Inside, two position: absolute; inset: 0 layers that let the pointer through. .lg-iridescent-layer carries a conic-gradient(from var(--iri-angle) at var(--iri-x) var(--iri-y), …) that goes round the color wheel — magenta, cyan, blue, amber, back to magenta, each at 25% — in mix-blend-mode: screen at 70% opacity (100% on hover, over 0.3 s). .lg-iridescent-shine adds a 20% white spot centered on the same point. The text (12.8 px, weight 600, white with a shadow) sits on top.

The script listens to pointermove on every [data-iridescent] and writes three variables on it: --iri-x and --iri-y, the pointer position as a percentage of the panel, and --iri-angle, the angle between the panel's center and the pointer (Math.atan2, in degrees). The gradient's center therefore follows the finger and the color wheel turns as you go round the panel. --iri-angle is declared through @property as an <angle>. Measured, pointer 20 px from the bottom-right corner of a 220 × 150 panel: layer at conic-gradient(from 31.4296deg at 90.9091% 86.6667%, …), identical in Chromium 151 and Firefox 153.

Three details in the code make the wheel turn everywhere. The @property --iri-angle declaration says inherits: true: the script writes the angle on the panel, and it is the layer, its child, that uses it; with false, the layer would stay at 0° — measured, 31.43° on the panel against 0° on the layer, and a gradient without “from” where only the center moves. The listener is pointermove, with touch-action: none on the panel: measured in Chromium with touch, a sliding finger turns the wheel (29.5°, center at 64% × 61%). Finally the panel sits in an .lg-iridescent-backdrop setting (sharp discs, hatching), because glass over a flat color has nothing to blur; replace it with your picture.

Accessibility

  • Decoration: the reflections carry no information; a screen reader only reads the panel's text. If the panel serves as visual proof (a ticket hologram), also give the proof as text — name, number, “valid” status — readable without moving a finger.
  • Text contrast: it varies with the reflection's position, since the color under the text changes. The original shadowed white text holds on a panel over a dark background; on a light background, switch it to a dark color (as the ticket and the dial on this page do) and check contrast at the worst spot, when the reflection's white spot passes underneath.
  • Motion: nothing moves on its own; the reflections only move with the pointer, on demand. No prefers-reduced-motion rule is needed. The 70% to 100% opacity change on hover lasts 0.3 s.
  • With a finger: touch-action: none stops the page from scrolling when the finger starts on the panel. On a 220 × 150 px panel that is not a problem; if you enlarge it to the full width of a phone, leave room around it to scroll.
  • Keyboard: no keyboard interaction, and none is needed as long as the panel is decorative.

Browser compatibility

CSS: conic-gradient with position and angle in variables, mix-blend-mode: screen, @property, backdrop-filter (and -webkit-), touch-action. JS: pointermove, style.setProperty. Zero dependencies. Measured in Chromium 151 and Firefox 153: same gradient, same angle (31.4296°), no error; touch in Chromium with mobile emulation. Browsers without @property treat --iri-angle as an ordinary variable, which inherits: the effect works there too.

Chrome 76+✓ Full
Firefox 83+✓ Full (blur from Firefox 103)
Safari 13+✓ Full
Edge 79+✓ Full
Mobile iOS 13+✓ Full, reflections follow the finger
Android Chrome 76+✓ Full, reflections follow the finger

Without conic-gradient (Firefox before 83, Safari before 12.1), the layer has no background: what remains is the glass and the white spot following the pointer. Without backdrop-filter, the panel is translucent with no blur. Without pointer events (Safari before 13), the reflections stay frozen at the center.

The code

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

index.html — structure
<div class="demo-preview">
  <div class="lg-iridescent-backdrop">
    <div class="lg-iridescent" data-iridescent="">
      <div class="lg-iridescent-layer"></div>
      <div class="lg-iridescent-shine"></div>
      <span class="lg-iridescent-text">…</span>
    </div>
  </div>
</div>
Unlock the full code — $9.90/mo incl. tax

The full HTML + CSS + JS of Iridescent Glass Panel, ready to paste — plus all 840 effects. Or $299 once, lifetime access.

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Reflection colors and strength (CSS — .lg-iridescent-layer, conic-gradient(…)) magenta, cyan, blue, amber, magenta, at 25%; mix-blend-mode: screen; opacity 0.7 then 1 on hover On a light background, go up to 40-50% and switch to mix-blend-mode: overlay, otherwise screen washes everything out. For discreet mother-of-pearl, keep 25% and add pastel hues; for a bold hologram, saturated colors. Keep the last color equal to the first to avoid a seam.
Rotation with the pointer (JS — --iri-angle; CSS — @property --iri-angle) angle between the center and the pointer, inherited by the layer Multiply the angle (l * 2) for a wheel that turns twice as fast. Keep inherits: true in the declaration: with false, the layer never receives the angle and the wheel stops turning.
White highlight (CSS — .lg-iridescent-shine) 20% white → transparent at 50% of the radius Raise to 35% for a strong glint under the finger, or delete the layer to keep only the colors.
Glass (CSS — .lg-iridescent: backdrop-filter: blur(14px), 5% white fill) 14 px blur 5 px keeps what is behind readable (a cover picture); 20 px leaves only colors. The panel can take any shape: border-radius: 50% for a dial, a 120 px badge for a seal.
Setting behind the glass (CSS — .lg-iridescent-backdrop) three sharp discs, hatching, night background It makes the blur visible in the demo; delete it and set the panel over your picture.

FAQ

Because the angle is not read where it is written. The script writes the three variables on the panel; the position (--iri-x, --iri-y), undeclared, inherits like any CSS variable, but an angle declared with inherits: false would stop at the panel — the layer would keep its initial value, 0°, and only the center position would move. Measured with false: 31.43° on the panel, 0° on the layer. With inherits: true, the layer receives the angle. A curiosity: in a browser without @property, the variable is not declared, hence inherited, and the wheel turns either way.
Yes, the script listens to pointer events: a finger sliding over the panel moves and turns the reflections (measured in Chromium with emulated touch). touch-action: none keeps the page from scrolling during the gesture. It does not use the phone's tilt: for a hologram that moves when you tilt the device, you would write the same variables from the deviceorientation event, with the permission request iOS Safari requires.
fx-0788 distorts the background through the pane (SVG displacement filter) and adds a specular highlight: you see the glass's thickness. Iridescent Glass Panel distorts nothing: it colors the surface with a rainbow film that turns with the pointer — you see a surface treatment, like a soap bubble or a hologram. The first for a “real” glass panel, the second for a precious material or a visual proof.