Skip to content
animorio
IT
All components

Voice message waveform

Chat, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.3 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

26 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 “Voice message waveform” 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 a very light grey sits the white card of a chat with Junie Marsh, from the invented Larkhall venue: at the top the avatar with the initials and the phone, at the bottom the Message field with the microphone. Our black message asks «Did the venue confirm Saturday?» and under it the two violet read ticks draw themselves one after the other. The reply is a voice message in a grey bubble: the round violet button with the triangle, a wave of thirty-four grey bars, under it the time 0:14, the microphone and the white speed pill, 1x. Pressing play the triangle splits into the two pause bars, the button gives a small bounce, the microphone turns violet and the bars fill with violet from the left, each giving a small hop as the fill crosses it, while the time counts down second by second. The speed pill rolls its number up, 1.5x and then 2x, widens on a spring for the new label and makes the fill run faster. Dragging on the wave jumps forwards or backwards: the bar under the finger rises and its two neighbours a little less, and on release they drop back with a bounce. At the end the pause turns back into a triangle and under the bubble the transcript springs open, with the violet line on the left and the words rising one after another. A drawn pointer does it all by itself and starts again; it also really works, with mouse, finger and arrow keys.

How it works

Two rows of bars

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

The triangle that splits

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.

Speed on the timeScale

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.

A finger on the wave

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 that opens

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.

Values to change

NameFileDefaultWhat it changes
DURATIONscript.js14The seconds of the voice message at 1x speed.
ACCENTscript.js#6c4cf5The colour of the button, the played bars and the transcript.
BARSscript.js34How many bars the wave has.
LIFTscript.js1.5How much the bar under your finger rises while you drag.
SPRINGscript.js0.6The seconds of the spring that opens the transcript.
HOLDscript.js2.6The seconds the autopilot leaves the transcript to be read.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • Colouring the bars one by one made the fill step: with two rows and a clip-path the edge of the violet runs continuously, even inside a bar.
  • The listening tween has to be killed and created again on every drag, with the remaining duration: only resetting the position left the old tween running underneath.
  • The card has a fixed height that includes the open transcript: when it grew as it opened, the phone box shrank it halfway through listening.

Libraries

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.

Testing

Tested on 27 October 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