Skip to content
animorio
IT
All components

Wave volume slider

Sliders, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 6.5 KBGSAP 28 KBFreeDownload the zip

The volume slider of a music player, on black, in the style of one-gesture micro-interactions: the filled part of the track is not a bar but a thin flowing wave that rises with the volume, wiggles more while you drag it and lies down flat when the sound reaches zero. The speaker lights from one to three arcs, crosses out on mute, and on a second tap the volume springs back to where it was; the number shows above the knob only while you hold it.

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>
<!--
  "Wave volume slider" 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 volume slider whose wave rises with the sound</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/inter@5.2.5/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the volume row of a music player: the filled part of the track is a thin wave that grows with the volume,
         wiggles while you drag it and lies down flat at zero; the speaker mutes and unmutes with a spring -->
    <section class="player" data-card aria-label="Now playing">
      <div class="track-info">
        <span class="cover" aria-hidden="true"><span class="cover__sun"></span><span class="cover__sea"></span></span>
        <span class="meta">
          <span class="meta__title">Low Tide Hours</span>
          <span class="meta__artist">Maren Holt · Driftwave</span>
        </span>
      </div>

      <div class="volume">
        <button class="speaker" type="button" data-speaker aria-label="Mute" aria-pressed="false">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <path class="speaker__body" d="M4 9.2h3.1L11.6 5v14l-4.5-4.2H4z"></path>
            <path class="speaker__arc" data-arc d="M14.3 10.1a2.6 2.6 0 0 1 0 3.8"></path>
            <path class="speaker__arc" data-arc d="M16.4 8a5.6 5.6 0 0 1 0 8"></path>
            <path class="speaker__arc" data-arc d="M18.5 5.9a8.6 8.6 0 0 1 0 12.2"></path>
            <g class="speaker__x" data-x><path d="M15.2 9.6l4.8 4.8"></path><path d="M20 9.6l-4.8 4.8"></path></g>
          </svg>
        </button>

        <div class="rail" data-rail role="slider" tabindex="0" aria-label="Volume" aria-valuemin="0" aria-valuemax="100" aria-valuenow="55">
          <svg class="rail__svg" data-svg aria-hidden="true">
            <path class="rail__rest" data-rest></path>
            <path class="rail__glow" data-glow></path>
            <path class="rail__wave" data-wave></path>
          </svg>
          <span class="knob" data-knob><span class="knob__dot"></span></span>
          <span class="bubble" data-bubble aria-hidden="true"><span data-num>55</span></span>
        </div>
      </div>
    </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.

17 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 “Wave volume slider” 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 dark card from an invented music player: the cover with a green sun over the sea, the title Low Tide Hours, Maren Holt · Driftwave, and below it the volume row, with the speaker on the left and the track on the right. The filled part of the track, from the start to the white knob, is a thin wave that flows slowly by itself; the rest is a grey line. The higher the volume, the higher the wave, and it swells and settles on a soft spring. Take the knob: it widens into a small pill, a bubble with the volume number appears above it, the wave wiggles faster and higher and a faint green glow lights up under it; dragging fast, the wave shivers with a second, tighter wave. Let go, the knob turns round again, the bubble leaves after a moment and the wave calms down. The speaker shows one arc below 34, two up to 67 and three above, and the arcs come in one after another with a small bounce; at zero the arcs leave, an X appears and the wave lies down into a straight line. A tap on the speaker mutes, a second tap brings the volume back to where it was on a spring that overshoots and returns. The autopilot pointer raises the volume, holds it and makes it wiggle, lowers it, mutes, unmutes and takes the knob back to where it started.

How it works

The wave drawn every frame

The filled stroke is an SVG path rebuilt on every tick of the GSAP ticker, one point every pixel and a half from the start to the knob: a sine WAVELENGTH pixels long that flows with its phase, multiplied by an envelope that grows it out of the start and lays it down over the last twelve pixels before the knob, so the knob always sits on a still line.

The height on a spring

The wave height is AMP times the volume, but it does not follow it at once: it is a spring (stiffness 140, damping 14) that makes the wave swell and settle. While the knob is held a value from 0 to 1 rises towards 1 and multiplies height and speed by WIGGLE; from the knob’s speed comes a second, tighter wave that makes the stroke shiver.

The arcs and mute

The speaker arcs are three paths that come in with a staggered back.out when the volume passes the thresholds, and the X arrives at zero. Mute remembers the volume before and takes it to zero with power3.out; the second tap brings it back with elastic.out(1, BOUNCE), and the drawing follows the value a touch behind.

The bubble and the knob

On touch the knob widens into a pill (scaleX 1.55) and the bubble with the number comes in with back.out from below; let go, the knob turns round again on an elastic spring and the bubble leaves after 0.35 seconds. With the keyboard the arrows move the volume by STEP.

Values to change

NameFileDefaultWhat it changes
STARTscript.js55The starting volume, from 0 to 100.
AMPscript.js5How high the wave rises at full volume, in pixels.
WAVELENGTHscript.js18How long each wave is, in pixels.
FLOWscript.js0.9How many waves flow by per second with the track at rest.
WIGGLEscript.js1.6How much more it wiggles while dragged.
BOUNCEscript.js0.55The spring of the volume coming back after mute: lower bounces more.
STEPscript.js5How much the arrow keys move the volume.

Try them in the Playground

When to use it

In the player of a music or podcast app, in video controls, in the sound panel of a system or a smart speaker: anywhere the volume is set and the control should tell, at a glance, how much sound there is.

On phones

The card is at most 380 pixels or 88% of the screen wide, and short, so it sits easily in the phone box. With a finger the knob drags as with the mouse, without scrolling the page (touch-action: none on the track), and the track is 36 pixels tall so it is easy to catch.

With reduced motion

The wave does not flow or wiggle: it stays still, as high as the volume. No springs or bounces: the knob goes where you take it, the arcs and the bubble fade in and mute is immediate; the autopilot shows the volumes one after another.

Pitfalls

  • If the wave reaches the knob at full height, the knob jumps up and down: the envelope lays it down over the last twelve pixels, so the line under the knob is still.
  • The drawn volume follows the wanted one a touch behind: without it, on touch the knob jumps to the touched point and the wave breaks.
  • Without touch-action: none on the track a phone takes the drag as a scroll and sends pointercancel halfway.

Libraries

GSAP 3.15.0, Inter (font variabile) 5.2.5.

Compressed with gzip, the three demo files weigh 6.5 KB; the libraries: GSAP 28 KB.

Testing

Tested on 29 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