Skip to content
animorio
IT
All components

Gym class card

Cards, HoverGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a white background there is just a warm white card with round corners, a one pixel edge that catches the light on top and soft layered shadows. At the top the made-up brand Tenra with its room, on the right four intensity bars, three lit, and the word Medium; below, the name Reformer Pilates in large type, then the instructor Mara Ito with the initials MI in a sand coloured circle with a metal ring, and on the right Thu 18:30 with a drawn clock and 50 min. After a hairline comes the row of twelve spots, small reformer beds with their headrest: nine are grey, already taken, three are empty, spread along the row. Above the row “3 spots left”, below it the black Book spot button. On hover the card lifts by two pixels and its shadow widens, the bars give a little hop one after the other and, over the button, the spot you would get gets a blue outline while the label widens on the wdth axis. Pressed, the label leaves upwards and the button narrows on a spring into a circle with a blue arc turning inside; once loaded the circle squeezes and your spot leaves it, flying in an arc to the first free place, landing with a squash and lighting up blue, with a ring that spreads once and the two neighbours shifting by a pixel and settling back. Meanwhile “3 spots left” rolls to “2 spots left” and in place of the button come the blue circle with a check that draws itself, You’re in · Thu 18:30 and the Add to calendar link, which rolls into Added to calendar with a tick inside the calendar when pressed. On the next round you are too late: the last three spots fill one after the other with a bounce, the counter goes down to Class full and the button fades into the light Join waitlist pill with its bell swinging; pressed, it turns blue and says On the waitlist. A drawn pointer shows both rounds on its own and the demo starts again.

How it works

The row of spots

The 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 that becomes a circle

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 arcing flight

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.

The rolling counter

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.

Two rounds

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.

Values to change

NameFileDefaultWhat it changes
CLASS_NAMEscript.jsReformer PilatesThe name of the class.
COACHscript.jsMara ItoThe instructor: the avatar’s initials come from here.
DAY_TIMEscript.jsThu 18:30The day and time of the class, also in You’re in.
LENGTHscript.js50 minHow long the class lasts.
SPOTSscript.js12How many spots the class has, the marks in the row.
TAKENscript.js9How many spots are already taken at the start.
INTENSITYscript.js3The intensity, from 1 to 4 bars.
ACCENTscript.js#3d5afeThe single accent colour: your spot, the check, the loading circle.
LOAD_TIMEscript.js0.9How many seconds the loading circle turns.
FLIGHTscript.js0.75How many seconds your spot’s flight into the row lasts.
HOLDscript.js2.4How many seconds You’re in stays before the demo starts again.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • A percentage width does not animate well to and from a 48 pixel circle: GSAP does not read percentages back from the CSS. The full width is measured on the row in pixels and again on resize while the button is at rest.
  • The button is centred with GSAP’s xPercent rather than a CSS transform, which GSAP’s inline transform would have wiped at the first squeeze.
  • fromTo tweens placed later in the timeline applied their start value at once and You’re in showed up empty too early: they all have immediateRender: false.
  • The flying token lives in the card, not in the row, which is shorter than the flight: start and end points are both measured against the card at the moment of the flight, so they hold after a resize too.

Libraries

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.

Testing

Tested on 13 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components