Skip to content
animorio
IT
Back to the library

Frosted glass circle

WebGL, HoverWebGL, Canvas, GSAPAdvancedCompressed weight: Demo 16 KBGSAP 28 KBFreeDownload the zip

The invitation of a made-up school that leads to a job, Brightwell, held behind a pane of frost drawn in hand-written WebGL. The frost grows from the top with a jagged mint front and bends and blurs the card behind it; the pointer wipes it in a trail that closes again slowly, its edge lighting up white. Draw a circle (at least 20 points, 330 degrees, closed) and the glass melts from the circle’s centre behind a white ring, and the invitation comes alive: the lock opens, the button wakes up. Premium minimal style.

Rebuilt from scratch studying why.zero.university by Sindhur Dutta, Zero: the idea is theirs; code, copy and images are ours. Read how it’s made

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Frosted glass circle" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>The frosted glass that opens when you draw a circle</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the invitation of a made-up school that trains people on real briefs and places them in a job, held behind a
         pane of frosted glass drawn in WebGL. The pointer wipes the frost away and it closes again slowly; drawing a
         circle melts the whole pane from the circle's centre and the invitation comes alive -->
    <div class="wrap" data-wrap>
      <article class="invite is-locked" data-card>
        <span class="invite__edge" data-edge aria-hidden="true"></span>
        <header class="invite__head">
          <span class="invite__brand">
            <svg class="invite__mark" viewBox="0 0 20 20" aria-hidden="true">
              <path d="M3.5 16.5V9a6.5 6.5 0 0 1 13 0v7.5"/>
              <path d="M7.2 16.5V9.4a2.8 2.8 0 0 1 5.6 0v7.1"/>
            </svg>
            Brightwell
          </span>
          <span class="invite__chip">Invitation</span>
        </header>
        <p class="invite__over">Product design, spring term</p>
        <h1 class="invite__title">Your seat is held.</h1>
        <p class="invite__line">Twelve weeks of real briefs from partner studios, a mentor every Friday and a hiring day at the end.</p>
        <dl class="invite__facts">
          <div class="invite__fact"><dt>Starts</dt><dd>Jan 12</dd></div>
          <div class="invite__fact"><dt>Length</dt><dd>12 weeks</dd></div>
          <div class="invite__fact invite__fact--seat" data-seat>
            <dt>Seat</dt>
            <dd>
              <svg class="lock" viewBox="0 0 14 14" aria-hidden="true">
                <path class="lock__shackle" data-shackle d="M4.3 6.4V4.6a2.7 2.7 0 0 1 5.4 0v1.8"/>
                <rect class="lock__body" x="2.6" y="6.4" width="8.8" height="6" rx="1.6"/>
              </svg>
              <span class="seat__word" data-seat-word>Locked</span>
            </dd>
          </div>
        </dl>
        <button class="claim" type="button" data-claim tabindex="-1">
          <span class="claim__sheen" data-sheen aria-hidden="true"></span>
          <span class="claim__face" data-face>
            <span class="claim__words" data-claim-words>Claim your seat</span>
            <svg class="claim__icon" viewBox="0 0 16 16" aria-hidden="true">
              <path class="claim__arrow" data-arrow d="M3 8h9M8.5 4.2L12.3 8 8.5 11.8"/>
              <path class="claim__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
            </svg>
          </span>
        </button>
      </article>
      <button class="refreeze" type="button" data-refreeze tabindex="-1">
        <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 2v12M2.8 5l10.4 6M2.8 11l10.4-6M6.4 2.9L8 4.3l1.6-1.4M6.4 13.1L8 11.7l1.6 1.4"/></svg>
        <span>Frost it again</span>
      </button>
    </div>

    <canvas class="glass" data-glass aria-hidden="true"></canvas>
    <div class="glass-css" data-glass-css aria-hidden="true"></div>

    <div class="hint" data-hint aria-hidden="true">
      <span class="hint__ring" data-ring>
        <span class="hint__track"></span>
        <span class="hint__comet" data-comet></span>
        <span class="hint__arm" data-arm><span class="hint__dot"></span></span>
      </span>
      <span class="hint__words"><span class="hint__big">Draw a circle</span><span class="hint__small">to open your invitation</span></span>
    </div>

    <button class="skip" type="button" data-skip>Open the invitation</button>
    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></svg>
    <p class="sr" aria-live="polite" data-live></p>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

42 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Frosted glass circle” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a near black green ground, with a low green light, sits the invitation of Brightwell, a school that trains on real work: «Product design, spring term», the title «Your seat is held.» in a light serif, a line, three facts (start, length, seat) and the mint button «Claim your seat», switched off. Frost comes down from the top: a jagged mint front that moves on and leaves an icy pane behind it, its crystals catching the light and the card behind it only bent and blurred. In the middle the guide appears, a thin ring with a small dot that goes round in two seconds with a comet tail, then two seconds of rest, and the words «Draw a circle». The pointer wipes the glass where it passes (harder when pressed): behind it the card is sharp again, the edge of the wiped area lights up white and is ragged like the frost; then the ice closes again slowly. A well drawn circle melts the whole pane from its centre, with a white ring running out to the edges; the invitation comes alive: a mint line lights on the top edge, the lock opens and «Locked» turns into «Yours», the button lights up with a sheen crossing it. Pressed, it gives and springs back, the words become «Seat claimed» and the arrow makes way for a check. «Frost it again» grows the frost back from the top. A wrong circle makes the guide pulse once. Left alone, the pointer draws the circle, presses the button and frosts the glass again.

How it works

The frost, baked once

A first pass draws the brightness of the frost into a render target as large as the canvas: fbm with its space warped by two more fbm, squared noise ridges for the crystals and a fine grain. A second pass runs an eight sample Sobel filter over it and stores brightness and normal in the same texture. It is redone only when the size changes. The site uses a photo of frost, frost.webp; here it is procedural, so there are no images to download.

The trail at a quarter of the resolution

Every frame a small shader reads the previous trail and writes the new one into a second render target (ping-pong): the old trail times 0.97, the light around the pointer times 0.95, and a disc with a radius of 0.07 of the height, corrected for the aspect, multiplied by the contrast of the frost ((perceived brightness - 0.5) x 5) as on the site, so it wipes more where the ice is bright and the edge comes out ragged. Here the disc becomes a capsule between the last position and this one, so a quick gesture leaves no gaps.

The glass over the page

The final shader takes the card painted on a 2D canvas at half size (background, panels and every word where the browser put it), bends it with the normal of the frost (0.05) and blurs it with eight samples rotated at random per pixel, which give the grain of the glass. It mixes in the colour of the ice with a light from the top left and a few glints, and draws it with an alpha: where the trail has wiped, the alpha is zero and the real card shows, sharp, under the canvas.

The front and the melt

The growing frost uses the site’s formula: freezeVal = (1 - y) x 0.6 + brightness x 0.4, mask = 1 - smoothstep(prog - 0.35, prog, freezeVal) with prog up to 1.5, and the mint #C5FFCB on the border. The melt measures the distance from the centre of the circle, shifts its edge with the brightness of the frost and puts a white ring 4m(1 - m) on it; it runs 3.5 s power2.inOut as on the site.

The circle recognised

The points of the gesture, in half heights from the centre, go through the site’s test: at least 20 points, a mean radius of at least 0.02, the spread of the radius over the mean radius up to 0.35, at least 330 degrees turned, the last point within one mean radius of the first. With the mouse up the gesture is the movement of the last three seconds, and the pieces starting later are tried too, so a straight approach does not spoil the circle.

The comet guide and the pointer on its own

The guide is a CSS ring: the dot goes round in 2 s sine.inOut and rests 2 s, and the tail is a conic-gradient as long as it turned in the last half second, masked to a band with a radial-gradient. After a few seconds without input a GSAP timeline brings a fake pointer: it comes close, presses, draws a slightly imperfect circle through the same recognition, presses the button and frosts the glass again.

Values to change

NameFileDefaultWhat it changes
FREEZE_TIMEscript.js2.2Seconds the frost takes to grow down from the top.
TRAIL_FADEscript.js0.97How slowly the wiped trail closes, per frame at 60 fps (the site uses 0.97).
BRUSHscript.js0.07Radius of the wipe, as a share of the height (the site uses 0.07).
HOVER_WIPEscript.js1.6How hard the mouse wipes without pressing (pressing wipes at 2, as on the site).
GLOWscript.js0.8How white the edge of the wiped area lights up.
FROST_MIXscript.js0.45How much the colour of the ice covers the card behind.
BLURscript.js18Blur of the card behind the glass, in pixels.
MAX_SPREADscript.js0.35How crooked the circle may be: spread of the radius over the mean radius (the site uses 0.35).
MIN_ANGLEscript.js330Degrees the circle has to turn (the site uses 330).
MELT_TIMEscript.js3.5Seconds the glass takes to melt from the centre of the circle (the site uses 3.5).
LOOPscript.jstrueLeft alone, the pointer draws the circle, presses the button and frosts the glass again, over and over.

Try them in the Playground

When to use it

For content unlocked with a gesture: an invitation, a reserved seat, a discount code, the preview of a course, the prize of a contest, the page of an invite-only event. When opening it should be a small ritual, and the gesture (a circle, an «o») can be tied to the brand.

On phones

The same animation with adapted sizes: the card and the guide ring are measured on the height too, the radius of the wipe is a share of the height, and frost, trail and the painted card are recomputed at every resize. A finger wipes and draws the circle like a pressed mouse (touch-action: none on the stage).

With reduced motion

The glass is already open and the invitation already alive, fading in. «Frost it again» fades the frost in, already whole and still, with the guide but no turning comet; a circle fades it away. No pointer on its own.

Pitfalls

  • The shader cannot read the DOM underneath: to bend and blur the card behind the glass it has to be painted on a 2D canvas (background, panels, every word through a Range where the browser put it) and painted again when it changes, at a new size and when the glass closes.
  • The trail goes up to 2 and beyond, but an 8-bit RGBA render target stops at 1: here it is stored divided by four. And 0.97 times a small 8-bit value rounds back to the same value, so the trail would never close: a small fixed amount is taken off every frame too.
  • 0.97 per frame means one thing at 60 fps and another at 120: the factor is raised to dt x 60.
  • The site recognises the circle in NDC coordinates, which are squashed on a wide screen; here the coordinates are in half heights on both axes, so a true circle stays a circle.
  • The site has no keyboard alternative to the zero to draw: here there is an «Open the invitation» button, hidden until it gets focus.
  • On the site the light around the pointer is a full white disc; here it is a ring, or it would cover exactly what is being wiped.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Newsreader (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 16 KB; the libraries: GSAP 28 KB.

Testing

Tested on 11 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations