
The elastic button
Buttons, Hover, Text
The Download episode button of a podcast app, on black: a graphite pill with a cream disc and an arrow. Pressed, the episode’s waveform rises from the middle inside the pill and every bar turns to warm metal as the bytes arrive, with a head of light at the front, the ring closing around the icon and the percentage running. When the download ends the waveform packs like an accordion into the icon, which becomes an amber disc with a check, and the pill closes on a spring around Saved offline. A second tap removes the episode and the pill opens again.
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>
<!--
"Download episode 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 Download episode button with the waveform packing into the pill</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>
<!-- one gesture: saving a podcast episode offline. The episode's waveform rises inside the pill, every bar turns to
warm metal as its bytes arrive, then the whole waveform packs into the icon like an accordion and the pill
closes around Saved offline. A second press removes the download and the pill opens again -->
<button class="btn" type="button" data-btn aria-label="Download episode 48 of The Long Signal, 41 MB">
<span class="btn__body" data-body>
<span class="btn__glow" data-glow aria-hidden="true"></span>
<span class="btn__edge" aria-hidden="true"></span>
<span class="btn__sheen" data-sheen aria-hidden="true"></span>
<span class="icon" data-icon aria-hidden="true">
<span class="icon__disc" data-disc></span>
<span class="icon__disc icon__disc--fatto" data-disc-done></span>
<svg class="icon__svg" viewBox="0 0 40 40">
<circle class="ring__track" data-track cx="20" cy="20" r="18.25"></circle>
<circle class="ring__fill" data-ring cx="20" cy="20" r="18.25"></circle>
<g data-arrow>
<path class="icon__line" d="M20 12.2v12.6"></path>
<path class="icon__line" d="M15.1 20.2 20 25.1l4.9-4.9"></path>
</g>
<path class="icon__line icon__tray" data-tray d="M14 28.4h12"></path>
<path class="icon__line icon__check" data-check d="M14.2 20.6l3.9 3.9 7.8-8.4"></path>
</svg>
</span>
<span class="txt txt--rest" data-rest>
<span class="txt__main" data-rest-main>Download episode</span>
<span class="txt__meta" data-rest-meta>41 MB</span>
</span>
<canvas class="wave" data-wave aria-hidden="true"></canvas>
<span class="pct" data-pct aria-hidden="true"><span data-pct-n>0</span><span class="pct__s">%</span></span>
<span class="txt txt--done" data-done>
<span class="txt__main" data-done-main>Saved offline</span>
<span class="txt__meta" data-done-meta>Ep. 48</span>
</span>
</span>
</button>
<span class="sr" aria-live="polite" data-live></span>
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true">
<path d="M5 3.2 18.6 13l-6.1.9 3.6 6.6-2.6 1.4-3.6-6.6L5.3 19.6z"></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.
27 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 “Download episode button” from Animorio and fit it into my siteThe waveform is a canvas redrawn every frame from four numbers that GSAP moves: how far the wave is out, how much is downloaded, how packed it is and how alive it is. The bars are not page elements: the whole trick is in the function that draws them, and when nothing moves the canvas is not redrawn.
The amplitudes come from three summed sine waves taken as absolute values, with a 22% floor: it looks like the profile of a voice, it is the same at every load and no audio file is needed.
For each bar the download front gives a value from 0 to 1 that fades grey into metal; right after it passes, a damped sine swells it by 20% and brings it back, so every bar settles in its own small way. The metal is a vertical gradient with the light in the middle, and on top a bright band slides in source-atop only over the bars already downloaded.
When packing, each bar has its own timing: the farthest starts first, with a cubic acceleration, and they all reach the edge of the icon together while shortening and fading. The icon takes them with a one-pixel knock and the amber disc comes in with back.out.
The final width is measured from the Saved offline label and the episode after the font has loaded, and the pill reaches it with elastic.out set by the MOLLA knob; at the same time a pass of light crosses it diagonally.
| Name | File | Default | What it changes |
|---|---|---|---|
ETICHETTA | script.js | "Download episode" | The button label at rest. |
PESO | script.js | "41 MB" | How big the episode is, on the right. |
FATTO | script.js | "Saved offline" | The label once the episode is saved. |
EPISODIO | script.js | "Ep. 48" | The episode, next to the final label. |
DURATA | script.js | 3.4 | How long the download takes, in seconds. |
BARRE | script.js | 40 | How many bars the episode’s waveform has. |
COMPRESSIONE | script.js | 0.72 | How long the waveform takes to pack into the icon, in seconds. |
MOLLA | script.js | 0.62 | How soft the spring of the closing pill is: lower bounces more. |
ATTESA | script.js | 2.2 | How long it stays saved before the drawn pointer removes it, in seconds. |
On an episode page of a podcast app, in the track or album list of a music app, in an audiobook or course app: anywhere you save something to listen to without a connection.
The same 60-pixel pill, almost as wide as the screen, with the same animations: a tap starts the download, a tap halfway cancels it and a tap on the saved pill removes it.
No rising wave, accordion or springs: on tap the labels fade, the waveform appears whole and the bars light up in metal one after the other in colour only; at the end the pill fades to the size of Saved offline with the check already drawn. The drawn pointer does not run.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.4 KB; the libraries: GSAP 28 KB.
Tested on 10 November 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.