
The elastic button
Buttons, Hover, Text
The Add to Wallet button of a festival app, in black lacquer on a dark velvet stage, like a Dribbble shot. On hover the ticket peeks out of the slit on the edge of the pill; pressed, it is pulled out of it: a holographic card with the concert’s name, the date, the row, the seat and a QR code, with an iridescent sheen and a tilt that follow the pointer. Then the stub folds in half along the perforation, the folded ticket lifts, drops into a small wallet pocket that takes it with a spring, the counter goes from 2 to 3 and the pill settles on Added · Gate B opens 19:00.
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>
<!--
"Add to Wallet button" 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 Add to Wallet button with the concert ticket that folds into its pocket</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">
<!-- the Add to Wallet button of a festival app on a dark velvet stage. Pressed, the ticket is pulled out of the
pill: a foil card with the event, the date, the row, the seat and a QR code, whose holographic sheen follows
the pointer. It folds in half along its perforation and drops into a small wallet pocket that takes it with a
spring; then the pill settles on Added · Gate B opens 19:00 -->
<div class="fit" data-fit>
<div class="aw" data-aw>
<span class="aw__spill" data-spill aria-hidden="true"></span>
<!-- everything above the middle of the pill: the ticket comes out of the pill through this window -->
<div class="aw__clip" aria-hidden="true">
<div class="aw__space">
<div class="pk" data-pocket>
<span class="pk__back"></span>
<span class="pk__pass pk__pass--a"><span class="pk__pass-band"></span></span>
<span class="pk__pass pk__pass--b"><span class="pk__pass-band"></span></span>
</div>
<div class="tk" data-tk>
<div class="tk__half tk__main" data-main>
<span class="tk__foil" data-foil></span>
<span class="tk__crease" data-crease></span>
<span class="tk__brand">SALTMOON</span>
<span class="tk__event">Live at Harbour Arena</span>
<span class="tk__date"><b>SAT</b> 12 JUN</span>
<span class="tk__meta">Doors 19:00 · Gate B</span>
<svg class="tk__wave" viewBox="0 0 96 14"><path d="M0 7c6 0 6-5 12-5s6 10 12 10 6-10 12-10 6 10 12 10 6-10 12-10 6 10 12 10 6-5 12-5"/></svg>
</div>
<div class="tk__half tk__stub" data-stub>
<span class="tk__foil" data-foil></span>
<span class="tk__perf"></span>
<span class="tk__qr"><svg viewBox="0 0 25 25" data-qr><rect class="tk__qr-bg" width="25" height="25" rx="2.4"/><path data-qr-path/></svg></span>
<span class="tk__seat">
<span><i>Row</i><b>12</b></span>
<span><i>Seat</i><b>24</b></span>
</span>
</div>
<div class="tk__half tk__back" data-back>
<span class="tk__foil tk__foil--strong" data-foil></span>
<span class="tk__back-mark">SALTMOON</span>
<span class="tk__back-line">Admit one · Block C</span>
<svg class="tk__back-moon" viewBox="0 0 40 40"><circle cx="20" cy="20" r="13"/><circle cx="20" cy="20" r="17.5"/></svg>
</div>
</div>
<div class="pk__front" data-front>
<span class="pk__stitch"></span>
<span class="pk__glint" data-glint></span>
<span class="pk__label">
<svg viewBox="0 0 16 16"><rect x="1.6" y="3.4" width="12.8" height="9.6" rx="2.4"/><path d="M1.6 6.4h12.8"/><path d="M10.4 9.6h1.6"/></svg>
Wallet
</span>
<span class="pk__count"><span class="pk__digit" data-digit><span>2</span><span>3</span></span><span class="pk__count-word">passes</span></span>
</div>
</div>
</div>
<button class="aw__btn" type="button" data-btn data-autoclic aria-label="Add the Saltmoon ticket to Wallet">
<span class="aw__body" data-body>
<span class="aw__fill" aria-hidden="true"></span>
<span class="aw__shine" data-shine aria-hidden="true"></span>
<span class="aw__sweep" aria-hidden="true"><span class="aw__sweep-band" data-sweep></span></span>
<span class="aw__edge" aria-hidden="true"></span>
<span class="aw__slit" data-slit aria-hidden="true"></span>
<span class="aw__row">
<span class="aw__disc" data-disc aria-hidden="true">
<span class="aw__plate" data-plate></span>
<svg class="aw__icon" data-icon viewBox="0 0 24 24">
<path d="M5 8.2c0-1 .8-1.8 1.8-1.8h10.4c1 0 1.8.8 1.8 1.8v1.4a2.4 2.4 0 0 0 0 4.8v1.4c0 1-.8 1.8-1.8 1.8H6.8c-1 0-1.8-.8-1.8-1.8v-1.4a2.4 2.4 0 0 0 0-4.8z"/>
<path class="aw__icon-perf" d="M14.2 7.6v8.8"/>
</svg>
<svg class="aw__tick" data-tick viewBox="0 0 24 24"><path data-tick-path d="M7 12.4l3.3 3.2L17.2 8.6" pathLength="1"/></svg>
</span>
<span class="aw__text" aria-hidden="true">
<span class="aw__state" data-state>
<span class="aw__title">Add to Wallet</span>
<span class="aw__sub">Saltmoon Live · Sat 12 Jun</span>
</span>
<span class="aw__state" data-state>
<span class="aw__title aw__title--busy" data-busy>Adding to Wallet</span>
<span class="aw__sub">Folding your ticket</span>
</span>
<span class="aw__state" data-state>
<span class="aw__title">Added <span class="aw__title-soft">· Gate B opens 19:00</span></span>
<span class="aw__sub">Block C · Row 12 · Seat 24</span>
</span>
</span>
</span>
</span>
</button>
</div>
</div>
<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>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
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 “Add to Wallet button” from Animorio and fit it into my sitePocket and ticket live in a window with overflow hidden that ends exactly at the middle of the pill, and the pill sits above the window. The ticket starts with its top edge right on that line: rising, it comes out of the edge of the pill, and whatever is still below never shows, with no mask to animate.
The fold is two flat faces, each with its own perspective (transformPerspective) and no preserve-3d: the stub turns to -90 degrees on its left edge, then its back, a third face lying on the left half, starts at 90 degrees on its right edge and lays down to 0. DOM order decides which one is on top, so there is no flicker between two coinciding planes; a dark gradient on the half underneath makes the shadow of the fold.
The two halves of the ticket share the same background, 200% wide (one shows its left side, the other its right) and a holographic foil as wide as the whole ticket, shifted by -100% in the stub: so glow and rainbow pass over the perforation with no seam. The notches of the perforation are two radial gradients in each half’s mask, and the shadow is a drop-shadow on the container, which follows the notches.
An object H with the pointer’s position on the ticket (in percent) is driven by gsap.quickTo: it writes three CSS variables (the rainbow band, the spot of light) and the tilt, rotationX and rotationY, multiplied by a factor GSAP brings to 1 while the ticket is out and to 0 when it drops into the pocket. Without a real pointer, one pass of light runs over the foil by itself.
The back of the pocket and the two passes sit under the ticket, the leather front above it: on the way up the ticket passes in front of everything, and once it is higher than the pocket its z-index drops by two and it falls behind the front. On arrival the leather squashes from its bottom edge for 80 thousandths and comes back with elastic.out, and the counter is a column of two digits in a window one line tall.
| Name | File | Default | What it changes |
|---|---|---|---|
EVENT | script.js | SALTMOON | The festival’s name, on the ticket and on its back. |
GATE | script.js | Gate B opens 19:00 | What the pill says after Added. |
ROW | script.js | 12 | The row on the ticket. |
SEAT | script.js | 24 | The seat on the ticket. |
PULL | script.js | 0.95 | How many seconds the ticket takes to come out of the pill. |
FOLD | script.js | 0.6 | How many seconds the ticket takes to fold along the perforation. |
SHEEN | script.js | 1 | How strong the holographic foil is: 0 off, 1.6 very bright. |
TILT | script.js | 7 | How many degrees the ticket tilts towards the pointer. |
SPRING | script.js | 1 | How springy the moves are: 0.4 calm, 2 very bouncy. |
HOLD | script.js | 3 | In the loop, how many seconds it stays on Added before going back to rest. |
AUTO | script.js | true | The button goes round by itself until someone touches it. |
For the app or site of a festival, a concert, a theatre or a club, an online box office or the confirmation page after a purchase: it says the ticket goes into the phone’s wallet, shows what is on it (date, row, seat, QR) and confirms when the gates open.
On the phone the whole piece (ticket, pocket and pill) scales down together as much as it needs to fit the screen, in width and in height; there is no hover, so the light turns on under the finger and the holographic sheen follows the finger as it moves on the screen.
Nothing moves: the ticket fades in above the pocket, the stub gives way to its back with a fade, then the ticket appears already in the pocket; the labels, the counter and the tick change in place, with no tilt.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP 28 KB.
Tested on 4 November 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.