Skip to content
animorio
IT
All components

Gym rest timer

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

The rest between sets widget of a strength training app, a smoked glass card on a near black page, like a Dribbble shot. Log set logs the set: its capsule fills on a spring, the volume of the day rolls up and the card turns into the rest, with the time rolling in digit by digit and the ticks of the dial lighting up in amber. The time goes down on its reels, the ticks go out with it chased by an arc of light, the heart rate comes down; plus 15 and minus 15 change the rest on a spring, in the last seconds the amber turns lime and at zero the card swells by a hair: your set.

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 rest timer" 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 rest timer with the set that logs itself</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" data-stage>
    <span class="stage__glow stage__glow--warm" data-glow-warm aria-hidden="true"></span>
    <span class="stage__glow stage__glow--go" data-glow-go aria-hidden="true"></span>

    <!-- the rest timer widget of a strength training app: a card of smoked glass. On top the exercise and the sets of
         it as small capsules; in the middle a dial of thin ticks around the weight of the next set or, while resting,
         the time left with digits that roll; under it the heart rate coming down and the volume of the day; at the
         bottom minus 15, the main button and plus 15 -->
    <article class="rest" data-card aria-label="Rest timer">
      <span class="rest__edge" aria-hidden="true"></span>
      <span class="rest__grain" aria-hidden="true"></span>

      <header class="rest__head">
        <div class="rest__titles">
          <p class="rest__day" data-day>Push day</p>
          <h2 class="rest__ex"><span class="rest__ex-in" data-ex>Bench press</span></h2>
        </div>
        <div class="rest__sets" data-sets aria-label="Sets"></div>
      </header>

      <div class="rest__dial" data-dial>
        <svg class="rest__glowarc" viewBox="0 0 220 220" aria-hidden="true">
          <path data-glowarc pathLength="1" d=""/>
        </svg>
        <svg class="rest__ticks" viewBox="0 0 220 220" aria-hidden="true">
          <g data-ticks-off></g>
          <g data-ticks-on></g>
          <line class="rest__lead" data-lead x1="110" y1="4" x2="110" y2="22"/>
        </svg>

        <div class="rest__center">
          <p class="rest__label"><span data-label>Your set</span></p>
          <div class="rest__big">
            <p class="rest__weight" data-weight><span class="rest__kg" data-kg>80</span><span class="rest__unit">kg</span></p>
            <p class="rest__time" data-time aria-hidden="true"></p>
          </div>
          <p class="rest__sub"><span data-sub>8 reps · RPE 8</span></p>
        </div>
      </div>

      <div class="rest__meta">
        <span class="rest__stat">
          <svg class="rest__heart" data-heart viewBox="0 0 16 16" aria-hidden="true"><path d="M8 13.4S2.2 9.9 2.2 6.1A2.9 2.9 0 0 1 8 4.6a2.9 2.9 0 0 1 5.8 1.5c0 3.8-5.8 7.3-5.8 7.3z"/></svg>
          <span class="rest__num" data-hr>128</span><span class="rest__small">bpm</span>
        </span>
        <span class="rest__stat rest__stat--right">
          <span class="rest__small">Volume</span><span class="rest__num" data-vol>1,280</span><span class="rest__small">kg</span>
        </span>
      </div>

      <footer class="rest__actions">
        <button class="rest__side" type="button" data-minus aria-label="Take 15 seconds off the rest" disabled>
          <span class="rest__side-face" data-face>
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8"/></svg>
            <span data-step-a>15</span>
          </span>
        </button>
        <button class="rest__main" type="button" data-main data-autoclic>
          <span class="rest__main-face" data-face>
            <span class="rest__main-shine" data-shine aria-hidden="true"></span>
            <svg class="rest__main-icon" viewBox="0 0 16 16" aria-hidden="true">
              <path class="rest__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
              <path class="rest__skip" data-skip d="M4 4.2L7.8 8 4 11.8M8.6 4.2L12.4 8 8.6 11.8"/>
            </svg>
            <span class="rest__main-words"><span data-words>Log set</span></span>
          </span>
        </button>
        <button class="rest__side" type="button" data-plus aria-label="Add 15 seconds to the rest" disabled>
          <span class="rest__side-face" data-face>
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8M8 4v8"/></svg>
            <span data-step-b>15</span>
          </span>
        </button>
      </footer>
    </article>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

39 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 rest timer” 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 near black page, with a soft lime light behind it that the glass blurs, a smoked glass card with very round corners rises: its edge is a one pixel line of light, brighter at the top left and tinted with the colour of the moment at the bottom, and over it lies a very fine grain. On top Push day and the exercise, Bench press, and on the right the sets as four capsules: two full, the third outlined in lime. In the middle a dial of 48 thin ticks, open at the bottom, around the weight of the set, 80 kg, with Your set over it and 8 reps · RPE 8 under it; below, the heart rate with a small drawn heart beating with the rate and the volume of the day in kilos; at the bottom minus 15, the light Log set button and plus 15, turned off. Pressing Log set the button gives and springs back, a check draws itself inside and a reflection crosses it; the third capsule fills with a bounce and the volume rolls up. The weight slips up and blurs, in its place the time 1:00 comes in digit by digit from its reels, the label turns into Rest with Next · 80 kg × 8 under it, the button into Skip rest with two chevrons; the colour turns amber, the light behind the glass warms up and the ticks light up one after the other, with a blurred arc of light under them and a longer white tick at their head. The time goes down on the reels and the ticks go out with it, the arc chasing them on a spring; the heart rate comes down from 146 towards 104. Halfway plus 15 is pressed: the digits roll back up with a bounce, the time swells a little and the ticks light again. In the last seconds the amber turns lime, and at zero the time gives way to the weight, the card swells by a hair and springs back, the ticks flash and go out from the end, the next capsule takes the outline. After the last set of an exercise the next one comes in, Incline press, and the capsules empty from the right. Until someone touches it, the widget trains by itself.

How it works

Glass in layers

The card has a translucent fill with backdrop-filter: blur and saturate, over two blurred lights of the page (amber and lime) of which GSAP moves only the opacity; the edge is a span with a gradient and the content-box mask in xor, so a one pixel line remains that takes the colour of the moment from the --acc variable, tweened by GSAP as a colour.

The dial of ticks

The 48 ticks are SVG lines made by the script, rotated over 300 degrees around the centre, in two copies: the grey ones that are off and over them the lit ones in the --acc colour. A value f between 0 and 1 lights the first f×47 ticks, with the boundary tick at half opacity; an arc with pathLength 1 and stroke-dasharray f, blurred by CSS, makes the light under them.

The spring that chases the time

The real time is rem, going down in requestAnimationFrame at SPEED times real; the dial does not follow it at once but on a damped spring (stiffness, friction, step capped at 1/30 s), so at the start of the rest the ticks light up in a row and with plus 15 they climb back with a small overshoot.

Digits on reels

Each digit is a reel with the numbers 0 to 9 in a column inside a window 1em tall; every second GSAP brings the column to yPercent −10×digit with a back.out, and only the reels whose digit changes move. A gradient mask fades the top and bottom of the window.

The states

Set and rest swap weight and time in the same grid cell (opacity, y, scale and blur), the words with a small roll; the main button changes from Log set with the check to Skip rest with the two chevrons, minus and plus light up only during the rest. After the last set the next exercise comes in and the capsules empty from the right.

Values to change

NameFileDefaultWhat it changes
DAYscript.jsPush dayThe workout, over the exercise.
EXERCISESscript.jsBench press 80 kg × 8, Incline press 32 kg × 10, Cable fly 18 kg × 12The exercises, one after the other, with weight and reps.
SETSscript.js4How many sets each exercise has.
RESTscript.js60The rest between two sets, in seconds.
STEPscript.js15The seconds that minus and plus take off or add.
SPEEDscript.js6How much faster than real the demo time runs (1 = real seconds).
TICKSscript.js48How many ticks the dial has.
SPRINGscript.js1How springy the moves are: 0.4 calm, 2 very bouncy.
AUTOscript.jstrueThe widget trains by itself until someone touches it.

Try them in the Playground

When to use it

For a strength training app, a fitness app or a gym dashboard: the rest between sets, but also the rest between the intervals of a run, a break in a class or any countdown that gets longer and shorter with two buttons.

On phones

On the phone the card is at most 86% of the screen wide and the dial is sized on both width and height; the buttons are 46 pixels tall, easy for the thumb, and nothing depends on hover.

With reduced motion

Nothing moves or swells: weight and time swap with a fade, the digits change in place, the ticks follow the time without a spring and the colours change slowly.

Pitfalls

  • With tabular-nums Mona Sans takes its tabular figures with a footed one, which look like another typeface: each reel has a fixed width of 0.6em with the digit centred instead.
  • The dial followed the time at once and plus 15 looked like a jump: now a damped spring chases it, with the step capped at 1/30 s so it does not blow up after a background tab.
  • The loop started when the script was read, and the poster landed on different moments: it starts from the load event and after the fonts.
  • The lit ticks were redrawn every frame even when still: they are redrawn only when the value changes by at least half a thousandth.

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 3 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