
The star rating
Ratings, SVG, Hover
A dark button that pairs headphones over Bluetooth: pressed, blue waves leave the Bluetooth sign and cross the pill while a stroke of light runs along the sign and the label turns to Searching. When the headphones answer, blue floods the button from the sign, the label rolls up to the headphones’ name and on the right a chip opens on a spring with the headphones and a battery that fills up to 82%. Pressed again, it lets them go.
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>
<!--
"Pair headphones button" 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 pair headphones button with Bluetooth waves and a battery that fills</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">
<!-- a pairing button: pressed, rings leave the Bluetooth sign and cross the pill while it searches; when the
headphones answer, their chip lands on the right on a spring, the pill floods with blue from the sign, the
label rolls to the device name and the small battery fills up to its level; pressed again it lets go -->
<button class="pair" type="button" aria-pressed="false" data-pair>
<span class="pair__body" aria-hidden="true">
<span class="pair__flood" data-flood></span>
<svg class="pair__rings" data-rings-box>
<circle data-ring r="10"></circle>
<circle data-ring r="10"></circle>
<circle data-ring r="10"></circle>
</svg>
<span class="pair__light"></span>
</span>
<span class="pair__edge" aria-hidden="true"></span>
<span class="sign" data-sign aria-hidden="true">
<svg viewBox="0 0 24 24">
<path class="sign__base" d="M7.2 7.4 16.6 16.2 12 20.6V3.4L16.6 7.8 7.2 16.6"></path>
<path class="sign__lit" data-sign-lit pathLength="100" d="M7.2 7.4 16.6 16.2 12 20.6V3.4L16.6 7.8 7.2 16.6"></path>
</svg>
</span>
<span class="label"><span class="label__word" data-word>Pair headphones</span></span>
<span class="device" data-device aria-hidden="true">
<svg class="device__phones" viewBox="0 0 24 24">
<path d="M5 14.5V12a7 7 0 0 1 14 0v2.5"></path>
<rect x="3.6" y="13.4" width="4" height="6.4" rx="1.8"></rect>
<rect x="16.4" y="13.4" width="4" height="6.4" rx="1.8"></rect>
</svg>
<span class="battery">
<span class="battery__cell"><span class="battery__level" data-level></span></span>
<span class="battery__tip"></span>
</span>
<span class="device__pct" data-pct>0%</span>
</span>
</button>
<p class="sr" data-live aria-live="polite"></p>
<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>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.
16 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 “Pair headphones button” from Animorio and fit it into my siteThe background, the flooding blue, the waves and the pointer light live in one layer with hidden overflow behind the content; the 1 pixel edge is a gradient cut out with a mask. That way the waves are clipped by the pill’s shape without clipping the shadow or the focus ring.
Three SVG circles centred on the sign (its position is measured with getBoundingClientRect, on resize too). A repeating timeline takes each radius from 14 pixels to the pill’s right side, offset by a third of the time, with the opacity rising fast and falling slowly.
Over the sign sits a blue copy of it with pathLength 100 and a 26 on 74 dash: moving stroke-dashoffset from 0 to 200 the stroke goes twice round the drawing while it searches.
A 560 pixel circle centred on the sign at scale 0: on the answer it goes to 1 with power3.out and covers the pill from the left. The whole button takes a scale kick to 1.025 and comes back on an elastic spring.
The chip is measured once at its natural width (with ‘100%’ inside) and kept at width 0; on the answer the width goes to the measured value with elastic.out, so the label makes room on its own. One number animated from 0 to the charge writes the percentage and scales the battery’s level.
| Name | File | Default | What it changes |
|---|---|---|---|
DEVICE | script.js | Aria Pro | The name of the headphones that answer. |
BATTERY | script.js | 82 | The headphones’ charge, from 0 to 100. |
ACCENT | script.js | #3d7bff | The colour of the waves, the lit sign and the connected button. |
SEARCH | script.js | 2.1 | How many seconds it searches before the headphones answer. |
RING | script.js | 1.25 | How many seconds a wave takes to cross the button. |
SPRING | script.js | 0.8 | How long the spring of the headphones’ chip lasts, in seconds. |
HOLD | script.js | 2.8 | How many seconds it stays connected before the pointer lets go, when left alone. |
For the settings of a music app or a system, for the page of a pair of headphones or a speaker, for any action that looks for a nearby device and then says it found it.
The same button, at most as wide as the screen minus the margins: the waves and the chip are measured again on the width. With a finger there is no hover: the touch does the press and the round.
No waves and no springs: the labels, the blue and the chip change with a fade, the battery is already at its level.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.1 KB; the libraries: GSAP 28 KB.
Tested on 13 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.