GlassmorphismPremium

Liquid Glass Card

A frosted glass card set in a sliding gradient frame, under a white highlight that drifts back and forth in 5 s. CSS only: no SVG filter, no script.

CSSBackdropGlass

Updated

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

3 usage examples

Digital membership pass — a neighbourhood cinema's app — Liquid Glass Card example 1

① Digital membership pass — a neighbourhood cinema's app

WhenA filmgoer opens the “My pass” tab before walking to the box office: the 10-film pass shows large, with the holder's name, the number, the barcode and the seven films left.
WhyThe highlight gliding over the card and the edge changing colour give it the look of a real laminated card tilted under the light — with nothing more than an HTML block. It lifts under the pointer like an object being picked up.
SettingsFrame enlarged to 304 × 192 px, 20 px corners (14 px for the card); glass tinted dark, rgba(22,16,52,.36), so the name and number can be read; content in three rows (cinema and pass type, holder, barcode drawn with a repeating gradient); original colours and durations.
Three lighting moods to choose from — a connected lighting app — Liquid Glass Card example 2

② Three lighting moods to choose from — a connected lighting app

WhenIn the “Living room” screen the user picks between “Sunset”, “Reading” and “Blue night”; the lamp drawn above takes on the chosen tint.
WhyEach tile carries its mood's colours in its frame, and those colours move like light: the choice is understood before it is read. The tile lifts under the finger or when the button it contains takes focus.
SettingsThree copies of the effect at 154 × 106 px; frames recoloured through background-image (orange-raspberry, honey-brown, indigo-petrol); a transparent <button aria-pressed> fills each card; the scene script rings the chosen tile with a white line and tints the lamp — it does not touch the effect.
Welcome voucher shown after sign-up — a tea house's online shop — Liquid Glass Card example 3

③ Welcome voucher shown after sign-up — a tea house's online shop

WhenA visitor signs up for the harvest letter; on click, a 10% voucher appears beside the form, with its code and how long it is valid.
WhyThe reward has to be seen at once: a card whose highlight moves gets noticed without a pop-up window or confetti. On this light page the green and amber frame makes the voucher stand out like a coupon laid on the table.
SettingsCard at its original size (240 × 160 px), frame recoloured in fir green, petrol green and burnt amber to carry white text; drop shadow added on the frame; the scene makes it appear in 0.35 s when “Sign me up” is clicked — that entrance belongs to the scene, not to the code you buy.

How it works

Two stacked blocks inside .lg-card-wrap (240 × 160 px). Underneath, .lg-card-bg: a 135° gradient of indigo #6366f1, pink #ec4899 and amber #f59e0b, painted twice as large as the block (background-size: 200% 200%) and walked from left to right in 6 seconds — you see indigo and pink, then pink and amber, then back. On top, .lg-card, inset by 8 px: the gradient therefore sticks out all round and forms a coloured frame.

The card is glass at 8% white with backdrop-filter: blur(12px) and an 18% white hairline: it softens the gradient moving beneath it. The highlight is its ::before, a 25% white radial halo twice the size of the card, which shifts by 15% of its width and 10% of its height (67 × 29 px) and comes back, in 5 seconds. overflow: hidden clips it to the rounded corners. The two loops have different lengths: highlight and colours only return to the same position together every 30 seconds.

On hover the card grows by 4% (233 × 150 px measured) and gains an indigo shadow, in 0.4 s; it reacts the same way when something inside it receives focus. To be precise about the word “liquid”: nothing distorts the backdrop, there is no SVG filter and no refraction. It is a frosting, a highlight and a frame, all driven by @keyframes — hence the same measured behaviour in the three engines tested.

Accessibility

  • Contrast, the demo's weak spot: measured over the card surface for twelve seconds, the white title holds between 2.3:1 and 3.4:1 and the 70% subtitle between 1.8:1 and 2.5:1 — not enough for body text. Two remedies used in the examples: tint the glass dark (.lg-card { background: rgba(22, 16, 52, .36) }) or pick a deeper gradient.
  • Reduced motion: with that system setting on, the frame and the highlight freeze at their starting position and the card no longer grows; only its shadow appears on hover, in 0.2 s. Measured in Chromium, Firefox and WebKit.
  • Keyboard: the original card is a div with nothing focusable in it, Tab goes past — which is right for an information card. Put a button or a link inside and it will lift as soon as that element has focus (:focus-within, measured); give that button or link its own focus outline.
  • Highlight and reading: the halo passes over text placed directly in the card and brightens it for a moment. To keep a text crisp, set it to position: relative: it then sits in front of the highlight.
  • Touch: in Chromium touch emulation the tapped card stays enlarged until the next tap; nothing fired under touch WebKit. Frame and highlight run on their own, with no gesture.

Browser compatibility

No recent feature apart from the frosting: gradients, @keyframes, transform. Measured under Playwright in Chromium, Firefox and WebKit: both loops run, same size on hover (233 × 150 px), and the frame does change colours between two readings three seconds apart. The card's blur, however, was only seen in Chromium, the one engine whose automated captures paint it. Real Safari: not verified. Minimum versions according to MDN: inset (card offset, frame size) needs Chrome 87, Edge 87, Safari 14.1; backdrop-filter needs Firefox 103 and is read with the -webkit- prefix, present in the code, before Safari 18.

Chrome 87+✓ Full (measured)
Firefox 103+✓ Loops and hover measured; frosting cannot be checked in automated captures
Safari 14.1+✓ Not verified on a real Safari (measured in WebKit)
Edge 87+✓ Not verified (same engine as Chrome)
Mobile iOS 14.5+✓ Not verified
Android Chrome 87+✓ Loops measured in emulation; the card stays enlarged after a tap

Without backdrop-filter the card becomes a plain 8% white veil: the gradient shows sharp through it, while the highlight and the frame keep moving. Since the background is already a soft gradient, the difference is small — far smaller than over a photo. No fallback is needed in the original setup.

The code

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

index.html — structure
<div class="fx-0321-root">
  <div class="lg-card-wrap">
    <div class="lg-card-bg"></div>
    <div class="lg-card">
      <div class="lg-card-title">…</div>
      <div class="lg-card-sub">…</div>
    </div>
  </div>
</div>

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

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Frame colours (CSS — .lg-card-bg { background }) #6366f1, #ec4899, #f59e0b at 135° To recolour, write background-image: linear-gradient(…) rather than background:, which would reset background-size and freeze the frame. Three colours give a real journey; two neighbouring tones, a mere shimmer.
Frame motion (CSS — background-size: 200% 200%, lgCardBgShift 6s) horizontal there-and-back in 6 s 300% 300% scrolls more of the gradient, so colours are more clear-cut at any moment. animation: none on .lg-card-bg gives a fixed frame without touching the highlight.
Frame thickness (CSS — .lg-card { inset: 8px }) 8 px of gradient visible around the card inset: 2px gives a thin glowing edge; inset: 16px a mount. For truly parallel corners, give the card the frame's radius minus the inset.
Highlight (CSS — .lg-card::before, lgSpecularMove 5s) 25% white halo, 15% × 10% travel, 5 s Lower it to 12% for a barely perceptible highlight behind text; lengthen the travel (translate(30%, 20%)) so it crosses the whole card. Change the duration without matching the frame's 6 s, or the two motions fall into step.
Glass (CSS — .lg-card { background; backdrop-filter }) 8% white, 12 px blur, 18% white hairline Dark glass (rgba(22,16,52,.36)) makes white text readable; a 24 px blur melts the three colours into one sheet. Edit both blur lines, prefixed and unprefixed.
Lift (CSS — .lg-card:hover and :focus-within) scale(1.04), rgba(99,102,241,.3) shadow, 0.4 s At 1.04 the card covers half of the frame; at 1.11 it hides it entirely. Match the shadow colour to your gradient.
Size (CSS — .lg-card-wrap { width; height }) 240 × 160 px Everything else follows in percentages or offsets. The card can be emptied and refilled at will: it is a centred column flex box.

FAQ

Liquid Glass Refraction really bends what lies behind its plate, through an SVG displacement filter slipped into backdrop-filter — but only Chromium applies it — and its highlight follows the pointer with JavaScript. Liquid Glass Card distorts nothing: it is a frosting, a highlight that wanders by itself and a built-in gradient frame, all in CSS, with nothing that depends on a single engine. Take the former to set a plate over a photo or a video and get the optical effect; take this one for a self-contained card that brings its own background and needs neither script nor backdrop.
Because the background shorthand resets everything you do not spell out, including background-size. And it is background-size: 200% 200% that gives the gradient room to slide: brought back to the size of the block, it has no travel left and the animation runs idle. Recolour with background-image, or repeat the size in your rule: background: linear-gradient(…) 0 0 / 200% 200%.
Yes, in two ways. Either you give the photo to the frame: .lg-card-bg { background-image: url(…); background-size: cover } — the image then fills the block exactly and no longer slides, only the highlight stays animated. Or you delete .lg-card-bg and place .lg-card-wrap above your image: the card frosts whatever lies behind it on the page. In both cases, check that the text stays readable over the bright areas of the photo and darken the glass if needed.