Skip to content
animorio
IT
Back to the library

Curve equalizer

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.6 KBGSAP 28 KBFreeDownload the zip

The equalizer of a music app: eight bands, from 60 hertz to 16 kilohertz, joined by a single smooth curve. The presets (Flat, Bass, Vocal, Treble, Lounge) reshape it on a spring, one knob after the other; each band drags with a finger and says its decibels. Behind it moves the spectrum of the song, taller where the curve lifts 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>
<!--
  "Curve equalizer" 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>Curve equalizer</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 equalizer of a music app: eight bands joined by one curve, presets that reshape it on springs,
         and the spectrum of the song behind, louder where the curve is higher -->
    <section class="eq" data-eq aria-label="Equalizer">
      <header class="eq__head">
        <h2 class="eq__title">Equalizer</h2>
        <span class="eq__roll eq__preset"><span data-preset aria-live="polite">Flat</span></span>
      </header>

      <div class="eq__graph" data-graph>
        <svg viewBox="0 0 300 170" data-svg aria-hidden="true">
          <defs>
            <linearGradient id="eq-fill" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0" class="eq__stop-a"></stop>
              <stop offset="1" class="eq__stop-b"></stop>
            </linearGradient>
          </defs>
          <g class="eq__grid">
            <line x1="0" y1="23" x2="300" y2="23"></line>
            <line x1="0" y1="85" x2="300" y2="85" class="eq__zero"></line>
            <line x1="0" y1="147" x2="300" y2="147"></line>
          </g>
          <g class="eq__bars" data-bars></g>
          <line class="eq__guide" data-guide x1="0" y1="8" x2="0" y2="162"></line>
          <path class="eq__area" data-area></path>
          <path class="eq__glow" data-glow></path>
          <path class="eq__curve" data-curve></path>
          <g data-knobs></g>
        </svg>
        <span class="eq__db eq__db--top">+12 dB</span>
        <span class="eq__db eq__db--low">−12 dB</span>
        <output class="eq__tip" data-tip></output>
        <div class="eq__inputs" data-inputs></div>
      </div>

      <div class="eq__freq" data-freq aria-hidden="true"></div>

      <div class="eq__chips" data-chips role="group" aria-label="Presets"></div>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

14 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Curve equalizer” 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 near-black ground, a dark card. At the top “Equalizer” and, on the right, the preset name that rolls when it changes. In the middle the graph: three thin lines (+12, 0 and −12 decibels), behind them thirty-four pale bars moving like the spectrum of a song, and above a lime green curve running through eight round knobs, with a veil of colour fading downwards. Below, the frequency of each band and five presets. Tap a preset and the knobs go to their places on a spring, each a moment after the one on its left, the curve following in a wave; the bars grow where the curve rises and sink where it falls. Hover a band and its knob, a vertical line, its frequency and a decibel label light up; drag anywhere in the column and the knob takes the height of the finger, in one-decibel steps, and the preset becomes “Custom”. A double tap puts the band back to zero.

How it works

Eight numbers, one curve

Each band holds the value chosen and where its knob is right now. Every frame the curve is worked out again as a Catmull-Rom spline through the eight points, flat at both ends.

Presets on springs

A preset is a list of eight fractions of the range. Each knob gets there on a GSAP elastic, four hundredths of a second later than the one before: the curve moves like a wave from left to right.

A spectrum that listens to the curve

The bars are two sines multiplied, different for each, with a tilt from bass to treble. The height is then multiplied by the curve’s gain at that point, as a real equalizer would.

Dragging the column

No need to hit the knob: the pointer picks the nearest band horizontally and its height becomes decibels. The pointer stays captured by the graph until it is released.

Real sliders under the drawing

Under each band sits an invisible range input named after its frequency: Tab and the arrow keys adjust everything, and screen readers read the decibels.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#b9f24eThe colour of the curve, the knobs and the spectrum.
RANGEscript.js12How many decibels each band can be raised or cut.
SPRINGscript.js1How elastic the curve is when the preset changes: 0.3 = stiff, 2 = very elastic.
LIVELYscript.js1How much the song’s spectrum moves behind the curve: 0 = still, 2 = very lively.
LOOPscript.jstrueLeft alone, the demo’s pointer tries two presets, drags two bands and goes back to Flat.

Try them in the Playground

When to use it

In the audio settings of a music or podcast app, in the companion app of headphones or a speaker, in a web player. The same curve with knobs works wherever eight neighbouring values are tuned together: a colour curve, a brightness profile through the day.

On phones

The same card, as wide as the screen: the graph scales in proportion, bands drag with a finger without scrolling the page and the decibel label stays visible while dragging.

With reduced motion

The spectrum holds still, presets put the knobs in place at once and the curve redraws with no spring. Dragging, keyboard and labels work the same. The demo does not move by itself.

Pitfalls

  • Nothing plays here: the spectrum is made up. With real audio the values go to eight BiquadFilterNodes of type peaking and the bars are read from an AnalyserNode.
  • The graph has touch-action: none, or on a phone dragging a band would scroll the page.
  • While dragging, the label shows the value chosen; during a preset’s spring it shows the knob’s rounded one, or it would already read the destination.
  • A knob at the very top would push its label past the card edge: above a certain height the label moves below the knob.
  • With a very elastic spring the knobs briefly overshoot the maximum: the svg must not clip the curve (visible overflow).

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 21 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 animations