
The elastic button
Buttons, Hover, Text
A voice message bubble, a small audio player in a chat app, dark on black, in the style of product interface pieces: play turns into pause on a spring, the bars of the wave take the apricot one after another with a small jump, the speed pill rolls from 1x to 1.5x to 2x. The Transcript button opens the words under the wave and they light up one at a time in step with the voice, like karaoke, while a pill slides on a spring under the word being said, line after line. Tap a word and the message jumps there.
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>
<!--
"Transcribed voice message" 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 with the transcript that lights up word by word</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 voice message bubble of a messaging app: play turns into pause on a spring, the bars of the wave take the
accent as it plays, the speed pill rolls 1x, 1.5x, 2x, and Transcript opens the words below, which light up one
at a time in step with the wave while a pill slides under the word being said. Tap a word to jump there -->
<article class="voice" data-voice aria-label="Voice message from Ines Okafor">
<span class="voice__glow" data-glow aria-hidden="true"></span>
<span class="voice__grain" aria-hidden="true"></span>
<header class="voice__head">
<span class="voice__avatar" aria-hidden="true">IO</span>
<p class="voice__who"><span class="voice__name" data-sender>Ines Okafor</span><span class="voice__kind">Voice message</span></p>
<span class="voice__clock">9:41</span>
</header>
<div class="voice__row">
<button class="play" type="button" data-play aria-label="Play voice message" aria-pressed="false">
<span class="play__face" data-play-face>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path data-pp-a d=""></path>
<path data-pp-b d=""></path>
</svg>
</span>
</button>
<div class="wave" data-wave role="slider" tabindex="0" aria-label="Position in the voice message" aria-valuemin="0" aria-valuemax="12" aria-valuenow="0" aria-valuetext="0:00 of 0:12"></div>
<button class="speed" type="button" data-speed aria-label="Playback speed 1x">
<span class="speed__win" data-speed-win><span class="speed__val" data-speed-val>1x</span></span>
</button>
</div>
<div class="voice__meta">
<p class="voice__time"><span data-now>0:00</span><span class="voice__of"> / <span data-total>0:12</span></span></p>
<button class="tbtn" type="button" data-tbtn aria-expanded="false" aria-controls="transcript">
<svg class="tbtn__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 4.5h11M2.5 8h8M2.5 11.5h5.5"></path></svg>
<span class="tbtn__win"><span class="tbtn__words" data-tbtn-words>Transcript</span></span>
<svg class="tbtn__chev" data-chev viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.2 8 9.7l3.5-3.5"></path></svg>
</button>
</div>
<div class="trans" id="transcript" data-trans aria-label="Transcript" aria-hidden="true">
<div class="trans__in" data-trans-in>
<p class="trans__text" data-text>
<span class="trans__pill" data-pill aria-hidden="true"></span>
</p>
<span class="trans__sweep" data-sweep aria-hidden="true"></span>
</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>
<p class="sr" aria-live="polite" data-live></p>
</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 “Transcribed voice message” from Animorio and fit it into my siteThe text is split into words and each lasts as long as its letters, with a breath after a comma and a longer one after a full stop; everything is scaled to the message's length. So every word knows when it starts and ends, and which bars of the wave it covers.
Each bar is a slice of time: if it falls inside a word it is tall, with a hump rising and falling along the word and a little fixed randomness; if it falls in a pause it stays low. The colour along the wave goes from apricot to coral with color-mix and one variable per bar.
Time moves forward in GSAP's ticker, multiplied by the speed, with the step capped at a thirtieth of a second. On every frame a single function lights the bars already passed, picks the word being said and writes the time; when nothing moves the loop does not redraw.
The pill is a single element behind the words. On every frame it reads the position and size of the word being said (offsetLeft, offsetTop, offsetWidth) and chases them with four springs, x, y, width and height, with stiffness and damping from the values block: it slides, passes the mark by a hair and settles, even when wrapping to the next line.
Each bar that lights gets a knock on its spring and jumps; those of the word being said move on a sine wave. Play and pause are the same two quadrilaterals with their points mixed by one number, carried by back.out. At the end a tween brings the time back to zero and the same function switches everything off backwards.
| Name | File | Default | What it changes |
|---|---|---|---|
SENDER | script.js | Ines Okafor | Who sent the voice message (the avatar's initials come from here). |
MESSAGE | script.js | Hey, quick one before you head out. The table is booked for eight, under my name. Bring the blue folder and the spare charger by the window. See you there. | The words of the transcript. |
LENGTH | script.js | 12 | How long the voice message lasts at 1x, in seconds. |
BARS | script.js | 30 | How many bars the wave has. |
STIFFNESS | script.js | 380 | The spring that carries the pill from word to word: higher is quicker. |
DAMPING | script.js | 26 | Lower lets the pill pass the word and come back. |
BOUNCE | script.js | 0.5 | How much a bar jumps when it lights up. |
LIVE | script.js | 0.22 | How much the bars of the word being said move with the voice. |
LOOP | script.js | true | The drawn pointer plays it again and again. |
For a messaging or team app, customer support with voice notes, a voice memo or meeting app, an AI assistant that answers by voice: anywhere a short audio should also be readable, and tapping a word should take you to that point.
The bubble is sized with min across vw and a pixel maximum and stays low: even open, with the transcript, it fits a 341 by 410 box. With a finger you tap play, drag on the wave to move and tap a word to jump there; the preview of the bars under the pointer is only there with a mouse.
No springs, jumps or motion: play turns into pause at once, the bars and words change colour without jumping, the pill moves without sliding, the transcript opens with a fade 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 11 KB; the libraries: GSAP 28 KB.
Tested on 7 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.