Skip to content
animorio
IT
All components

Gym busy times

Charts, SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.1 KBGSAP 28 KBFreeDownload the zip

How crowded the gym is, in a card on white: the people in right now, whether it is a quiet or a busy moment, and the curve of the whole day from six in the morning to ten at night, with a mark on the present hour. Moving along the curve a point follows it and below you read the hour, the level and how many people to expect. Changing day reshapes the curve, one hour after the other.

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 busy times" 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>Gym busy times</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">
    <!-- how busy a gym is: the people in right now, the curve of the day changing shape with the day picked,
         the mark of the present hour on the curve and the hour pointed at with its level -->
    <section class="gb" data-gb aria-label="Busy times">
      <header class="gb__head"><strong>Busy times</strong><span class="gb__now"><span data-outnow>Quiet now</span></span></header>
      <div class="gb__hero">
        <span class="gb__num" data-outpeople>36</span>
        <span class="gb__what"><b>of <span data-outcap>120</span> people</b><span><span data-outfull>30</span>% full right now</span></span>
      </div>
      <div class="gb__seg" role="group" aria-label="Day" data-seg>
        <i class="gb__pick" data-pick aria-hidden="true"></i>
        <button type="button" class="gb__opt" data-day="0"><span>Today</span></button>
        <button type="button" class="gb__opt" data-day="1"><span>Tomorrow</span></button>
        <button type="button" class="gb__opt" data-day="2"><span>Saturday</span></button>
      </div>
      <div class="gb__chart" data-chart tabindex="0" role="slider" aria-label="Hour of the day" aria-valuemin="6" aria-valuemax="22" aria-valuenow="14">
        <svg class="gb__svg" data-svg aria-hidden="true">
          <defs><linearGradient id="gb-fade" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="var(--accent)" stop-opacity="0.28"></stop><stop offset="1" stop-color="var(--accent)" stop-opacity="0"></stop></linearGradient></defs>
          <line class="base" data-base></line>
          <path class="area" data-area></path>
          <path class="curve" data-curve></path>
          <g class="nowmark" data-nowmark><line data-nowline></line><circle data-nowdot r="4.5"></circle></g>
          <g class="probe" data-probe><line data-probeline></line><circle data-probedot r="5"></circle></g>
          <g class="ticks" data-ticks></g>
        </svg>
      </div>
      <p class="gb__note"><span class="gb__clip"><span data-outnote>Peak around 7 pm. Quietest at 6 am.</span></span></p>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></path></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>

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.

24 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 busy times” 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 white, a rounded card: “Busy times” and on the right, in green, “Quiet now”. Below, in large type, “36”, and beside it “of 120 people” with “30% full right now”. Then three options in a row, “Today”, “Tomorrow” and “Saturday”. Under them, the violet curve of the day, with a shade fading down to the baseline and the hours written at the bottom: low in the early morning, a first crest at eight, the peak at seven in the evening. On the present hour sits a white ring with a dark edge and a dashed line going down. At the bottom a light grey box: “Peak around 7 pm. Quietest at 6 am.”. On entering the curve rises from the ground and the number counts. Moving the pointer onto the curve brings up a violet line with a point that stays on the curve, in half-hour steps, and the box says “6:30 pm · Busy · about 107 people”. Picking “Saturday” slides the tile, the mark of the present hour disappears and the curve reshapes from left to right, its peak moving to eleven in the morning.

How it works

Seventeen numbers

For every day, how full it is in percent at each hour from six to twenty-two. Between one hour and the next the level follows a cosine, so the curve has no corners.

The curve is redrawn

The path is rewritten from those numbers, a point every seven and a half minutes, on the width it finds. The area under it is the same path closed on the baseline.

The point stays on the curve

The hour pointed at and the present one use the same function as the path, so the two rings sit exactly on the line, even while the curve changes.

Changing day

Each of the seventeen numbers goes to its new value a little after the one before: the change runs along the curve.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#6a4cf5The colour of the curve and of the hour pointed at.
CAPscript.js120How many people the gym holds.
NOWscript.js14.5What time it is in the demo, in hours: 14.5 is half past two in the afternoon.
MORPHscript.js0.8How many seconds the curve takes to reshape when the day changes.
LOOPscript.jstrueLeft alone, the demo’s pointer runs along the curve, changes day and starts again.

Try them in the Playground

When to use it

In the app of a gym, a pool or a study room, to choose when to go; and on the page of a shop, a museum or a public office. The same curve with its following point carries a home’s consumption through the day, a site’s traffic or the price of energy hour by hour.

On phones

The card is at most 348 pixels wide and about 310 tall, and narrows with the screen: the curve is redrawn on the width it finds. On a phone you slide a finger along the curve, and the page underneath still scrolls vertically. The day options are 32 pixels tall.

With reduced motion

No rising and no reshaping curve: it is in place at once, the number is already the right one, and on changing day the new shape appears in one step. The point on the hour pointed at moves without gliding. The demo’s pointer does not start.

Pitfalls

  • The chart is also a slider: it takes focus, the arrows move the hour by half an hour and aria-valuetext gives hour, level and people. Without that, keyboard users only see a drawing.
  • The level is written in words (“Quiet”, “Steady”, “Busy”) and not left to colour.
  • The present hour in the demo is fixed, so the preview is always the same; in a real product it is the venue’s time, and the head count comes from the turnstiles.
  • The curve is in pixels on the card’s width: on resize it is redrawn, hour labels included.
  • Capacity, head counts and patterns are invented.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 7.1 KB; the libraries: GSAP 28 KB.

Testing

Tested on 30 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