
The layered button
Buttons, Hover, Physics
The front-desk button of a made-up vet clinic, Fernhill Veterinary: once in the waiting room you check in from your phone. In the pine-green pill hangs the metal pet tag with an engraved paw, on its split ring. On the tap the tag swings, a lighter green fills the pill from the tag onwards while the label says Checking in Miso, then the tag flips over on its ring and the engraved check appears on its back: Miso is checked in · Room 2, with the minutes to the visit below. Another tap goes back to the start.
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>
<!--
"Vet check-in 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 Check in your pet button of a vet clinic with the pet tag that flips</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">
<!-- one gesture: check your pet in at the front desk. Pressed, the metal pet tag hanging on its split ring swings,
a lighter green fills the pill from the tag while the check-in goes through, then the tag flips over on its
ring and shows the engraved check on its back; the label says which room, the line below how long -->
<div class="frame" data-wrap>
<button class="c" type="button" data-btn data-autoclic aria-describedby="c-note">
<span class="c__skin" aria-hidden="true"></span>
<span class="c__fill" data-fill aria-hidden="true"><span class="c__edge" data-edge></span></span>
<span class="c__glow" data-glow aria-hidden="true"></span>
<span class="c__sheen" data-sheen aria-hidden="true"></span>
<span class="c__grain" aria-hidden="true"></span>
<span class="c__icon" aria-hidden="true">
<svg class="c__ring" viewBox="0 0 34 40"><path d="M17 1.4a3.4 3.4 0 1 1-3.2 2.2"></path><path class="c__ring-hi" d="M14.5 2.6a3.4 3.4 0 0 1 4.6-.6"></path></svg>
<span class="c__swing" data-swing>
<span class="c__link"></span>
<span class="c__flip" data-flip>
<span class="tag tag--front">
<span class="tag__shine" data-shine></span>
<svg class="tag__mark" viewBox="0 0 24 24"><ellipse cx="7.1" cy="9.6" rx="1.75" ry="2.25" transform="rotate(-18 7.1 9.6)"></ellipse><ellipse cx="10.6" cy="6.9" rx="1.8" ry="2.35" transform="rotate(-6 10.6 6.9)"></ellipse><ellipse cx="14.4" cy="6.9" rx="1.8" ry="2.35" transform="rotate(6 14.4 6.9)"></ellipse><ellipse cx="17.9" cy="9.6" rx="1.75" ry="2.25" transform="rotate(18 17.9 9.6)"></ellipse><path d="M12.5 11.6c2.3 0 4.6 2.6 4.6 4.8 0 1.6-1.2 2.4-2.5 2.4-.9 0-1.4-.4-2.1-.4s-1.2.4-2.1.4c-1.3 0-2.5-.8-2.5-2.4 0-2.2 2.3-4.8 4.6-4.8Z"></path></svg>
</span>
<span class="tag tag--back">
<span class="tag__shine" data-shine></span>
<svg class="tag__check" viewBox="0 0 24 24"><path data-check pathLength="100" d="M7.4 12.6l3.1 3.1 6.2-6.6"></path></svg>
</span>
</span>
</span>
</span>
<span class="c__labels" data-labels>
<span class="c__label" data-l="idle">Check in your pet</span>
<span class="c__label" data-l="wait">Checking in Miso</span>
<span class="c__label" data-l="done">Miso is checked in<span class="c__sep">·</span><span class="c__room">Room <span data-room>2</span></span></span>
</span>
</button>
<p class="note" id="c-note" aria-live="polite">
<span class="note__line" data-n="idle">Fernhill Veterinary · Front desk</span>
<span class="note__line" data-n="done">Dr. Okafor will call you in about <span data-mins>8</span> min</span>
</p>
</div>
</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
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 “Vet check-in button” from Animorio and fit it into my siteThe tag sits in a container whose rotation origin is at the top, on the ring. A damped pendulum integrated on the GSAP ticker (spring towards zero and friction, at most 1/30 of a second per step) gets a push on hover, on press, when the check-in starts and when it flips; once still, the loop writes nothing more.
One number from 0 to 1 becomes the rounded inset clip-path of the light green layer and the position of the light on its edge. A three-part timeline (power2.out to 0.58, a slow pause to 0.66, power2.in to the end) makes the wait feel real; on the way back the left side moves, so the green leaves to the right.
Two round faces with backface-visibility hidden, the back already turned 180 degrees in the CSS; GSAP turns their container with rotationY and a back.out, inside a 140-pixel perspective. The check is a path with pathLength 100 and strokeDashoffset from 100 to 0, the glint a gradient that crosses both faces.
Every label is measured twice, at wdth 100 and stretched, after the font has arrived; on hover GSAP moves the axis and the box width together, so the pill grows with the label without a jump.
| Name | File | Default | What it changes |
|---|---|---|---|
PET | script.js | "Miso" | The pet’s name, in the pill. |
ROOM | script.js | 2 | The exam room once checked in. |
MINUTES | script.js | 8 | The minutes of waiting written below. |
WAIT | script.js | 1.5 | The seconds of the check-in, while the green fills the pill. |
SWAY | script.js | 1 | How much the tag swings. |
BOUNCE | script.js | 1.4 | How much the pill and the flipping tag bounce. |
STRETCH | script.js | 112 | How much the label widens on hover, on the wdth axis. |
--pino | style.css | #10372f | The dark green of the pill. |
--salvia | style.css | #1f5c4e | The green that fills the pill during the check-in. |
--menta | style.css | #a6ecd0 | The colour of the room in the final label. |
In the app or site of a vet clinic, a groomer or a pet hotel, to check in on arrival without queueing at the desk: whoever is waiting sees the room and how long to go straight away.
The pill drops to 56 pixels and the label tightens by a point; the finger taps like the mouse. Without hover the label does not widen and the light stays off; the tag swings on the tap.
No pendulum, no flip and no movement: the green fades in, the tag shows the check already in place with a fade and the labels cross-fade; on the way back everything fades and the paw returns.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.0 KB; the libraries: GSAP 28 KB.
Tested on 16 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.