Skip to content
animorio
IT
All components

Frosted glass ticket

Cards, HoverGSAP, CSS onlyMediumCompressed weight: Demo 9.1 KBGSAP 28 KBFreeDownload the zip

A concert ticket in an app’s wallet, made of frosted glass on near black, with a warm light shining through the glass: the entry code is hidden under the frost, and holding the ticket clears the glass in a circle that starts from the finger, with a ring that fills and a thread of light on the edge of the frost; let go too early and the frost comes back, hold it to the end and the code lights up, the ticket’s border catches a reflection that runs round and the label becomes Ready to scan. After a few seconds the frost covers it again by itself.

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 ticket" 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 ticket that clears when you hold it</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- a concert ticket in a wallet app, made of frosted glass over a warm light: the entry code stays hidden
         under the frost, and holding the ticket clears the glass from the finger outwards until it is ready to scan -->
    <span class="orb orb--a" data-orb aria-hidden="true"></span>
    <span class="orb orb--b" data-orb aria-hidden="true"></span>

    <div class="tilt" data-tilt>
      <article class="ticket" data-ticket data-card aria-label="Concert ticket">
        <div class="ticket__glass" data-glass aria-hidden="true"></div>
        <span class="ticket__sheen" data-sheen aria-hidden="true"></span>

        <header class="ticket__head">
          <span class="brand"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.6a6.4 6.4 0 1 0 6.4 6.4"/><path d="M8 4.6a3.4 3.4 0 1 0 3.4 3.4"/></svg>Aurelle</span>
          <span class="admit">Admit one</span>
        </header>

        <div class="ticket__show">
          <h1 class="artist" data-artist>Noctra</h1>
          <p class="tour">Night Bloom Tour · The Velvet Room</p>
        </div>

        <dl class="facts">
          <div><dt>Date</dt><dd>Sat 14 Nov</dd></div>
          <div><dt>Doors</dt><dd>19:30</dd></div>
          <div><dt>Section</dt><dd>Floor GA</dd></div>
        </dl>

        <div class="perf" data-perf aria-hidden="true"></div>

        <div class="code">
          <div class="qr" data-qr>
            <span class="qr__glow" data-qrglow aria-hidden="true"></span>
            <svg class="qr__ink" data-ink viewBox="0 0 25 25" shape-rendering="crispEdges" aria-label="Entry code"></svg>
            <div class="frost" data-frost aria-hidden="true"></div>
            <div class="frost__edge" data-edge aria-hidden="true"></div>
            <svg class="hold" data-hold viewBox="0 0 40 40" aria-hidden="true"><circle class="hold__track" cx="20" cy="20" r="16"/><circle class="hold__bar" data-holdbar cx="20" cy="20" r="16"/></svg>
          </div>
          <p class="hint" aria-live="polite">
            <span class="hint__mask">
              <span class="hint__line" data-hint="hold"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.6"/><circle cx="8" cy="8" r="2"/></svg>Hold to reveal</span>
              <span class="hint__line" data-hint="ready"><svg viewBox="0 0 16 16" aria-hidden="true"><path data-check d="M3.6 8.4 6.7 11.3 12.4 5"/></svg>Ready to scan</span>
            </span>
          </p>
          <p class="serial">AUR 4K7 PX2</p>
        </div>

        <svg class="outline" data-outline aria-hidden="true">
          <defs>
            <radialGradient id="lit" data-lit gradientUnits="userSpaceOnUse" cx="0" cy="0" r="160">
              <stop offset="0" stop-color="#ffffff" stop-opacity="0.75"/>
              <stop offset="0.45" stop-color="#ffffff" stop-opacity="0.22"/>
              <stop offset="1" stop-color="#ffffff" stop-opacity="0"/>
            </radialGradient>
          </defs>
          <path class="outline__base" data-path/>
          <path class="outline__lit" data-path/>
          <path class="outline__beam outline__beam--wide" data-path data-beam/>
          <path class="outline__beam" data-path data-beam/>
          <line class="outline__perf" data-perfline/>
        </svg>
      </article>
    </div>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </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.

25 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 ticket” 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

In the middle, on a near black background, a concert ticket in frosted glass, with two notches on the sides at the height of the dashed perforation: at the top the name of the app Aurelle with a small orange mark and the Admit one pill, the name Noctra large and wide, Night Bloom Tour · The Velvet Room, and three facts, Date Sat 14 Nov, Doors 19:30, Section Floor GA. Behind the glass two warm blurred lights move slowly, showing through the ticket. Below the perforation the entry code is covered by a pale grainy frost, with Hold to reveal. The ticket tilts a few degrees towards the pointer and its border catches the light where it passes. Holding it, the ticket sinks a little, the lights behind grow, and under the finger a circle of clear glass opens with a thread of light on its edge and an orange ring that fills: the circle grows slowly, then faster. Let go halfway and the frost closes again on a spring. Held to the end, the frost disappears, the code makes a small snap and lights up with a white halo, an orange and white reflection runs round the border once, and the label rolls to Ready to scan with the checkmark drawing itself. After three seconds, or with a tap, the frost comes back from the edges and closes on the centre. The autopilot pointer passes over the ticket, presses it too briefly, then holds it to the end.

How it works

The frost and the clear circle

Over the code there is a layer with backdrop-filter: blur, a pale veil and a grain made with feTurbulence in an SVG background. Its mask is a radial-gradient transparent up to a radius and solid just beyond it: centre and radius are CSS variables the script updates every frame. A second layer with the same mask, but only on a ring, makes the thread of light on the edge.

Press and hold

On pointerdown a linear tween takes the progress from where it is to 1 in the time left; the radius grows with a power of 1.7, so at first it only opens under the finger and the end reaches the corners. On pointerup before the end the same value goes back to zero with power3.out; at 1 the confirmation starts. With setPointerCapture the finger can leave the ticket without losing hold.

The notched border and the reflection

The outline is an SVG path recalculated on resize, with rounded corners and the two semicircular notches at the height of the perforation. One copy has a radialGradient that follows the pointer, so the border catches the light where it passes; two copies with a short stroke-dasharray make the reflection, moving the stroke-dashoffset along the whole length just once.

Tilt and confirmation

The ticket rotates on X and Y with quickTo towards the pointer, with transformPerspective. On confirmation it scales to 1.006 and comes back with back.out, the code snaps from 0.985 to 1, the white halo lights up and the label leaves at the top before Ready to scan comes in.

Values to change

NameFileDefaultWhat it changes
HOLD_TIMEscript.js1.1How many seconds you have to hold to clear all the glass.
HIDE_AFTERscript.js3.2After how many seconds the glass covers the code again.
TILTscript.js6How many degrees at most the ticket tilts towards the pointer.
FROSTscript.js9How frosted the glass over the code is, in pixels of blur.
ACCENTscript.js#ff6a3dThe colour of the light behind the glass, the ring and the checkmark.
ARTISTscript.jsNoctraThe name on the ticket.

Try them in the Playground

When to use it

In the wallet of a ticketing, events or travel app, where the entry code should not be on show to everyone while you queue: it only appears when held, and people get the gesture at once because the glass clears under their finger.

On phones

The ticket is sized on the window’s height and width and stays whole in the frame; you hold it with your finger, without the system menu, and the tilt follows the point you touch.

With reduced motion

No tilt, still lights and no reflection: holding makes the frost fade instead of opening in a circle, and the code appears and disappears with a fade.

Pitfalls

  • A radial-gradient going from transparent at radius zero to solid at fourteen pixels still leaves a small soft hole in the middle: at rest the radius must be negative, so the mask is solid everywhere.
  • The frost’s backdrop-filter only blurs what lies beneath it in the same context: the code and the frost must share a container, with no opacity, filter or mask on the parents, or the frost blurs nothing.
  • Positions are taken with offsetLeft and offsetTop walking up to the ticket, not with getBoundingClientRect: with the demo scaled down or the ticket tilted the latter returns already transformed sizes.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 28 October 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 components