
The elastic button
Buttons, Hover, Text
The Listen button under an article, with a single gesture: pressed, it squeezes, the label leaves and the pill stretches into a small audio player, with a pause button, a row of bars moving with the voice, the time left and the speed. In the text above, a soft marker follows the word being read. The X folds it back into the pill.
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>
<!--
"Listen button with player" 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 Listen button that opens into a small audio player</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- one gesture: press. Under an essay, a Listen pill. Pressed, it squeezes, the label leaves and the pill
stretches into a small player: pause, a row of level bars that move with the voice, the time left and the
speed. In the text above, a soft marker follows the word being read -->
<article class="post" aria-label="Essay">
<p class="post__kicker">Fieldnote · Essay</p>
<h1 class="post__title">Why the best tools feel quiet</h1>
<p class="post__text" data-text>A good tool never asks for your attention. It waits on the desk, does one thing well, and lets you forget it is there until the work is done.</p>
<div class="post__foot">
<span class="post__meta">By Ines Calder</span>
<div class="listen" data-listen>
<span class="listen__bg" data-bg aria-hidden="true"></span>
<button class="listen__open" type="button" data-open aria-label="Listen to this essay, 6 minutes">
<svg class="ico ico--phones" viewBox="0 0 24 24" aria-hidden="true">
<path d="M4.5 15v-3a7.5 7.5 0 0 1 15 0v3"></path>
<rect x="3.5" y="14" width="4" height="6" rx="1.6"></rect>
<rect x="16.5" y="14" width="4" height="6" rx="1.6"></rect>
</svg>
<span class="listen__word">Listen</span>
<span class="listen__dur">6 min</span>
</button>
<div class="player" data-player hidden>
<button class="player__toggle" type="button" data-toggle aria-label="Pause">
<svg class="ico ico--pause" data-ico-pause viewBox="0 0 24 24" aria-hidden="true">
<rect x="6.5" y="5.5" width="3.6" height="13" rx="1.2"></rect>
<rect x="13.9" y="5.5" width="3.6" height="13" rx="1.2"></rect>
</svg>
<svg class="ico ico--play" data-ico-play viewBox="0 0 24 24" aria-hidden="true">
<path d="M8 5.6v12.8a.9.9 0 0 0 1.37.77l10.2-6.4a.9.9 0 0 0 0-1.54L9.37 4.83A.9.9 0 0 0 8 5.6Z"></path>
</svg>
</button>
<span class="player__bars" data-bars aria-hidden="true"></span>
<span class="player__time" data-time aria-live="off">-6:12</span>
<button class="player__speed" type="button" data-speed aria-label="Playback speed 1x">
<span class="speed__win"><span class="speed__lab" data-speed-lab>1x</span></span>
</button>
<button class="player__close" type="button" data-close aria-label="Close player">
<svg class="ico ico--close" viewBox="0 0 24 24" aria-hidden="true">
<path d="M7 7l10 10M17 7 7 17"></path>
</svg>
</button>
</div>
</div>
</div>
</article>
<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.
23 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 “Listen button with player” from Animorio and fit it into my siteThe headphones and the two words rise 8 pixels and fade in 0.16 seconds, one after the other; only then does the pill go from the width of Listen to the width of the player, both measured for real, with back.out.
Every bar has its own height, taken from a profile that looks like a spoken sentence, and its own pace: on every frame the height swings between 55 and 100 per cent of that base. One single number, the level, takes all the bars from rest to motion and back.
The paragraph is split into words; a rounded rectangle behind the text takes the position and size of the word being read and slides onto it in 0.28 seconds with power3.out. It moves on at 2.6 words a second, times the speed.
Pause and play never cross: one shrinks and fades, then the other arrives with back.out. The same for the speed: 1x goes up out of its window before 1.5x comes in from below.
On the X the player’s pieces shrink from right to left and the pill narrows together with them; Listen comes back when the pill is almost at its size.
| Name | File | Default | What it changes |
|---|---|---|---|
MINUTES | script.js | 6.2 | How long the reading of the article lasts, in minutes. |
BARS | script.js | 18 | How many level bars the player has. |
WORDS_PER_SEC | script.js | 2.6 | How many words a second the marker follows at 1x speed. |
OPEN | script.js | 0.55 | How long the pill takes to open into the player, in seconds. |
SQUEEZE | script.js | 0.95 | How much the button squeezes when pressed (1 = not at all). |
LIVELY | script.js | 1 | How much the bars move with the voice (0 = still). |
ACCENT | script.js | #2f54eb | The player colour: the button, the bars already heard and the marker. |
Under the articles of a blog, a magazine or a newspaper you can listen to, in newsletters read aloud, in reading apps and on sites with text to speech: anywhere a long text can also be heard.
The same animations, with the pill moving under the byline when the screen is narrow; a finger presses like the mouse and the player’s buttons are big enough to tap.
No squeezes, stretches or moving bars: the pill changes face with a fade, the bars stay still at their height, the marker jumps from word to word and the time still goes down. The drawn pointer does not run.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Newsreader (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.6 KB; the libraries: GSAP 28 KB.
Tested on 29 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.