Skip to content
animorio
IT
All components

Transcribed voice message

Players, Text, HoverGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On black there is a single voice message from Ines Okafor, in a dark layered bubble with its bottom left corner tighter, as in chats: at the top the avatar with the initials, the name and the time; below, the round play button in an apricot to coral gradient, the wave of thirty bars and the speed pill; below that the time, 0:00 of 0:12, and the Transcript button. Pressing play the two halves of the triangle become the two bars of pause, with a small twist backwards and a spring, and a warm glow wakes up behind the bubble. The bars take the colour one after another, from the first to the last, and each gives a small jump as it lights; those of the word being said turn almost white and move with the voice. The speed pill, pressed, sends the number out at the top and brings the new one in from below, widens as much as it needs and from 1.5x takes the accent colour. Transcript turns its little chevron, changes its label to Hide and opens the transcript under the wave on a spring: the words rise in a row, a light crosses it once, then the words already said are white, those to come are grey, and an apricot pill slides on a spring under the word being said, from one line to the next too. Hovering a word lights the bars of the wave where you would land; tapping it the message jumps there and plays. At the end pause turns back into play and the wave rewinds by itself, right to left. There is no sound: the time is a clock of its own. Left alone, a drawn pointer plays the message, opens the transcript, speeds it up, jumps back to a word, speeds up again and closes it; it also really works with mouse, finger and keyboard.

How it works

Words have a time

The 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.

A wave drawn by the words

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.

A clock without sound

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 on four springs

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.

Jumps, springs and the rewind

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.

Values to change

NameFileDefaultWhat it changes
SENDERscript.jsInes OkaforWho sent the voice message (the avatar's initials come from here).
MESSAGEscript.jsHey, 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.
LENGTHscript.js12How long the voice message lasts at 1x, in seconds.
BARSscript.js30How many bars the wave has.
STIFFNESSscript.js380The spring that carries the pill from word to word: higher is quicker.
DAMPINGscript.js26Lower lets the pill pass the word and come back.
BOUNCEscript.js0.5How much a bar jumps when it lights up.
LIVEscript.js0.22How much the bars of the word being said move with the voice.
LOOPscript.jstrueThe drawn pointer plays it again and again.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • With the word being said heavier, the text widened again at every word and the lines wrapped somewhere else: the word being said only changes colour, never weight or width.
  • The pill read with getBoundingClientRect also followed the words as they rose during the opening: offsetLeft and offsetTop give the place in the text, without the transforms.
  • With the rewind at the end the pill raced backwards over every word: while rewinding the pill fades out and no word is the one being said.
  • The autopilot waits for the end of the message by pausing its timeline and resuming when the wave has rewound, instead of counting seconds: changing the speed or length never throws it off.

Libraries

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.

Testing

Tested on 7 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components