Skip to content
animorio
IT
All components

DJ set mini player

Players, HoverCanvas, GSAP, CSS onlyMediumCompressed weight: Demo 8.8 KBGSAP 28 KBFreeDownload the zip

The mini player of a club's live stream while the DJ moves from one record to the next: a dark smoked glass card with two scrolling waveforms, deck A above the line and deck B below it, and a real crossfader to drag. Everything follows the fader: the height of the waves, the title and the cover dissolving with a touch of blur, the BPM sliding from one record to the other, the light under the card and the edge taking the colour of what you hear.

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>
<!--
  "DJ set mini player" 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 DJ set mini player with the crossfader</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">
    <!-- the mini player of a club's live stream: the DJ is mixing from one record into the next. Two waveforms (deck A
         above the line, deck B below) scroll past the playhead, the crossfader moves between them and everything
         follows it: the height of each wave, the title, the cover, the tempo and the colour of the light -->
    <div class="mix" data-mix data-inquadra>
      <span class="mix__glow" data-glow aria-hidden="true"></span>
      <article class="mix__card" data-card aria-label="Live DJ set player">
        <span class="mix__grain" aria-hidden="true"></span>
        <span class="mix__sheen" aria-hidden="true"></span>

        <header class="mix__head">
          <span class="mix__live">
            <svg class="mix__eq" viewBox="0 0 12 12" aria-hidden="true">
              <rect data-eq x="1" y="2" width="2" height="9" rx="1"/>
              <rect data-eq x="5" y="2" width="2" height="9" rx="1"/>
              <rect data-eq x="9" y="2" width="2" height="9" rx="1"/>
            </svg>
            Live
          </span>
          <span class="mix__room">Halde Club, Room Two</span>
          <span class="mix__clock" data-clock>1:12:48</span>
        </header>

        <div class="mix__now">
          <div class="mix__art" aria-hidden="true">
            <span class="mix__cover" data-cover="0"></span>
            <span class="mix__cover" data-cover="1"></span>
          </div>
          <div class="mix__titles" aria-live="polite">
            <div class="mix__track" data-track="0"><b data-title>Low Tide Signal</b><span data-artist>Sable Noor</span></div>
            <div class="mix__track" data-track="1"><b data-title>Glasshouse</b><span data-artist>Ono Vale</span></div>
          </div>
          <div class="mix__bpm"><b data-bpm>124.0</b><span>BPM</span></div>
        </div>

        <div class="mix__wave">
          <canvas data-wave aria-hidden="true"></canvas>
        </div>

        <div class="mix__deck">
          <span class="mix__letter" data-letter="0">A</span>
          <div class="mix__fader" data-fader role="slider" tabindex="0" aria-label="Crossfader" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-valuetext="Deck A">
            <span class="mix__ticks" aria-hidden="true"></span>
            <span class="mix__slot" aria-hidden="true"><span class="mix__fill" data-fill></span></span>
            <span class="mix__cap" data-cap aria-hidden="true"><span class="mix__cap-face" data-capface><i></i><i></i><i></i></span></span>
          </div>
          <span class="mix__letter" data-letter="1">B</span>
        </div>

        <footer class="mix__foot">
          <span><b data-count>1,284</b> listening</span>
          <span class="mix__next">Next <b data-next>Velvet Hours</b></span>
        </footer>
      </article>
    </div>
  </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.

32 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 “DJ set mini player” 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 black background sits a dark card with round corners, a little lighter at the top, with a one pixel edge catching the light. At the top the ‘Live’ label with a small three bar equalizer moving in time, the name of the made-up venue, Halde Club, Room Two, and the running time of the set. Below, the record's cover, the title, the artist and the BPM. In the middle two waveforms of thin bars scroll to the left under a playhead of light: above the line deck A, below it deck B, each in the colour of its record, brighter where it has already played. At the bottom the crossfader, with its ticks, its groove and a dark metal cap with ridges, the middle one lit. On its own the fader sets off and crosses its travel in a little over three seconds: the upper wave drops as the lower one grows, the old title rises and blurs while the new one comes up from below, the cover dissolves, the BPM slide from 124 to 126 and the light under the card, the label and the cap's groove move from orange to purple. At the end the cap passes the mark by a breath and settles. When a deck is silent the next record goes on it: its wave grows back from nothing and at the bottom of the card the title after ‘Next’ changes. The listeners go up by a few every now and then. The cap can be dragged with a finger or the mouse (it lifts and widens a little under the finger and comes back on a spring), moved with the arrow keys, and over the card a sheen and the lit edge follow the pointer.

How it works

One number for the whole card

The state is a number from 0 to 1, the crossfader's position. Every frame it gives the two constant power levels, cosine and sine of a quarter turn, so the two records do not dip in the middle, and from there everything else: the cap's position, the waves' height, the title's dissolve, the BPM and the colour.

The waves in a canvas

Each record has 256 bars generated from a seed: a hard hit on every beat, a softer one right after, a fill every four bars. The canvas draws them two pixels wide every three, scrolling at a speed that follows the BPM you hear; the bars already played are brighter, the edges fade and the ones near the playhead catch the light.

The colour of what you hear

The records' colours come from `:root` and are read as numbers; the colour in between goes into the --mixc variable, used by the blurred light under the card, the Live label, the sheen following the pointer and the cap's lit groove. Title and cover dissolve only in the middle of the travel, between 0.3 and 0.7, with blur and a six pixel rise.

The DJ alone and the hand

A GSAP timeline takes the fader to the other end in MIX_TIME seconds, passes the mark by six thousandths and comes back with elastic.out, waits HOLD seconds and starts again; if the deck coming in has already played and is silent, it first loads the next record on it and lets its wave grow back. As soon as a hand touches the fader the timeline stops, and it starts again three seconds after the last gesture from wherever it was left.

Values to change

NameFileDefaultWhat it changes
MIX_TIMEscript.js3.2The seconds the crossfader takes on its own from one deck to the other.
HOLDscript.js1.6The seconds each record plays alone before the next mix.
SCROLLscript.js1How fast the waves run under the playhead.
WAVE_HEIGHTscript.js1How tall the waves are.
BLURscript.js4The pixels of blur on the title while it dissolves into the other.
GLOWscript.js0.4How strong the coloured light under the card is.
LISTENERSscript.js1284How many people are listening at the start.
LOOPscript.jstrueKeeps mixing record after record.

Try them in the Playground

When to use it

For the site or app of a venue, a club, a festival or a radio station streaming its DJ sets live: the mini player that stays in a corner while you look through the night's line up.

On phones

The same card with adapted sizes: it is as wide as the box allows, spacing and waves shrink with the height, and the cap is dragged with a finger without scrolling the page.

With reduced motion

The waves stand still and the fader does not glide: it jumps from one end to the other and the title, cover and colours change with a fade; dragged, it moves under the finger without springs.

Pitfalls

  • With a linear fade between the two levels there is a hole in the middle: the levels are cosine and sine, and the waves show it, both stay tall in the middle.
  • Loading the next record on the deck about to come in is done only when it is truly silent: if the hand leaves the fader halfway, the loop restarts without changing record, or the title and wave would jump in plain sight.
  • The cap is moved by GSAP and pressed by GSAP on two different elements (the holder and the face), otherwise the press would wipe out the position.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 1 November 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