
The elastic button
Buttons, Hover, Text
The card to book a Reformer Pilates class at a made-up fitness studio, on white, in the style of real product interface pieces: the instructor with initials in a circle, the time, the length, the intensity in bars and the row of twelve spots, nine already taken. Pressed, Book spot narrows into a loading circle, your spot flies in an arc into the row and lights up blue, “3 spots left” rolls to “2 spots left” and the card says You’re in · Thu 18:30 with Add to calendar; when the last spots go the button turns into Join waitlist.
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>
<!--
"Gym class 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 gym class card with the spots that fill up</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 booking card of a class at a made-up studio, Tenra: Book spot narrows into a loading circle, your spot
flies into the row and lights up, the counter rolls down and the card says You're in; when the last spots
go, the button turns into Join waitlist -->
<article class="card" data-card aria-labelledby="class-name">
<span class="card__shadow" aria-hidden="true"></span>
<div class="card__body">
<span class="card__sheen" aria-hidden="true"></span>
<header class="top">
<span class="brand">
<svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M4 6.2h12M10 6.2V16"></path><path d="M6.4 3.6h7.2"></path></svg>
<span data-brand>Tenra</span><span class="brand__room">Studio B</span>
</span>
<span class="level" aria-label="Intensity 3 of 4">
<span class="level__bars" data-bars aria-hidden="true"></span>
<span class="level__word" data-levelword>Medium</span>
</span>
</header>
<h2 class="name" id="class-name" data-name>Reformer Pilates</h2>
<div class="meta">
<span class="coach">
<span class="avatar" aria-hidden="true"><span class="avatar__in" data-initials>MI</span></span>
<span class="coach__text"><b data-coach>Mara Ito</b><i>Instructor</i></span>
</span>
<span class="when">
<b data-when>Thu 18:30</b>
<i><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.6"></circle><path d="M8 5.2V8l1.9 1.3"></path></svg><span data-length>50 min</span></i>
</span>
</div>
<div class="spots">
<div class="spots__head">
<span class="count" data-count aria-live="polite"><span class="count__line" data-countline>3 spots left</span></span>
<span class="spots__total" data-total>12 reformers</span>
</div>
<div class="seats" data-seats aria-hidden="true"></div>
</div>
<div class="action" data-action>
<button class="book" type="button" data-book data-autoclic>
<span class="book__fill" data-bookfill aria-hidden="true"></span>
<span class="book__word" data-bookword>Book spot</span>
<svg class="book__spin" data-spin viewBox="0 0 24 24" aria-hidden="true"><circle class="book__track" cx="12" cy="12" r="8.5"></circle><circle class="book__arc" data-arc cx="12" cy="12" r="8.5"></circle></svg>
</button>
<button class="wait" type="button" data-wait>
<svg class="wait__bell" data-bell viewBox="0 0 20 20" aria-hidden="true"><path d="M5.6 13.6V9.2a4.4 4.4 0 0 1 8.8 0v4.4l1.2 1.4H4.4Z"></path><path d="M8.4 16.6a1.7 1.7 0 0 0 3.2 0"></path></svg>
<span class="wait__roll"><span class="wait__line" data-waitline>Join waitlist</span></span>
</button>
<div class="done" data-done>
<span class="done__ic" aria-hidden="true"><svg viewBox="0 0 24 24"><path data-check d="M7.6 12.4 10.6 15.4 16.6 9.2"></path></svg></span>
<span class="done__text">
<b data-donetitle>You're in · Thu 18:30</b>
<button class="cal" type="button" data-cal>
<svg class="cal__ic" viewBox="0 0 16 16" aria-hidden="true"><rect x="2.6" y="3.6" width="10.8" height="9.8" rx="2"></rect><path d="M2.6 6.8h10.8M5.6 2.2v2.6M10.4 2.2v2.6"></path><path class="cal__plus" data-calplus d="M8 8.4v3.4M6.3 10.1h3.4"></path><path class="cal__tick" data-caltick d="M6 10.2 7.4 11.5 10.2 8.7"></path></svg>
<span class="cal__roll"><span class="cal__line" data-calline>Add to calendar</span></span>
</button>
</span>
</div>
</div>
<span class="card__edge" aria-hidden="true"></span>
</div>
<span class="token" data-token aria-hidden="true"></span>
</article>
</main>
<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>
<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.
33 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 “Gym class card” from Animorio and fit it into my siteThe spots are equal elements in a flex with flex: 1 and a max width, so the row fills the card at every width. Each spot’s state (free, taken, yours) lives in an array and becomes a class: the CSS changes colours and outlines with a transition, GSAP only moves the spot (the squash, the bounce).
The button is centred with xPercent: -50 and its width is in pixels, taken from the row that holds it and measured again on resize: GSAP brings it to 48 pixels with power3.inOut and the loading SVG arc turns inside, with a stroke-dasharray and an endless rotation paused when it is done.
The token leaves the centre of the circle and reaches the centre of the first free spot, both measured with getBoundingClientRect in the card’s coordinates. An object with t from 0 to 1 runs along a quadratic Bézier curve with its control point above both, and every frame sets x, y, a rotation following the tangent and a scale that grows mid flight.
Every new label is a new line inside a window with overflow hidden: it comes in from below with back.out while the old one leaves upwards and is removed. The same goes for 3 spots left, Added to calendar and On the waitlist.
The autopilot alternates two rounds: in the first the pointer books and adds to the calendar, in the second the last spots fill before it arrives and the button turns into Join waitlist. At the end of each round the card goes back to the start with a fade.
| Name | File | Default | What it changes |
|---|---|---|---|
CLASS_NAME | script.js | Reformer Pilates | The name of the class. |
COACH | script.js | Mara Ito | The instructor: the avatar’s initials come from here. |
DAY_TIME | script.js | Thu 18:30 | The day and time of the class, also in You’re in. |
LENGTH | script.js | 50 min | How long the class lasts. |
SPOTS | script.js | 12 | How many spots the class has, the marks in the row. |
TAKEN | script.js | 9 | How many spots are already taken at the start. |
INTENSITY | script.js | 3 | The intensity, from 1 to 4 bars. |
ACCENT | script.js | #3d5afe | The single accent colour: your spot, the check, the loading circle. |
LOAD_TIME | script.js | 0.9 | How many seconds the loading circle turns. |
FLIGHT | script.js | 0.75 | How many seconds your spot’s flight into the row lasts. |
HOLD | script.js | 2.4 | How many seconds You’re in stays before the demo starts again. |
In the class timetable of a gym, a pilates, yoga or spinning studio, in a sports club app, on the page of a course or a workshop with few places: wherever you want to show how many spots are left and confirm the booking without leaving the page.
The card narrows to the screen width minus thirty-two pixels, the spots get narrower and shorter on their own through flex and clamp, and the button measures its width again. A finger presses like the mouse; without hover the card does not lift and the spot you would get is not outlined before the tap.
No springs, flight or rolling: the button shows the loading circle with a fade, your spot lights up in place, the labels change with a fade and You’re in arrives already drawn; the card does not lift and there is no drawn pointer.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 13 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.