
The elastic button
Buttons, Hover, Text
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.
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>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
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 sitePlay 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 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.
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.
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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #5b5bf0 | The colour of the ring, the waveform and the chosen speed. |
EPISODE_MINUTES | script.js | 42.3 | How long the episode lasts, in minutes. |
START_AT | script.js | 0.31 | How much of the episode is already listened to at the start, from 0 to 1. |
RING_SPEED | script.js | 1.6 | How many hundredths the ring fills each second at 1x. |
HOLD_TIME | script.js | 0.42 | The seconds to hold to open the speeds. |
BOUNCE | script.js | 1.6 | How much the button and the icon folds bounce. |
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.
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.
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.
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.
Tested on 25 October 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.