Skip to content
animorio
IT
All components

Listening ring play button

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

The row of an episode of a made-up podcast, on very light grey: a drawn cover, title, length and a round black Play button. Pressed, the triangle folds into the two bars of pause, a thin ring round the button fills with the time listened, three bars of a waveform move gently and the time left runs in equal-width digits. Holding it opens the speed picker: left on 1.5x the ring speeds up.

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>
<!--
  "Listening ring play 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 play button with a listening ring</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">
    <!-- one episode of a made-up podcast: the round play button folds into pause, a thin ring fills with the time
         listened, holding the button opens the speed picker -->
    <article class="ep" data-ep aria-label="Murmur, episode 48">
      <div class="ep__cover" aria-hidden="true">
        <span class="ep__wave"></span>
        <span class="ep__sun"></span>
        <span class="ep__mark">M</span>
      </div>

      <div class="ep__text">
        <p class="ep__show">Murmur <span>Ep. 48</span></p>
        <h1 class="ep__title">How quiet tools get built</h1>
        <p class="ep__meta">
          <span class="eq" data-eq aria-hidden="true"><i></i><i></i><i></i></span>
          <span class="ep__state" data-state>42 min</span>
          <span class="ep__left" data-left>-29:12</span>
        </p>
      </div>

      <div class="play" data-play-wrap>
        <svg class="ring" viewBox="0 0 72 72" aria-hidden="true">
          <circle class="ring__track" cx="36" cy="36" r="33"></circle>
          <circle class="ring__fill" data-ring cx="36" cy="36" r="33" pathLength="100"></circle>
        </svg>
        <button class="play__btn" type="button" data-play aria-label="Play episode" aria-pressed="false">
          <svg class="play__icon" viewBox="0 0 24 24" aria-hidden="true">
            <path data-half-a d=""></path>
            <path data-half-b d=""></path>
          </svg>
        </button>
        <span class="play__speed-tag" data-tag aria-hidden="true">1.5x</span>

        <div class="speed" data-speed role="radiogroup" aria-label="Playback speed">
          <span class="speed__pill" data-pill aria-hidden="true"></span>
          <button class="speed__opt" type="button" role="radio" data-rate="1" aria-checked="true">1x</button>
          <button class="speed__opt" type="button" role="radio" data-rate="1.5" aria-checked="false">1.5x</button>
          <button class="speed__opt" type="button" role="radio" data-rate="2" aria-checked="false">2x</button>
        </div>
      </div>
    </article>

    <p class="hint" data-hint>Hold the button to change speed</p>

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

24 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 “Listening ring play 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 a very light grey background, in the middle, the white row of an episode of the made-up podcast Murmur: a cover drawn in CSS (a violet and peach sunset, a low sun, a band of water and the M), Murmur Ep. 48, the title How quiet tools get built, the length 42 min and the time left, -29:12. On the right a round black button with the Play triangle, closed in a thin ring already a third full. A fake pointer presses it: the button sinks and springs back, the two strokes of the triangle fold into the two bars of pause, next to the length three thin waveform bars appear and move gently like sound, the label becomes Playing and the time left runs second by second in tabular digits while the ring moves on. Then the pointer holds it down: out of the top of the button slides a small black pill with 1x, 1.5x and 2x, the highlight follows the finger, left on 1.5x the ring and the seconds run faster and a 1.5x tag stays on the button. Then pause, back to 1x, and it all starts again.

How it works

A triangle made of two halves

Play is drawn as two paths of four points each: the left and right halves of the triangle. Pause is the same, two rectangles of four points. A single number from 0 to 1 blends the points of one into the other, with a sine bend that curves them halfway: that is why the strokes fold instead of fading.

The ring is a dash

The ring circle has pathLength 100, so stroke-dasharray is written straight in hundredths: the dash is what was listened to, the gap the rest. GSAP’s ticker moves it on every frame, multiplied by the chosen speed, and works out the time left.

Digits that do not wobble

The time left uses font-variant-numeric: tabular-nums: every digit has the same width, so the row does not shake when a 1 turns into a 0.

Press and hold

On pointerdown a gsap.delayedCall starts: if the finger stays down past the chosen time the speed pill opens and pointerup picks the one under the finger; if it lifts earlier it is a plain tap and toggles play and pause. On the keyboard Enter and Space play, the up arrow opens the speeds, Esc closes them.

The autopilot

A repeating timeline moves a fake pointer to positions worked out on every loop from the real sizes of the buttons; as soon as a real finger or mouse arrives the autopilot stops.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#5b5bf0The colour of the ring, the waveform and the chosen speed.
EPISODE_MINUTESscript.js42.3How long the episode lasts, in minutes.
START_ATscript.js0.31How much of the episode is already listened to at the start, from 0 to 1.
RING_SPEEDscript.js1.6How many hundredths the ring fills each second at 1x.
HOLD_TIMEscript.js0.42The seconds to hold to open the speeds.
BOUNCEscript.js1.6How much the button and the icon folds bounce.

Try them in the Playground

When to use it

For a podcast player, an episode page on a blog, a course with audio lessons, an app’s voice messages, the audio guide of a museum or a hotel.

On phones

The row narrows to 92% of the width, the cover drops to 54 pixels and the title is cut with an ellipsis if needed; the speed pill opens above the button, inwards, and never sticks out sideways. A tap does what a click does and holding a finger down opens the speeds.

With reduced motion

No bounces or waves: the triangle and pause swap with a fade, the bars stay still, the speed pill appears without sliding; the ring and the seconds still move on, because they are the data.

Pitfalls

  • Two paths with the same number of points can be blended with one formula: with a whole triangle and two rectangles the points do not match and the change breaks.
  • Without tabular-nums the time left shakes every second: Mona Sans digits have different widths.
  • Holding has to be told apart from a tap by time, not by movement: on a phone the finger always moves a few pixels.
  • The speed pill opening to the right stuck out of the box on the phone: it opens above the button, aligned to its right side.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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