
The elastic button
Buttons, Hover, Text
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.
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>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
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 siteOver 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.
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 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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
HOLD_TIME | script.js | 1.1 | How many seconds you have to hold to clear all the glass. |
HIDE_AFTER | script.js | 3.2 | After how many seconds the glass covers the code again. |
TILT | script.js | 6 | How many degrees at most the ticket tilts towards the pointer. |
FROST | script.js | 9 | How frosted the glass over the code is, in pixels of blur. |
ACCENT | script.js | #ff6a3d | The colour of the light behind the glass, the ring and the checkmark. |
ARTIST | script.js | Noctra | The name on the ticket. |
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.
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.
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.
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.
Tested on 28 October 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.