GlassmorphismPremium

Aurora Glass

Three blurred sheets of colour slowly drift and turn behind a glass card that lifts on hover: an aurora with no canvas and no script.

CSSAuroraAnimation

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

Signing in to the student area — an online yoga studio — Aurora Glass example 1

① Signing in to the student area — an online yoga studio

WhenA student lands on the sign-in page ten minutes before the evening class: the aurora fills the screen, the class reminder sits on the left, the form in the glass card on the right.
WhyA sign-in page is a waiting screen: a slowly breathing background dresses it without pulling attention from two fields and a button. The card lifts when you click into a field, thanks to :focus-within — you can tell where you are typing.
SettingsScene raised to 540 × 360 px, square corners; card shifted right (left: 73%), 232 px wide, free height, cursor: auto; two real fields and a button inside; loops sped up three times (4, 3.3 and 4.7 s) so the drift shows in a one-second capture — on a real site, keep the original durations.
Trip of the month highlighted in the programme — a night photography club — Aurora Glass example 2

② Trip of the month highlighted in the programme — a night photography club

WhenFebruary's programme is a plain list of four outings; next to it, the “Shooting the northern lights” trip gets the animated panel.
WhyIn a list, a single moving block draws the eye without a loud banner, and the trip's subject justifies the aurora. The whole card is a link: it lifts on hover and on keyboard focus, which announces the click.
Settings242 × 286 px scene with 18 px corners, set to the right of the list; card as a 206 × 232 px <a href> with tag, icon, title, dates and “See the trip”; original colours; loops sped up three times for the capture.
“Entries are open” banner at the top of the page — a night running race website — Aurora Glass example 3

③ “Entries are open” banner at the top of the page — a night running race website

WhenEntries have just opened: a 92 px strip at the top of the site says so, with the number of bibs left and the link to enter.
WhyOn a light page the dark, moving strip is noticed at once and recalls that the race is run at night. The card, flattened into a capsule, holds the announcement on one line and keeps the button readable.
Settings540 × 92 px scene with no corners; 496 × 54 px card laid out in a row (flex-direction: row), 27 px corners, cursor: auto, 32 px round icon, solid white link on the right; the sheets, stretched to 1080 × 184 px, turn into bands of colour; loops sped up three times for the capture.

How it works

The aurora is made of three empty divs, .aurora-glass-wave, kept in a layer that clips them. Each one is twice the size of the scene (640 × 480 px for a 320 × 240 scene) and carries a 135° gradient that fades out two thirds of the way — cyan to indigo, violet to pink, green to turquoise — plus 40% rounded edges and a filter: blur(40px) that wipes out any outline. Their opacities (0.5, 0.35 and 0.3) let the midnight-blue #060610 background rise between them.

Each sheet follows its own @keyframes loop: it slides by up to 15% of its size and turns by up to 15°, over 12, 10 and 14 seconds. Because the three durations differ, the colours only line up in the same place every 420 seconds: the loop cannot be seen. Only transform is animated: the sheets are not repainted, just moved; the card's frosting, however, is recomputed on every frame.

In front sits .aurora-glass-card: 240 × 160 px, centred, 6% white, backdrop-filter: blur(20px), a slanted sheen in its ::before. On hover it brightens to 9%, deepens its shadow and grows by 3% in 0.4 s (247 × 165 px measured). It does the same as soon as anything inside it receives focus. It is a plain container: icon, title and text can be swapped for whatever you need — a form, a price, a link.

Accessibility

  • Reduced motion: when the visitor has turned that setting on, the three sheets stop at their starting position — the aurora stays, still — and the card no longer grows: it keeps its change of tint and shadow, applied with no transition. Measured in all three engines: no animation left running.
  • Keyboard: the demo card is a div, Tab does not stop on it — and there is nothing to activate. If it leads somewhere, write it as <a class="aurora-glass-card" href="…">: measured, it then takes focus, lifts as on hover and gets a 2 px #a5f3fc outline.
  • Cursor: the code gives the card cursor: pointer, which promises a click. If your card is not clickable (a panel, a form), add cursor: auto — the sign-in and banner examples do.
  • Contrast: it varies with the sheet passing behind. Measured over the whole card surface for twelve seconds: white title between 3.6:1 and 13.9:1; subtitle in 50% white between 2.1:1 and 4.7:1, too weak when the cyan passes. Raise the subtitle to 85% and, for long text, darken the card (rgba(8, 10, 30, .35)).
  • Touch: in Chromium touch emulation the tapped card stays lifted until the next tap; under touch WebKit the tap triggered nothing. The aurora itself runs without any gesture.

Browser compatibility

Measured under Playwright in Chromium, Firefox and WebKit: the three loops run, with the same computed values for the card at rest, on hover and on focus. The card's frosting could only be looked at in Chromium: automated captures of the other two engines do not paint it. Real Safari: not verified. Minimum versions according to MDN: the inset property, which stretches the layer and the sheen, needs Chrome 87, Edge 87, Firefox 66, Safari 14.1; backdrop-filter needs Firefox 103, and Safari reads it with the -webkit- prefix (declared) up to version 17. :focus-within and :focus-visible are written in rules of their own: a browser that ignores one keeps the hover. Three 640 × 480 px layers blurred at 40 px stay light while the scene is small; full screen on an entry-level phone, keep an eye on smoothness.

Chrome 87+✓ Full (measured)
Firefox 103+✓ Loops and states 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+✓ Aurora measured in emulation; the card stays lifted after a tap

Without backdrop-filter the card is only a 6% white veil: the aurora shows sharply through it, and the text gets hard to read when a bright sheet passes. Give it a denser fill inside @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))), for instance rgba(10, 12, 32, .6). The sheets' animation only depends on transform and filter.

The code

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

index.html — structure
<div class="fx-0310-root">
  <div class="aurora-glass-scene">
    <div class="aurora-glass-layer">
      <div class="aurora-glass-wave aurora-glass-wave--1"></div>
      <div class="aurora-glass-wave aurora-glass-wave--2"></div>
      <div class="aurora-glass-wave aurora-glass-wave--3"></div>
    </div>
    <div class="aurora-glass-card">
      <div class="aurora-glass-icon">
        <svg viewBox="0 0 24 24"><path d="…"></path></svg>
      </div>
      <h3>…</h3>
      <p>…</p>
    </div>
  </div>
</div>

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

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Aurora colours (CSS — .aurora-glass-wave--1, --2, --3) cyan #22d3ee → indigo, violet #a855f7 → pink, green #10b981 → turquoise Each sheet is a linear-gradient(135deg, colour A, colour B 50%, transparent 70%): change A and B, keep the final transparent, otherwise the sheets form a flat fill. Two sheets are enough for a calmer background.
Speed (CSS — durations 12s, 10s, 14s) three loops of different lengths Divide all three by the same number to speed up. Keep the durations unequal: with three identical values the pattern repeats to the naked eye.
Range (CSS — @keyframes auroraGlassWave1 to 3) slide of up to 15%, turn of up to 15° Percentages refer to the sheet, twice as large as the scene: 10% is therefore 64 px in the demo. Past 25%, an edge of a sheet may enter the frame.
Intensity (CSS — opacity and filter: blur(40px) on the sheets) opacities 0.5 / 0.35 / 0.3, 40 px blur More opacity gives a vivid aurora but less readable text on the card. A 20 px blur shows the rounded shape of the sheets; 60 px melts them into a single halo.
Glass of the card (CSS — .aurora-glass-card) 240 × 160 px, 6% white, 20 px blur, 16 px corners Width, height and padding are free; the card stays centred through top: 50%; left: 50%. Edit the blur on both of its lines, prefixed and unprefixed.
Lift (CSS — :hover and :focus-within, scale(1.03), transition: .4s) +3%, 9% fill, 0 12px 40px shadow Both rules carry the same values: change them together. Keep translate(-50%, -50%) in front of scale(), or the card jumps off centre.
Scene size (CSS — .aurora-glass-scene) 320 × 240 px, 16 px corners, #060610 background The sheets follow in percentages: the scene can become a page background (width: 100%; height: 100vh) or a 90 px strip. The midnight-blue background gives the aurora its depth; on a light background it turns pastel.

FAQ

Frosted Aurora draws three sine-wave ribbons in a canvas, frame by frame, with a script: its ribbons really ripple, and it provides an opaque panel for people who reduce transparency. Aurora Glass has no canvas and no script — three divs and three @keyframes: these are wide sheets that drift, not ribbons that ripple. In return its colours are changed in the CSS, nothing has to be recomputed when the block changes size, and its card reacts to hover and focus whereas Frosted Aurora's panel is inert. Both respect reduced motion.
Yes: the card is a column flex box, whatever you put in it stacks in the centre. As soon as an inner field or link receives focus, the :focus-within rule lifts it as on hover — handy to flag the block being filled in. For a fully clickable card, change its tag to <a>: the CSS already removes the underline and provides the focus outline. Either way, remove or keep cursor: pointer depending on whether a click on the card does anything.
Yes, that is what the sign-in example does. Give .aurora-glass-scene the size of the page, drop its rounded corners and, if you have no use for the card, delete it: the sheets live on their own in their layer. Two precautions: the sheets are always twice the scene, so 2 × the screen size once used full background — test on a modest phone; and set your text on a panel or a dark veil, because the brightest area of the background keeps moving.