Skip to content
animorio
IT
Back to the library

Exploded headphones

3D, Hover, WebGLGSAP, WebGL, CanvasAdvancedCompressed weight: Demo 13 KBGSAP 28 KBThree.js + RoomEnvironment 176 KBFreeDownload the zip

The product page of a made-up audio maker, in Three.js and in the clean style of product pieces: a pair of over-ear headphones, matte sand plastic, brushed aluminium, leather and knit, that come apart in an exploded view as far as you drag, with thin callouts on every part, and when let go snap back together on a spring with a click.

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>
<!--
  "Exploded headphones" 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>Koto K1 · Over-ear headphones</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">
  <script type="importmap">
    { "imports": {
      "three": "https://cdn.jsdelivr.net/npm/three@0.178.0/build/three.module.min.js",
      "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.178.0/examples/jsm/"
    } }
  </script>
</head>
<body>
  <!-- the product page of a made-up audio maker, Koto: a pair of over-ear headphones drawn in 3D. Drag anywhere and
       they come apart in an exploded view, as far as you pull: the headband lifts, the sliders slide out of the yokes,
       and every ear cup opens along its own axis (touch cap, shell, driver, acoustic mesh, ear cushion), with thin
       callouts on the parts. Let go and they snap back together on a spring, with a small click -->
  <main class="palco" data-palco>
    <canvas class="tela" data-tela role="img" aria-label="A pair of over-ear headphones that come apart in an exploded view as you drag"></canvas>
    <svg class="fili" data-fili aria-hidden="true"></svg>
    <div class="etichette" data-etichette aria-hidden="true"></div>

    <header class="testata">
      <p class="marchio">
        <svg viewBox="0 0 32 32" aria-hidden="true"><path d="M6 19v-3a10 10 0 0 1 20 0v3"/><rect x="4" y="18" width="6" height="9" rx="2.4"/><rect x="22" y="18" width="6" height="9" rx="2.4"/></svg>
        <span data-marchio>Koto</span>
      </p>
      <p class="modello"><b data-modello>K1</b> <span>Over-ear, wireless</span></p>
    </header>

    <div class="piede" data-piede>
      <p class="invito" data-invito>
        <svg viewBox="0 0 40 16" aria-hidden="true"><path d="M3 8h34M9 3 3 8l6 5M31 3l6 5-6 5"/></svg>
        <span>Drag to take them apart</span>
      </p>
      <div class="misura" data-misura aria-hidden="true">
        <span class="misura-nome">Assembled</span>
        <span class="binario"><i data-pieno></i><b data-tacca></b></span>
        <span class="misura-nome">Apart <em data-cento>0%</em></span>
      </div>
    </div>

    <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3l13 8.2-5.6 1.2 3.4 6.6-2.6 1.3-3.3-6.7L5 17.6z"/></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script type="module" 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.

21 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 “Exploded headphones” 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 light, warm grey background there is a pair of over-ear headphones drawn in 3D, seen three quarters on: the knit-wrapped headband with the leather cushion under it and its blue stitching, the brushed aluminium sliders with eleven engraved stops and the side letter, the yokes holding the ear cups, the sand-coloured plastic shells with the charging port, and outside the aluminium touch cap with the engraved brand and a blue line. On opening they rise and settle on a spring, and a pill invites you to drag. Drag anywhere and the headphones come apart as far as you pull: the headband lifts, its cushion stops halfway, the sliders come out of the yokes, and every ear cup opens along its own axis, the cap and the shell outward, inward the driver with its paper cone, the iridescent dome, the magnet and the copper coil, then the acoustic mesh and the leather cushion with the side letter. Pull past the full pull and the parts stretch a little more, like rubber. While you pull the headphones turn a little, the drivers swivel to show their cones and every part floats on its own; beside each part there is a small blue cross and a thin line drawing itself out to the callout. At the bottom a thin track fills with blue next to the percentage. Let go and the parts come back together on a spring, go a hair too far and bump: the cushions squash, the driver domes shiver and a soft light flares for a moment. A drawn pointer takes hold of the headphones, pulls, holds and lets go, then starts again; a real touch stops it.

How it works

Headphones made of simple shapes

Everything is Three.js geometry built in code: the headband and the yokes are half tori (TorusGeometry with half an arc), the shells and the driver cones are turned profiles (LatheGeometry), the cushions are squashed tori, the sliders and the caps boxes with rounded edges. Each ear cup is a stack of parts on the x axis.

Materials painted in a canvas

The light comes from a fake room (RoomEnvironment), which makes the aluminium reflect. The plastic grain, the leather, the knit, the straight brushing of the sliders and the circular one of the caps, the mesh, the cone and the L and R letters are textures painted in a 2D canvas, painted again once the variable font arrives.

The drag becomes a number

The distance between the point you pressed and the finger, divided by a third of the screen, gives how far apart they are, from 0 to 1; past 1 it grows ever more slowly up to 1.2, like rubber. Every part has its own direction: its position is where it starts plus the direction times that number, plus a small float on its own sine.

The spring and the click

The number does not jump: it chases its target with a hand-written spring (velocity, stiffness, damping), stiff while held and soft when let go, so it returns to zero going a hair below. When it gets there the parts bump: the cushions squash, the domes shiver and a PointLight flares for eight tenths of a second.

The callouts and the pointer

Each callout has a point on its part, taken into the world (localToWorld) and onto the screen (project): there a cross and a line growing out to the words, which push each other so they never overlap. The drawn pointer is a GSAP timeline that calls the same functions as a real finger: press, move, let go.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js'Koto'The brand on the touch caps and at the top of the page.
SPREADscript.js1How far the parts move apart at a full pull.
PULLscript.js1How far you drag for a full pull (1 = a third of the screen).
SPRINGscript.js1How springy the return is when you let go.
TILTscript.js1How much the drag turns the headphones.
FLOATscript.js1How much each part floats on its own while they are apart.

Try them in the Playground

When to use it

For the product page or the hero of an audio brand, an electronics shop or any product made of parts (headphones, a speaker, a controller, an appliance), when you want people to touch how it is made instead of scrolling through it.

On phones

The same animation with adapted sizes: the camera pulls back as far as needed so that even apart they fit in the box, a finger drags in any direction and the callouts keep only the name of the part.

With reduced motion

No motion: the headphones are already apart and still, with the callouts, and the drawn pointer is not there.

Pitfalls

  • The stage has touch-action: none, otherwise on the phone the finger scrolls the page instead of taking the headphones apart; and setPointerCapture keeps the drag even when the finger leaves the stage.
  • The return is a hand-written spring, not a tween: a tween would start over on every new touch, while the spring carries on from its current velocity, even if you grab the headphones halfway back.
  • Canvas-painted textures must be marked sRGB, otherwise colour management washes them out; the ones with lettering are painted again once the font has loaded.

Libraries

Three.js 0.178.0, GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 13 KB; the libraries: GSAP 28 KB, Three.js + RoomEnvironment 176 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 animations