
Falling tools
Physics, Hover
Tossup, a small made-up app that settles things with a coin: tap it and the brass coin rises spinning, slows as it falls, bounces twice, wobbles on its edge and settles on Heads or Tails, its shadow shrinking and growing underneath. The result writes itself letter by letter and the tally rolls. Hand-written physics, minimal style, GSAP.
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>
<!--
"Coin flip" 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>Coin flip</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/jetbrains-mono@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Tossup, a small made-up app that settles things with a coin: the coin rises spinning, falls, bounces twice,
wobbles on its edge and settles on Heads or Tails; the result writes itself and the tally rolls -->
<main class="stage">
<section class="app" aria-label="Tossup, a coin flip">
<header class="head">
<p class="brand">Tossup</p>
<h1 class="question">Who picks the film tonight?</h1>
</header>
<div class="arena" data-arena>
<div class="shadow" data-shadow aria-hidden="true"></div>
<div class="tilt" data-tilt>
<div class="lift" data-lift>
<button class="coin" type="button" data-coin aria-label="Flip the coin">
<span class="coin__rim" data-rim aria-hidden="true"></span>
<span class="coin__face" data-face aria-hidden="true">
<svg viewBox="0 0 200 200">
<defs>
<radialGradient id="brass" cx="38%" cy="32%" r="78%">
<stop offset="0" stop-color="var(--brass-hi)" />
<stop offset=".55" stop-color="var(--brass)" />
<stop offset="1" stop-color="var(--brass-lo)" />
</radialGradient>
<linearGradient id="sheen" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#fff" stop-opacity="0" />
<stop offset=".5" stop-color="#fff" stop-opacity=".55" />
<stop offset="1" stop-color="#fff" stop-opacity="0" />
</linearGradient>
<clipPath id="disc"><circle cx="100" cy="100" r="97" /></clipPath>
</defs>
<circle cx="100" cy="100" r="98" fill="var(--brass-lo)" />
<g data-knurl></g>
<circle cx="100" cy="100" r="86" fill="url(#brass)" />
<circle cx="100" cy="100" r="79" fill="none" stroke="var(--brass-lo)" stroke-opacity=".55" stroke-width="1.2" />
<circle cx="100" cy="100.8" r="79" fill="none" stroke="#fff" stroke-opacity=".35" stroke-width=".8" />
<g class="side" data-heads>
<g class="relief">
<g transform="translate(100 86)">
<circle r="17" fill="none" stroke="var(--brass-lo)" stroke-width="4" transform="translate(.9 1.1)" opacity=".5" />
<circle r="17" fill="none" stroke="var(--brass-deep)" stroke-width="4" />
<g data-rays stroke="var(--brass-deep)" stroke-width="4" stroke-linecap="round"></g>
</g>
<text x="100" y="140" text-anchor="middle" class="coin__word">HEADS</text>
</g>
</g>
<g class="side" data-tails>
<g class="relief">
<path d="M112 62 a28 28 0 1 0 0 48 a22 22 0 1 1 0 -48 z" transform="translate(.9 1.1)" fill="var(--brass-lo)" opacity=".5" />
<path d="M112 62 a28 28 0 1 0 0 48 a22 22 0 1 1 0 -48 z" fill="var(--brass-deep)" />
<text x="100" y="140" text-anchor="middle" class="coin__word">TAILS</text>
</g>
</g>
<g clip-path="url(#disc)"><rect data-sheen x="-20" y="-40" width="240" height="70" fill="url(#sheen)" /></g>
</svg>
</span>
</button>
</div>
</div>
</div>
<div class="result" aria-live="polite">
<p class="result__word" data-word>Tap the coin</p>
<p class="result__note" data-note> </p>
</div>
<p class="tally" data-tally aria-label="Tally">
<span>Heads <span class="num" data-count="heads"></span></span>
<span class="tally__sep" aria-hidden="true"></span>
<span>Tails <span class="num" data-count="tails"></span></span>
</p>
</section>
</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.
24 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Coin flip” from Animorio and fit it into my siteThe coin turns about the horizontal axis with a phase: the face’s scaleY is the absolute cosine, never below 0.04, and when the cosine is negative the other face shows. Under the face sits a darker disc, the rim, offset by the sine times the thickness: halfway through the spin you see the edge.
Height is a parabola, 4u(1−u), and the phase heads for its target on an ease-out: the spin slows by itself. The target is always a whole number of turns plus half a turn if the face must change, so the coin lands square on the result chosen in advance.
Two lower bounces, the second a third of the first, with the phase swinging a little around the target; then the wobble on the edge, a sine damped by e to the −5.5t on the phase and the rotation. On every impact the coin squashes for a moment on an elastic spring.
The shadow is a soft ellipse that shrinks and fades with height; the sheen is a light band clipped to the disc that slides with the sine of the phase.
Everything moves on gsap.ticker, the result writes itself by counting letters and the self-flip is a delayedCall: no setTimeout.
| Name | File | Default | What it changes |
|---|---|---|---|
SPEED | script.js | 1 | Speed of the whole toss. |
SPINS | script.js | 4 | Whole turns in the air. |
AIR | script.js | 1.15 | Seconds in the air. |
HEIGHT | script.js | 0.82 | How high it goes, as a share of the room above the coin. |
BOUNCE | script.js | 0.12 | Height of the first bounce. |
WOBBLE | script.js | 0.55 | How much it wobbles on its edge. |
TILT | script.js | 7 | Degrees of lean towards the pointer. |
HOLD | script.js | 2.2 | Seconds held before it flips by itself. |
For an app that helps you decide, a game, a draw, an event page with a small prize or a light moment inside a product.
The same coin, sized on the screen height; a tap makes the toss.
No flight and no bounces: the face changes with a fade and the result appears.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.0 KB; the libraries: GSAP 28 KB.
Tested on 1 December 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.
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.