Skip to content
animorio
IT
Back to the library

Light needle speed test

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

An internet provider’s speed test, on blue-black, in the style of Libraries.dev: Go in the middle of the dial, then a needle of light that measures ping, download and upload one after the other, wobbling like a real measurement while the number rolls digit by digit. Each value drops into its column and underneath the wave of the speed draws itself, to read by hovering over 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>
<!--
  "Light needle speed test" 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 connection speed test with a needle of light</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>
  <!-- the speed test of an invented internet provider, Linkpulse, on near black: Go in the middle of the dial, then a
       needle of light that measures ping, download and upload one after the other, the values dropping into three
       columns and a small wave of the speed drawing itself underneath -->
  <main class="stage" data-stage>
    <section class="card" data-card aria-labelledby="t-title">
      <header class="head">
        <p class="brand">
          <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M3.5 13.5a7.5 7.5 0 0 1 13 0"></path><path d="M6.6 13.5a4.3 4.3 0 0 1 6.8 0"></path><path d="M10 13.5v2.2"></path></svg>
          <span class="brand__name">Linkpulse</span>
          <span class="brand__sep" aria-hidden="true">/</span>
          <span class="brand__page" id="t-title">Speed test</span>
        </p>
        <p class="state" aria-live="polite"><span class="state__in" data-state>Ready</span></p>
      </header>

      <div class="dial" data-dial>
        <svg class="gauge" viewBox="0 0 300 236" aria-hidden="true">
          <defs>
            <linearGradient id="fill-grad" x1="0" y1="1" x2="1" y2="0">
              <stop offset="0" style="stop-color: var(--glow-soft)"></stop>
              <stop offset="1" style="stop-color: var(--glow)"></stop>
            </linearGradient>
            <linearGradient id="needle-grad" gradientUnits="userSpaceOnUse" x1="206" y1="150" x2="262" y2="150">
              <stop offset="0" style="stop-color: var(--glow)" stop-opacity="0"></stop>
              <stop offset="0.55" style="stop-color: var(--glow)" stop-opacity="0.75"></stop>
              <stop offset="1" style="stop-color: #ffffff"></stop>
            </linearGradient>
            <filter id="bloom" filterUnits="userSpaceOnUse" x="-40" y="-40" width="380" height="320">
              <feGaussianBlur stdDeviation="5"></feGaussianBlur>
            </filter>
          </defs>
          <g data-ticks></g>
          <g data-labels></g>
          <path class="track" data-track pathLength="100"></path>
          <path class="fill-glow" data-fill-glow pathLength="100" filter="url(#bloom)"></path>
          <path class="fill" data-fill pathLength="100"></path>
          <g class="needle" data-needle>
            <line class="needle__glow" x1="214" y1="150" x2="262" y2="150" filter="url(#bloom)"></line>
            <line class="needle__beam" x1="206" y1="150" x2="262" y2="150"></line>
          </g>
        </svg>

        <div class="readout" data-readout>
          <p class="readout__num" data-num aria-hidden="true"></p>
          <p class="readout__unit" data-unit>Mbps</p>
        </div>

        <button class="go" type="button" data-go>
          <span class="go__ring" aria-hidden="true"></span>
          <span class="go__label" data-go-label>Go</span>
        </button>
      </div>

      <ul class="results">
        <li class="res" data-res="ping">
          <p class="res__name"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 8h3l1.4-3 2.2 6 1.4-3h3"></path></svg>Ping</p>
          <p class="res__val"><span class="res__num" data-val>&ndash;</span><span class="res__unit">ms</span></p>
        </li>
        <li class="res" data-res="down">
          <p class="res__name"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 2.8v9.4M4.4 8.8 8 12.4l3.6-3.6"></path></svg>Download</p>
          <p class="res__val"><span class="res__num" data-val>&ndash;</span><span class="res__unit">Mbps</span></p>
        </li>
        <li class="res" data-res="up">
          <p class="res__name"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 13.2V3.8M4.4 7.2 8 3.6l3.6 3.6"></path></svg>Upload</p>
          <p class="res__val"><span class="res__num" data-val>&ndash;</span><span class="res__unit">Mbps</span></p>
        </li>
      </ul>

      <div class="wave" data-wave>
        <svg viewBox="0 0 300 52" preserveAspectRatio="none" aria-hidden="true">
          <defs>
            <linearGradient id="down-area" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0" style="stop-color: var(--glow)" stop-opacity="0.32"></stop>
              <stop offset="1" style="stop-color: var(--glow)" stop-opacity="0"></stop>
            </linearGradient>
            <linearGradient id="up-area" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0" style="stop-color: var(--glow-up)" stop-opacity="0.32"></stop>
              <stop offset="1" style="stop-color: var(--glow-up)" stop-opacity="0"></stop>
            </linearGradient>
          </defs>
          <line class="wave__base" x1="0" y1="51.5" x2="300" y2="51.5"></line>
          <line class="wave__split" x1="150" y1="6" x2="150" y2="52"></line>
          <path class="wave__area wave__area--down" data-area-down fill="url(#down-area)"></path>
          <path class="wave__line wave__line--down" data-line-down></path>
          <path class="wave__area wave__area--up" data-area-up fill="url(#up-area)"></path>
          <path class="wave__line wave__line--up" data-line-up></path>
          <line class="wave__probe" data-probe x1="0" y1="0" x2="0" y2="52"></line>
        </svg>
        <p class="wave__tip" data-tip></p>
      </div>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.5-3.3 2.4 5.3 2.3-1-2.4-5.2 4.8-.2z"></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.

30 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 “Light needle speed test” 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 blue-black there is the speed test card of Linkpulse, a made-up internet provider: at the top the logo and the status pill, in the middle an arc dial with the scale from 0 to 1000 Mbps, below three columns for ping, download and upload and an empty strip for the wave. In the middle of the dial sits Go, a round button with a thread of light running around it. Pressed, Go squashes and sinks into the dial, a needle of light switches on and sweeps the scale to the top and back, and the ticks and numbers it passes light up. Then the pill rolls to Ping: the needle rests and the digits in the middle roll down to the milliseconds, which drop into the first column. Then Download: the needle climbs and wobbles like a real measurement, the arc fills with a blue light, the number rolls digit by digit and underneath the wave of the speed draws itself; when it is measured the value drops into the second column and the needle falls back. Upload does the same in a violet light, on the right half of the wave. At the end the needle returns to zero with an elastic and Test again arrives in the middle. Hovering over the wave a thin line follows the pointer and a label tells the speed at that moment. A drawn pointer presses Go, reads the wave and presses Test again, which puts everything back as it was.

How it works

The dial on a log scale

The arc runs from 150 to 390 degrees, 240 in all, and is a single SVG path with pathLength 100: the lit part is the same path with a dash as long as the value’s fraction. The fraction is the log of 1 plus the speed divided by the log of 1001, so 10 Mbps and 500 Mbps both get their room. The ticks and numbers light up when the fraction passes them.

A needle that really measures

GSAP takes the value towards the measured speed with power2.out, and on every frame the needle is drawn on the value times 1 plus a wobble: three sines of different frequencies, times WOBBLE. At the start and end of the measurement the wobble fades in and out with its own tween, so the needle starts and settles without jumps.

The rolling digits

The number in the middle is four columns of digits from 0 to 9: each column slides with yPercent to its digit, and only when the digit changes. The number is updated twelve times a second, not on every frame, so the wobble does not make the digits shake.

The wave to read

During the measurement a sample with its value is saved every two units of width, and the wave is a line with a faded area under it: download on the left half, upload on the right. Hovering, the sample nearest to the pointer is found and the line and label are placed there.

Values to change

NameFileDefaultWhat it changes
DOWNLOADscript.js912The measured download speed, in Mbps.
UPLOADscript.js418The measured upload speed, in Mbps.
PINGscript.js14The measured ping, in milliseconds.
WOBBLEscript.js0.06How much the needle wobbles while measuring (0 keeps it still).
SPEEDscript.js1How fast the test runs (2 is twice as fast).
GLOWscript.js#7cb0ffThe light of the download.
GLOW_UPscript.js#b38cffThe light of the upload.
AUTO_PILOTscript.js1.2After how many seconds without touches the drawn pointer starts (0 never).

Try them in the Playground

When to use it

In the app or website of an internet provider, a network service or an app that checks the connection: the speed test is the piece people really use, and here every phase has its light and its place. It also works as an idea for any measurement that climbs and settles, a performance test or a score.

On phones

The same card at adapted sizes: the dial is sized on width and height together, the three columns stay in a row with smaller text and the wave can be read with a finger, sliding over it.

With reduced motion

No wobbling needle and no rolling digits: pressing Go the three values appear already measured, the arc is already filled and the wave already drawn, with only fades.

Pitfalls

  • An SVG gradient stop does not take var() as an attribute: it goes in the style (style="stop-color: var(--glow)"), otherwise the gradient stays black.
  • A number updated on every frame from a wobbling value keeps the last digits spinning: it is updated in steps, a dozen times a second.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 28 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