Skip to content
animorio
IT
Back to the library

Boxing round timer

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

A boxing app’s round timer: the red ring drains through the round and fills back in blue through the rest, in the last ten seconds the time gains weight and colour, and at every change the bell swings and rings. A tap on the ring pauses it.

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>
<!--
  "Boxing round 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>Boxing round timer</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">
    <!-- a boxing round timer: the ring drains through the round and fills back through the rest,
         the last ten seconds weigh more, and the bell swings at every change -->
    <section class="bx" data-bx aria-label="Round timer">
      <header class="bx__head">
        <span class="bx__title">
          <b>Heavy bag</b>
          <span><span data-rounds></span> rounds, <span data-plan></span></span>
        </span>
        <span class="bx__bell" aria-hidden="true">
          <svg viewBox="0 0 30 30">
            <path class="bx__ding" data-ding pathLength="1" d="M5.500 9.500a11 11 0 0 0-1.300 7"></path>
            <path class="bx__ding" data-ding pathLength="1" d="M24.500 9.500a11 11 0 0 1 1.300 7"></path>
            <g data-bell transform="rotate(0 15 6)">
              <path d="M15 6v1.600"></path>
              <path d="M9 20.500c1.300-1.500 1.800-3.300 1.800-6a4.200 4.200 0 0 1 8.400 0c0 2.700.5 4.500 1.800 6z"></path>
              <path d="M13.300 23.200a1.800 1.800 0 0 0 3.400 0"></path>
            </g>
          </svg>
        </span>
      </header>

      <button class="bx__ring" type="button" data-ring aria-pressed="false" aria-label="Pause the timer">
        <svg viewBox="0 0 220 220" aria-hidden="true">
          <circle class="bx__track" cx="110" cy="110" r="96"></circle>
          <circle class="bx__arc" data-arc cx="110" cy="110" r="96" pathLength="1" transform="rotate(-90 110 110)"></circle>
        </svg>
        <span class="bx__mid">
          <span class="bx__roll bx__round"><span data-round></span></span>
          <b class="bx__time" data-time>0:00</b>
          <span class="bx__roll bx__state"><span data-state></span></span>
        </span>
      </button>

      <div class="bx__bars" data-bars aria-hidden="true"></div>
    </section>

    <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>
  </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.

15 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 “Boxing round 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 light paper, at the top the workout’s name with its plan (“6 rounds, 3:00 on, 1:00 off”) and on the right a bell in a white disc. In the middle a large ring: inside, “Round 3 of 6”, the time left written large with its digits in cells of one width, and under it the word “Fight”. The red arc shortens as the round goes by; in the last ten seconds the time turns red and heavier and the arc thickens. At zero the bell swings from its hook and dies down, with two small arcs drawing at its sides; the ring gives a small jolt, everything turns blue, the word rolls to “Rest” and the arc fills back through the minute of rest. Then another stroke of the bell and the next round starts. Below, one bar per round: black for those done, coloured for the running one as it fills. A tap on the ring pauses (“Paused”) and another resumes. After the last round it rings three times and starts over.

How it works

One clock, three states

Round, rest, done: the state, the round number and the seconds left advance on GSAP’s ticker and draw arc, digits, bars and words. The state’s colour lives in the --tone variable.

The arc without spinning

The ring does not rotate: it is a circle with pathLength 1 and a stroke-dasharray equal to the share left, starting at the top because the circle is turned 90 degrees once, in its attribute.

The bell from its hook

The bell swings on a damped sine written in the transform attribute, round the hook’s point in viewBox coordinates: it turns where it should, not round the middle of its bounding box.

Values to change

NameFileDefaultWhat it changes
FIGHTscript.js#df3b2cThe round’s colour.
RESTscript.js#4a6f96The rest’s colour.
ROUNDSscript.js6How many rounds the workout has.
ROUNDscript.js180How many seconds a round lasts.
BREAKscript.js60How many seconds the rest lasts.
WARNscript.js10In the last seconds of the round the time weighs more.
SPEEDscript.js22How many times faster than real the demo’s timer runs.
LOOPscript.jstrueLeft alone, a pointer pauses and resumes.

Try them in the Playground

When to use it

In the app or site of a boxing gym, a kickboxing or interval training class, on a gym’s wall screen; and wherever time goes in blocks of work and pause: the pomodoro, a presentation in turns, a cooking contest.

On phones

The same scene: the ring is also sized on the window’s height and is tapped with a thumb to pause.

With reduced motion

The timer still runs, with the digits changing in place and the arc following. The bell does not swing, the ring does not jolt and the words change without rolling.

Pitfalls

  • The workout is made up and the demo runs twenty-two times faster than real to show a round and a rest in a few seconds: in a real app SPEED is 1 and the time is worked out from the start time, not by adding frames, or it is lost when the tab goes to the background.
  • Here the bell is only seen: a real app needs the sound too, and on a phone sound only starts after a tap from the user.
  • The ring is a button with aria-pressed and a label telling round and state; the time changing every second is not in an aria-live region, which would read it non-stop.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 19 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 animations