
Falling tools
Physics, Hover
The rewards card of Fernhall, a made-up coffee roaster, dark on a near black page, like a Dribbble shot: every Check in drops a brushed copper token with a stamped bean through the slot of a small glass vault. The tokens are real bodies written by hand: gravity, bounces on the floor, the walls and each other, friction and rolling, and the counter rolls when a token lands, with a ring of light and a small jolt of the glass. The pointer stirs them as it passes, a tap flicks one up. On the tenth a thin streak crosses the glass, the tokens warm up and the button turns amber: Redeem splits the floor open and the tokens drop out while the number rolls back to zero.
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>
<!--
"Loyalty token card" 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 loyalty card with tokens that fall into the vault</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>
<!-- the rewards card of a made-up coffee roaster, Fernhall: every check in drops a brushed copper token through
the slot of a small glass vault. The tokens are real bodies, written by hand: gravity, bounces on the floor
and on each other, rolling spin. The pointer stirs them, a tap flicks one up. Ten tokens and the drink is
ready: Redeem opens the floor and they all drop out, the counter rolling back to zero -->
<section class="card" data-card aria-label="Fernhall rewards">
<header class="head">
<div class="brand">
<svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 3.2c3.6 2.4 5.6 5.4 5.6 9 0 3.4-2.5 6.1-5.6 6.1s-5.6-2.7-5.6-6.1c0-3.6 2-6.6 5.6-9Z"/>
<path d="M12 6.4c-1.1 2.4-1.1 5.6 0 8.8"/>
</svg>
<div class="brand__txt">
<span class="brand__name" data-brand>Fernhall</span>
<span class="brand__cat">Coffee rewards</span>
</div>
</div>
<span class="tier"><span class="tier__ring" aria-hidden="true"></span>Ember tier</span>
</header>
<div class="tally">
<p class="tally__big">
<span class="roll" data-roll aria-hidden="true"><span class="roll__n">0</span></span>
<span class="tally__of">/ 10 stamps</span>
</p>
<p class="tally__note" data-note>10 more for a free flat white</p>
</div>
<div class="vault" data-vault>
<span class="vault__glow" data-glow aria-hidden="true"></span>
<span class="vault__slot" aria-hidden="true"><span class="vault__lip"></span></span>
<div class="vault__tokens" data-tokens></div>
<span class="vault__floor" aria-hidden="true">
<span class="vault__hatch vault__hatch--l" data-hatch-l></span>
<span class="vault__hatch vault__hatch--r" data-hatch-r></span>
</span>
<span class="vault__glass" aria-hidden="true"></span>
<span class="vault__streak" data-streak aria-hidden="true"></span>
</div>
<div class="track" data-track aria-hidden="true"></div>
<button class="btn" type="button" data-btn>
<span class="btn__face" data-face>
<span class="btn__words" data-words>Check in</span>
<svg class="btn__icon" viewBox="0 0 16 16" aria-hidden="true">
<path class="btn__plus" data-plus d="M8 3.5v9M3.5 8h9"/>
<path class="btn__cup" data-cup d="M3.6 6.2h7.2v2.6a3.6 3.6 0 0 1-7.2 0Zm7.2 1h.8a1.5 1.5 0 0 1 0 3h-1.2M5.6 2.8v1.4M8 2.4v1.8"/>
</svg>
</span>
</button>
</section>
<p class="sr" aria-live="polite" data-live></p>
<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>
</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.
28 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 “Loyalty token card” from Animorio and fit it into my siteEvery token is a circle with a position, a velocity, an angle and a spin. Each frame the time is held to 1/30 s and split in three steps: gravity adds speed, a very light air drag takes some away, then the position moves on (semi-implicit Euler). Walls and floor send the speed back times BOUNCE, and under 60 px/s the bounce is switched off, so a token settles instead of trembling.
For every pair closer than two radii the circles are pushed apart along their line, three times a step; the one on the floor is heavier and moves little. Then an impulse along the normal with restitution and one along the tangent capped by Coulomb friction (FRICTION times the normal impulse), which also spins the tokens: that is how they roll off the heap.
The number goes up not on the click but when the token touches the floor or a token that has already landed: that is when the shine crosses it, the ring of light grows at the point of impact and the glass jolts (elastic.out), all scaled by the speed of the hit. The digits roll with two elements, the old one leaving upwards on power3.in and the new one coming from below on back.out.
Inside the glass the pointer is a pushing field: every token closer than 2.3 radii gets an acceleration away from it, stronger the closer it is, a little upwards, plus part of the pointer's own speed. A tap on a token gives it FLICK px/s upwards.
On the tenth token a one pixel line with an amber glow crosses the glass, the tokens take their glow one after the other and the button changes words and icon. Redeem slides the two halves of the floor aside, takes the floor out of the physics and the tokens drop out of the glass, which clips them; the number goes down with every token that leaves.
| Name | File | Default | What it changes |
|---|---|---|---|
BRAND | script.js | "Fernhall" | The name of the made-up roaster, at the top. |
GOAL | script.js | 10 | How many tokens the free coffee takes. |
GRAVITY | script.js | 1900 | Gravity in pixels per second per second. |
BOUNCE | script.js | 0.42 | How much the tokens bounce (0 none, 0.8 a lot). |
FRICTION | script.js | 0.12 | The friction between tokens and on the floor. |
STIR | script.js | 5200 | How hard the pointer stirs the tokens. |
FLICK | script.js | 620 | The upward kick of a tapped token. |
START | script.js | 4 | How many tokens are already in at the start of each round. |
SPEED | script.js | 1 | How fast the drawn pointer goes. |
LOOP | script.js | true | Left alone, the pointer does the round again and again. |
For the app or site of a coffee shop, a bakery, an ice cream parlour, a shop or a service with a points card: when stamps should feel like something you really put aside, with weight, and the reward a moment to celebrate. It also fits the jar of a savings app or the credits of any app.
The same physics with adapted sizes: the card takes almost the full width, the glass is sized on width and height and the tokens' radius on the glass, so ten always fit in two rows. With a finger a tap in the glass flicks a token and dragging stirs them.
No falls or bounces: each token fades in already in its place in the heap, the number changes without rolling, the segments fill gently, and Redeem fades the tokens away.
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 9 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.