
The star rating
Ratings, SVG, Hover
The volume control of an invented speaker app, on black, in a minimal premium control-centre style: a vertical capsule of dark glass where the filled part rises from below and its surface is a live sound wave, wider and faster the higher the volume. Drag it up and down: the capsule narrows under the finger, the grip squeezes, a trail stays behind and past the ends it stretches on an elastic; at zero the wave lies flat and the speaker mutes with a bounce, past 90% the top warms to orange.
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>
<!--
"Glass capsule 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 glass capsule volume slider with a rising wave</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 capsule of an invented speaker app: the filled part rises from the bottom and its surface is a
live sound wave, wider and faster the louder it gets; it lies flat at zero and warms up past 90% -->
<section class="unit" data-card aria-label="Living room speaker">
<div class="capsule" data-capsule role="slider" tabindex="0" aria-label="Volume" aria-orientation="vertical"
aria-valuemin="0" aria-valuemax="100" aria-valuenow="58" aria-valuetext="58%">
<div class="capsule__glass" data-glass>
<svg class="capsule__svg" data-svg aria-hidden="true">
<defs>
<linearGradient id="vol-fill" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="var(--fill-top)"></stop>
<stop offset="1" stop-color="var(--fill-low)"></stop>
</linearGradient>
<linearGradient id="vol-heat" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="0" y2="80" data-heat-grad>
<stop offset="0" stop-color="var(--heat)" stop-opacity="1"></stop><stop offset="0.35" stop-color="var(--heat)" stop-opacity="0.55"></stop>
<stop offset="1" stop-color="var(--heat)" stop-opacity="0"></stop>
</linearGradient>
</defs>
<path class="capsule__trail" data-trail></path>
<path class="capsule__fill" data-fill fill="url(#vol-fill)"></path>
<path class="capsule__heat" data-heat fill="url(#vol-heat)"></path>
<path class="capsule__crest" data-crest></path>
</svg>
<span class="capsule__sheen" aria-hidden="true"></span>
<span class="capsule__grip" data-grip aria-hidden="true"></span>
<span class="capsule__icon" data-icon aria-hidden="true">
<svg viewBox="0 0 24 24">
<path class="spk__body" d="M4 9.2h3.1L11.6 5v14l-4.5-4.2H4z"></path>
<path class="spk__arc" data-arc d="M14.3 10.1a2.6 2.6 0 0 1 0 3.8"></path>
<path class="spk__arc" data-arc d="M16.4 8a5.6 5.6 0 0 1 0 8"></path>
<path class="spk__arc" data-arc d="M18.5 5.9a8.6 8.6 0 0 1 0 12.2"></path>
<path class="spk__slash" data-slash d="M3.5 3.5l17 17"></path>
</svg>
</span>
</div>
</div>
<div class="readout">
<span class="readout__num" data-num>58%</span>
<button class="readout__room" type="button" data-mute aria-pressed="false">Sonora · Living room</button>
</div>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3l13 7.4-5.7 1.4 3.3 6.4-2.4 1.2-3.3-6.4L5.7 17z"></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.
20 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 “Glass capsule volume slider” from Animorio and fit it into my siteThe filled part is a closed SVG path, redrawn by the GSAP ticker with a point every two pixels: the crest is the sum of two sines (WAVELENGTH long and 1.73 times tighter) flowing with the phase, multiplied by an arch that lowers it at the sides. The same outline makes the crest line, the orange veil and, shifted, the trail.
The drawn volume follows the wanted one on a slightly underdamped spring (stiffness 190), the trail on a slower spring (TRAIL), the wave height on a third spring: AMP times the volume, multiplied by WIGGLE while held. The phase moves by FLOW waves per second times the volume, so at zero the wave is flat and the loop stops redrawing.
On pointerdown the point and the volume are remembered: the new volume is the starting one plus the movement divided by the height, as in control centres. What goes past the ends becomes a stretch (1 minus e to the minus 4 times the excess, at most 7%) anchored at the opposite end, and on release it comes back with elastic.out.
Past HOT a value from 0 to 1 (smoothstep) lights an orange gradient in page coordinates starting at the crest and the halo above the capsule, through a CSS variable. The speaker waves come in with a staggered back.out, the mute slash draws with stroke-dashoffset and the icon bounces with elastic.out.
| Name | File | Default | What it changes |
|---|---|---|---|
START | script.js | 58 | The starting volume, from 0 to 100. |
AMP | script.js | 7 | How high the wave rises at full volume, in pixels. |
WAVELENGTH | script.js | 46 | How long each wave is, in pixels. |
FLOW | script.js | 0.8 | How many waves flow by per second at full volume. |
WIGGLE | script.js | 1.7 | How much more it wiggles while dragged. |
HOT | script.js | 90 | From which volume the top warms to orange. |
TRAIL | script.js | 38 | The trail spring: lower leaves the trail further behind. |
STEP | script.js | 5 | How much the arrow keys move the volume. |
In the sound panel of a music or smart speaker app, in the control centre of a home dashboard, in the controls of a video player on a phone: where the volume is set with a thumb and the control should tell, at a glance, how much sound there is.
The capsule is 84 to 104 pixels wide and at most 300 pixels or 60% of the screen tall, so with the number below it fits in the phone box. With the thumb it drags as with the mouse, without scrolling the page (touch-action: none), and the drag is relative, so it can be taken anywhere.
The wave does not flow: it stays still, as high as the volume. No springs, trail, elastic or bounces: the fill goes straight where you take it, the speaker waves and the mute slash just appear; the autopilot shows the volumes one after another.
GSAP 3.15.0, Inter (font variabile) 5.2.5.
Compressed with gzip, the three demo files weigh 7.2 KB; the libraries: GSAP 28 KB.
Tested on 12 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.