Skip to content
animorio
IT
All components

Pomodoro timer

Timers, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 7.9 KBGSAP 28 KBFreeDownload the zip

“pomodoro” only found a drawn tomato ripening. The Pomodoro timer of a study app, made as a real piece of interface: a thin sixty-minute dial whose arc is the time left, dragged to pick the length in five-minute steps, mm:ss digits that roll, the four round tacks filling as you focus, and the Start pill turning into Pause as it measures the word. When the session ends the accent moves from the red of focus to the green of the short break and the ring rewinds on a spring. Minimal style, on white.

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>
<!--
  "Pomodoro 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>Pomodoro 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">
    <!-- the focus timer of a made-up study app: a thin dial of sixty minutes, the arc is the time left, drag it to
         choose the length in steps of five; four tacks for the four rounds; Focus and Short break each have their accent -->
    <section class="timer" data-timer>
      <header class="top">
        <span class="mode"><span class="mode__win"><span class="mode__txt" data-mode>Focus</span></span></span>
        <span class="round" data-round>Round 1 of 4</span>
      </header>

      <div class="dial" data-dial role="slider" tabindex="0" aria-label="Focus length" aria-valuemin="5" aria-valuemax="60" aria-valuenow="25" aria-valuetext="25 minutes">
        <svg class="dial__svg" viewBox="0 0 240 240" aria-hidden="true">
          <g class="ticks" data-ticks></g>
          <circle class="track" cx="120" cy="120" r="100"></circle>
          <circle class="arc" data-arc cx="120" cy="120" r="100" pathLength="1" transform="rotate(-90 120 120)"></circle>
          <g class="knob" data-knob>
            <circle class="knob__halo" data-halo cx="120" cy="20" r="13"></circle>
            <circle class="knob__body" cx="120" cy="20" r="7.5"></circle>
            <circle class="knob__dot" cx="120" cy="20" r="2.4"></circle>
          </g>
        </svg>
        <div class="read">
          <div class="time" data-time aria-hidden="true">
            <span class="dg" data-d="0"><span>2</span></span><span class="dg" data-d="1"><span>5</span></span><span class="colon">:</span><span class="dg" data-d="2"><span>0</span></span><span class="dg" data-d="3"><span>0</span></span>
          </div>
          <div class="sub"><span class="sub__win"><span data-sub>Drag the ring to set</span></span></div>
        </div>
      </div>

      <div class="tacks" data-tacks aria-hidden="true">
        <span class="tack"><span class="tack__fill"></span></span>
        <span class="tack"><span class="tack__fill"></span></span>
        <span class="tack"><span class="tack__fill"></span></span>
        <span class="tack"><span class="tack__fill"></span></span>
      </div>

      <div class="controls">
        <button class="round-btn" type="button" data-reset aria-label="Reset">
          <svg viewBox="0 0 24 24" data-reset-icon aria-hidden="true"><path d="M5.2 12a6.8 6.8 0 1 0 2-4.8"></path><path d="M5 4.6v3.6h3.6"></path></svg>
        </button>
        <button class="go" type="button" data-go>
          <span class="go__bg" data-go-bg aria-hidden="true"></span>
          <span class="go__in">
            <svg class="go__icon" viewBox="0 0 16 16" aria-hidden="true">
              <path class="go__play" data-play d="M5 3.4v9.2l7.4-4.6z"></path>
              <g class="go__pause" data-pause><rect x="4" y="3.4" width="2.6" height="9.2" rx="1"></rect><rect x="9.4" y="3.4" width="2.6" height="9.2" rx="1"></rect></g>
            </svg>
            <span class="go__win"><span class="go__txt" data-go-txt>Start</span></span>
          </span>
        </button>
        <button class="round-btn" type="button" data-skip aria-label="Skip to the next part">
          <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 6.5l7 5.5-7 5.5z"></path><path d="M17.5 6.5v11"></path></svg>
        </button>
      </div>
      <span class="measure" data-measure aria-hidden="true"></span>
    </section>
    <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.

23 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 “Pomodoro 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 white, a white card with a hairline shadow. Top left the mode pill, “Focus” on a red tint, on the right “Round 1 of 4”. In the middle a sixty-minute dial: sixty thin ticks, every fifth one longer, a grey track and over it the red arc of the time left, with the white knob at its tip. The ticks inside the arc take the colour. Inside, the large digits of the time, 25:00, and a small line below. Dragging on the ring picks the length in five-minute steps, from 5 to 60: the arc reaches it on a spring, the tick it lands on thickens for a moment and the digits roll up or down depending on the direction. Start: the play icon becomes pause, the pill widens to fit “Pause”, the arc begins to retract and the digits count down one second at a time; the first round tack fills with red as the time passes. Paused, the digits fade and the pill says Resume. At zero the round tack swells, a halo spreads from the knob, the mode rolls to “Short break”, the whole accent turns green and the ring rewinds to five minutes on a spring. After the break it goes back to Focus. The button on the left starts over with its arrow spinning once, the one on the right skips to the next part. In the preview time runs three minutes per second.

How it works

A single number

The arc, the knob and the lit ticks are all drawn from one number, the minutes on the sixty-minute dial: the strokeDashoffset of a circle with pathLength 1, the knob’s rotation with svgOrigin on the true centre, and the ticks below that number coloured. While time runs the number is the time left; when you drag, a spring carries it.

The angle from the centre

While dragging, the pointer’s angle from the dial centre (atan2 plus a quarter turn, because zero is at the top) becomes minutes, rounded to five and held between 5 and 60. The arrow keys step by five.

Rolling digits

Each digit sits in a window one line tall: the new one comes in from below with back.out while the old one leaves at the top, only for the digits that change. GSAP’s ticker counts the time, multiplied by SPEED in the preview.

The measured pill

Before changing word the pill measures the new word in a hidden span and widens to that size on a spring; play and pause swap by shrinking and fading.

The mode change

The accent is a CSS variable, --acc, that GSAP moves from red to green: arc, ticks, knob, mode pill and round tacks change together. The arc goes back to zero and stretches out again to the break length with back.out.

Values to change

NameFileDefaultWhat it changes
FOCUS_MINscript.js25The minutes of a focus session, between 5 and 60 in steps of 5.
BREAK_MINscript.js5The minutes of the short break.
ROUNDSscript.js4How many sessions in a round: the tacks under the ring.
SPEEDscript.js180How fast time runs in the preview: 180 means three minutes per second, 1 is real time.
SPRINGscript.js1.6How far the arc overshoots when it rewinds or snaps.
ROLL_TIMEscript.js0.42How long a digit takes to roll, in seconds.
LOOP_PAUSEscript.js1.6The pause before the self-running loop starts again, in seconds.

Try them in the Playground

When to use it

In an app for studying or deep work, in the dashboard of a productivity app, in the widget of an online course site, or anywhere a countdown set with a finger is needed.

On phones

The dial is min(232px, 46vh, 72vw), so it fits the short phone preview box with the whole card; with a finger you drag on the ring without scrolling the page (touch-action: none).

With reduced motion

No springs or rolling: the arc and the digits jump to their value, words change in place, the accent switches at once and the self-running loop doesn’t start.

Pitfalls

  • The knob turns inside the svg, so with svgOrigin “120 120”, the true centre of the viewBox: with transformOrigin it spun round its own corner.
  • GSAP rounds the strokeDashoffset of a circle with pathLength 1 to whole pixels: autoRound is off at the top of the script, otherwise the arc would be all full or all empty.
  • GSAP’s ticker counts the time, not a setInterval, so the preview bench controls it and a background tab doesn’t pile up seconds.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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