
The elastic button
Buttons, Hover, Text
A chat voice message, in the style of real product interface pieces, on white with a single violet: the play triangle splits into the two pause bars, the waveform bars fill with violet as it plays and the time counts down, the speed pill rolls from 1x to 1.5x to 2x and makes the fill run faster, dragging on the wave lifts the bar under your finger, and at the end the transcript opens under the bubble on a spring.
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>
<!--
"Voice message waveform" 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 voice message whose waveform fills as it plays</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>
<!-- a chat with one voice message: the drawn play turns into pause, the waveform bars fill with the accent as it plays,
the time counts down, the speed pill rolls 1x, 1.5x, 2x, you can scrub on the wave, and at the end the transcript opens below -->
<section class="chat" data-chat aria-label="Chat with Junie Marsh">
<header class="chat__head">
<span class="avatar" aria-hidden="true">JM</span>
<div class="chat__who">
<p class="chat__name">Junie Marsh</p>
<p class="chat__role">Larkhall venue</p>
</div>
<svg class="chat__call" viewBox="0 0 24 24" aria-hidden="true"><path d="M6.6 3.8h2.6l1.5 3.9-2 1.3a10.4 10.4 0 0 0 6.3 6.3l1.3-2 3.9 1.5v2.6a2 2 0 0 1-2.2 2A16.6 16.6 0 0 1 4.6 6a2 2 0 0 1 2-2.2Z"></path></svg>
</header>
<div class="chat__body">
<div class="msg msg--out">
<p class="bubble bubble--out">Did the venue confirm Saturday?</p>
<p class="msg__meta">9:41
<svg class="ticks" viewBox="0 0 22 12" aria-label="Read"><path data-tick d="M1.5 6.5 4.6 9.6 10.8 2.6"></path><path data-tick d="M8.2 8.4 9.4 9.6 15.6 2.6"></path></svg>
</p>
</div>
<div class="msg msg--in">
<div class="voice" data-voice>
<button class="play" type="button" data-play aria-label="Play voice message">
<svg viewBox="0 0 24 24" aria-hidden="true">
<path data-left d="M7.5 4.6 L12.6 8.1 L12.6 15.9 L7.5 19.4 Z"></path>
<path data-right d="M12.6 8.1 L18.4 12 L18.4 12 L12.6 15.9 Z"></path>
</svg>
</button>
<div class="voice__main">
<div class="wave" data-wave role="slider" aria-label="Position" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" tabindex="0">
<div class="wave__row wave__row--base" data-base></div>
<div class="wave__row wave__row--fill" data-fill></div>
</div>
<div class="voice__meta">
<span class="voice__time" data-time>0:14</span>
<svg class="voice__mic" data-mic viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="3" width="6" height="11" rx="3"></rect><path d="M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21"></path></svg>
<button class="speed" type="button" data-speed aria-label="Playback speed">
<span class="speed__win"><span class="speed__val" data-speed-val>1x</span></span>
</button>
</div>
</div>
</div>
<div class="trans" data-trans aria-live="polite">
<div class="trans__in" data-trans-in>
<p class="trans__label">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 7h14M5 12h10M5 17h7"></path></svg>
Transcript
</p>
<p class="trans__text" data-trans-text>Yes, Saturday is confirmed. Doors at seven, sound check at five, and the back room is yours until midnight.</p>
</div>
</div>
<p class="msg__meta msg__meta--in">9:43</p>
</div>
</div>
<footer class="chat__foot">
<p class="compose">Message</p>
<span class="compose__mic" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="9" y="3" width="6" height="11" rx="3"></rect><path d="M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21"></path></svg></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>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.
26 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 “Voice message waveform” from Animorio and fit it into my siteThe wave is the same bars twice, a grey row underneath and a violet one on top. The violet row only needs an inset clip-path opening from the left with the progress: the fill even cuts through the middle of a bar, as smooth as a real player.
Play is two four-point paths: the left and the right half of the triangle. GSAP animates the d attribute towards the two pause rectangles, with the same number of points, so the shape folds without a plugin.
Listening is a GSAP tween on a number from 0 to 1, as long as the voice message. The pill only changes its timeScale: at 2x the same tween runs twice as fast, and the countdown stays right without recomputing anything.
Pressing on the wave stops the tween, the progress follows the finger and the bars take a height scale by distance: 1.5 for the one under the finger, less for its two neighbours. On release they go back to 1 with elastic.out and, if it was playing, the tween starts again from there.
The transcript sits in a container of zero height: at the end the content is measured and the height goes there with back.out, then the words, each in its own span, rise seven pixels with a 28 millisecond stagger.
| Name | File | Default | What it changes |
|---|---|---|---|
DURATION | script.js | 14 | The seconds of the voice message at 1x speed. |
ACCENT | script.js | #6c4cf5 | The colour of the button, the played bars and the transcript. |
BARS | script.js | 34 | How many bars the wave has. |
LIFT | script.js | 1.5 | How much the bar under your finger rises while you drag. |
SPRING | script.js | 0.6 | The seconds of the spring that opens the transcript. |
HOLD | script.js | 2.6 | The seconds the autopilot leaves the transcript to be read. |
For a messaging or customer support app, a service’s chat, the voice notes of a team or events app, anywhere a short audio is played with its transcript.
The card takes the width of the box and a fixed height that already holds the open transcript, so nothing shifts; the bars stay two and a half pixels wide and move closer together, the button stays at 36 pixels, easy for a finger, and on the wave the finger drags just like the mouse.
No bounces or hops: play changes shape at once, the bars fill without rising, the speed changes without rolling, the transcript fades in and the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.3 KB; the libraries: GSAP 28 KB.
Tested on 27 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.