Skip to content
animorio
IT
All components

Start focus button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.0 KBGSAP 28 KBFreeDownload the zip

The Start focus button of a focus app, on black: pressed, a light runs round the ring and fills it, 25:00 starts counting down with rolling digits and the button becomes Pause, with End beside it. Paused, the ring breathes once and stops; End empties it, the digits roll back up and the session is marked on the day’s bar.

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>
<!--
  "Start focus button" 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 Start focus button with a ring of time</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>
    <!-- the focus card of a made-up concentration app, on near black: a dashed ring waits with 25:00; Start focus
         fills the ring with light and the digits start rolling down; the button becomes Pause and End, a pause makes
         the ring breathe once, End empties the ring and marks the session -->
    <section class="card" data-card aria-label="Stillhour focus session">
      <header class="card__head">
        <span class="brand">
          <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10 3.2a6.8 6.8 0 1 0 6.8 6.8"></path><path d="M10 6.4V10l2.4 1.6"></path></svg>
          Stillhour
        </span>
        <span class="state" data-state><span class="state__in" data-state-text>Ready</span></span>
      </header>

      <div class="dial" data-dial>
        <svg class="ring" viewBox="0 0 220 220" aria-hidden="true">
          <defs>
            <linearGradient id="luce" x1="0" y1="0" x2="1" y2="1">
              <stop class="s1" offset="0"></stop>
              <stop class="s2" offset="1"></stop>
            </linearGradient>
          </defs>
          <g class="ticks" data-ticks></g>
          <circle class="ring__track" cx="110" cy="110" r="92"></circle>
          <circle class="ring__wait" data-wait cx="110" cy="110" r="92" pathLength="120"></circle>
          <g transform="rotate(-90 110 110)">
            <circle class="ring__glow" data-glow cx="110" cy="110" r="92" pathLength="1"></circle>
            <circle class="ring__arc" data-arc cx="110" cy="110" r="92" pathLength="1"></circle>
            <circle class="ring__head" data-head cx="110" cy="110" r="92" pathLength="1"></circle>
          </g>
        </svg>
        <div class="dial__face">
          <div class="time" data-time aria-live="off">
            <span class="dig" data-dig="600" data-base="6"></span><span class="dig" data-dig="60" data-base="10"></span><span class="colon">:</span><span class="dig" data-dig="10" data-base="6"></span><span class="dig" data-dig="1" data-base="10"></span>
          </div>
          <p class="task" data-task></p>
        </div>
      </div>

      <div class="controls" data-controls>
        <button class="pill" type="button" data-main>
          <span class="pill__sheen" aria-hidden="true"></span>
          <span class="pill__icon" aria-hidden="true">
            <svg class="ic ic--play" data-ic-play viewBox="0 0 20 20"><path d="M7 5.2v9.6l7.4-4.8Z"></path></svg>
            <svg class="ic ic--pause" data-ic-pause viewBox="0 0 20 20"><rect x="5.6" y="5" width="3" height="10" rx="1"></rect><rect x="11.4" y="5" width="3" height="10" rx="1"></rect></svg>
          </span>
          <span class="pill__label"><span class="pill__roll" data-label>Start focus</span></span>
        </button>
        <button class="end" type="button" data-end aria-label="End session">
          <svg viewBox="0 0 20 20" aria-hidden="true"><rect x="6" y="6" width="8" height="8" rx="1.6"></rect></svg>
        </button>
      </div>

      <footer class="today">
        <span class="today__label">Today</span>
        <span class="bars" data-bars>
          <i class="is-done"></i><i class="is-done"></i><i></i><i></i>
        </span>
        <span class="today__saved" data-saved>
          <svg viewBox="0 0 16 16" aria-hidden="true"><path data-check d="M3.4 8.4 6.6 11.4 12.8 4.8" pathLength="1"></path></svg>
          <span data-saved-text>Session saved</span>
        </span>
        <span class="today__total" data-total>50 min</span>
      </footer>
    </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.

23 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 “Start focus button” 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 an almost black background, in the middle, the card of the made-up app Stillhour: at the top the mark and the Ready label, in the middle a dashed ring with 25:00 inside and the session’s task, Writing the Q4 brief, below the white Start focus button with a triangle, at the bottom the Today row with four small bars, two already full, and 50 min. A fake pointer presses Start focus: the button squashes and springs back, a sheen crosses it and it turns dark reading Pause, the triangle turns into the two pause bars, and the round End button opens beside it. A blue and lilac light runs round the ring and fills it, the dashes fade, the label becomes Focusing and the time starts going down: the digits turn like an odometer, each one only when it has to change, and the arc shortens with the time left, its tip brighter and the tick under it lit. With the autopilot time runs ninety times faster. Pressed Pause, the time stops, the digits dim, the label becomes Paused and the ring swells and brightens once, then stays still and dimmer; Resume lights it again. Pressed End, the ring empties, the digits race back up to 25:00, the dashes return, the day’s third bar fills and in place of the total a drawn check and Session saved with the minutes done appear; then the total comes back, grown.

How it works

Digits like an odometer

Each digit is a strip from 0 to 9 (or 0 to 5 for the tens) sliding vertically. For each digit the time left is divided by its unit, one second, ten, sixty, six hundred: the whole part gives the digit, and only in the last fifth of a real second before the change does the strip roll to the next one. So at real speed the digits click over one at a time, and they flow smoothly when time runs fast.

The ring of light

The arc is an SVG circle with pathLength 1: the share of time left is the length of the stroke. Underneath sits a wider blurred copy, the glow, and on top a short bright stretch that sits at the tip. Of the sixty ticks, the one under the tip lights up.

The button that changes jobs

Start focus, Pause and Resume are the same button: the word leaves upwards and the new one comes in from below with a small bounce, the triangle and the two bars swap with a turn, and the fill goes from white to dark. End opens by widening from zero on a spring.

A pause that breathes once

Paused, the ring swells by 2.5% and the glow rises, then everything settles and stays still, dimmer: a single breath, never a continuous beat. The digits dim until it resumes.

The session marked

End empties the arc in eight tenths, takes the time from where it was to 25:00 with a nine-tenth run that turns every digit, fills the day’s next bar from the left and shows Session saved with a check drawing itself, before the grown total comes back. The autopilot is a single timeline; at the first real touch it stops and the button runs in real time.

Values to change

NameFileDefaultWhat it changes
MINUTESscript.js25How long a session lasts, in minutes.
SPEEDscript.js90How many times faster time runs with the autopilot (1 is real time).
TASKscript.jsWriting the Q4 briefThe session’s task, under the time.
ACCENTscript.js#8fa2ffThe first colour of the ring’s light.
ACCENT_2script.js#c99bffThe second colour of the ring’s light.
GLOWscript.js1How bright the glow around the ring gets.

Try them in the Playground

When to use it

For a focus or study app using the pomodoro method, the timer of a workout or a meditation, a meeting countdown, the time tracking of a freelancer app.

On phones

The same animation with adapted sizes: the ring is at most 40% of the height wide, the digits are sized in vh and the card fits the frame; a tap presses the button like a click.

With reduced motion

No springs, bounces, breath or sheens: the words change with a fade, the digits change without rolling and the ring fills and empties in a few tenths.

Pitfalls

  • If every digit rolls all the time, at real speed the seconds run like a tape and cannot be read: each one must turn only in the window before the change, measured in real time.
  • Time is counted on GSAP’s ticker, not the system clock: it stops with everything else when the page is paused.
  • The pause must not pulse: one breath and then still, or it turns into a beating light.
  • With pathLength on the circle no vector-effect, or the stroke draws only halfway.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 28 October 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