Skip to content
animorio
IT
Back to the library

Gas fee dial

SVG, PhysicsGSAPMediumCompressed weight: Demo 8.2 KBGSAP 28 KBFreeDownload the zip

The network fee step of a made-up crypto wallet, Halden: to send 0.42 ETH you pick Slow, Market or Fast, and a gauge in gwei shows the choice with a needle on a real spring that overshoots, wobbles and settles. Below, the transaction runs from your address to the block faster or slower, and the time, the gwei and the dollars roll digit by digit. Now and then the network gets busy: the base fee notch rises, the prices rise with it and the needle trembles by half a degree. Minimal style, a single accent.

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>
<!--
  "Gas fee dial" 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>Gas fee dial</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- The network fee step of a send in a made-up crypto wallet, Halden. A gauge with a needle on a real spring
       (overshoot, a wobble that dies out) shows the fee in gwei; under it the transaction runs from your address to
       the next block faster or slower, and the time and the cost roll digit by digit. Now and then the network gets
       busy: the base fee notch rises and the needle trembles by half a degree. -->
  <main class="stage">
    <article class="fee" data-fee aria-label="Network fee for sending 0.42 ETH">
      <header class="fee__head">
        <div>
          <p class="eyebrow">
            <svg class="eyebrow__mark" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 12.5 8 3.5l5 9M5.4 8.2h5.2"/></svg>
            Halden
          </p>
          <h1>Send <span class="mono">0.42 ETH</span></h1>
        </div>
        <p class="net" data-net><span class="net__label">Network</span> <span class="net__state" data-net-state>Calm</span></p>
      </header>

      <div class="dial">
        <svg class="dial__svg" data-dial viewBox="0 0 320 172" role="img" aria-label="Fee gauge in gwei">
          <defs>
            <filter id="soft" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="2.2"/></filter>
          </defs>
          <path class="dial__track" d="M30 152 A130 130 0 0 1 290 152"/>
          <path class="dial__fill" data-fill d="M30 152 A130 130 0 0 1 290 152" pathLength="1"/>
          <g data-ticks></g>
          <g data-labels class="dial__labels"></g>
          <g data-base class="base">
            <path class="base__notch" d="M160 10 l-5 -8 h10 z"/>
          </g>
          <path class="dial__glass" d="M57.6 124.6 A106 106 0 0 1 141.6 47.6"/>
          <g data-shadow class="needle-shadow" filter="url(#soft)">
            <path d="M160 46 L164.2 150 Q160 157 155.8 150 Z"/>
          </g>
          <g data-needle class="needle">
            <path class="needle__body" d="M160 42 L163.6 150 Q160 156.5 156.4 150 Z"/>
            <path class="needle__shine" d="M160 46 L161.2 146"/>
          </g>
          <circle class="pivot" data-pivot cx="160" cy="152" r="9"/>
          <circle class="pivot__dot" cx="160" cy="152" r="2.6"/>
        </svg>
        <div class="readout">
          <p class="readout__time"><span class="roll" data-time>~ 30 s</span></p>
          <p class="readout__cost"><span class="roll mono" data-gwei>18</span><span class="unit">gwei</span><span class="sep" aria-hidden="true"></span><span class="roll mono" data-usd>$1.18</span></p>
        </div>
      </div>

      <div class="tx" data-tx aria-hidden="true">
        <span class="tx__end mono">0x7a3f…c91e</span>
        <span class="tx__line"><i class="tx__done" data-tx-done></i><i class="tx__packet" data-packet></i></span>
        <span class="tx__end tx__block" data-block>
          <svg viewBox="0 0 16 16"><path d="M8 2.2 13.2 5v6L8 13.8 2.8 11V5Z M2.8 5 8 7.8 13.2 5 M8 7.8v6"/></svg>
          <span class="mono" data-block-no>21,480,112</span>
        </span>
      </div>

      <div class="speeds" role="radiogroup" aria-label="Transaction speed" data-speeds>
        <span class="speeds__pill" data-pill aria-hidden="true"></span>
        <button type="button" role="radio" class="speed" data-speed="slow" aria-checked="false" tabindex="-1"><span class="speed__name">Slow</span><span class="speed__eta mono" data-eta="slow">~ 2 min</span></button>
        <button type="button" role="radio" class="speed" data-speed="market" aria-checked="true" tabindex="0"><span class="speed__name">Market</span><span class="speed__eta mono" data-eta="market">~ 30 s</span></button>
        <button type="button" role="radio" class="speed" data-speed="fast" aria-checked="false" tabindex="-1"><span class="speed__name">Fast</span><span class="speed__eta mono" data-eta="fast">~ 12 s</span></button>
      </div>
    </article>
  </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.

31 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 “Gas fee dial” 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 warm white page, the Halden card: «Send 0.42 ETH» and, on the right, the network pill, Calm or Busy. In the middle an arc gauge in gwei, from 8 to 36, with thin ticks, three numbers and a black needle with its shadow. On arrival the needle starts at the bottom of the scale and swings up to the Market fee on a spring: it overshoots, comes back, wobbles and stops; the ticks light up blue under it and the arc fills up to there. Below, the big time estimate («~ 30 s»), the gwei and the cost in dollars, which change by rolling digit by digit. Further down the transaction: a small blue packet runs from your address to the block, slower with Slow and faster with Fast, and with each arrival the block number goes up. At the bottom the three-segment selector with the white pill sliding along. Hovering a speed makes the needle lean towards it, clicking takes it there. Now and then the network turns Busy: the black base fee notch climbs along the arc, every fee and time goes up and the needle trembles by half a degree until the network is calm again.

How it works

The scale

The dial runs from 8 to 36 gwei over half a turn: each fee becomes an angle between −90 and 90 degrees. The ticks, one per gwei and longer every five, are SVG lines set in a circle by the script around the true pivot.

The needle on a spring

In GSAP’s ticker, six steps per frame: the acceleration is −STIFFNESS times the distance from the wanted angle minus DAMPING times the speed. With these values the spring is underdamped: the needle overshoots by a few degrees, comes back and settles by itself.

The right pivot

The needle is a group inside the SVG and turns with svgOrigin on the true centre of the pivot, «160 152» in viewBox coordinates; its shadow turns the same way, offset by a pixel and a half and blurred.

The rolling digits

Each digit is a column holding a strip from 0 to 9, ten lines tall: to change number the strip slides with a small bounce, from right to left. If the number changes shape (from «~ 30 s» to «~ 2 min») the text is rebuilt and comes in from below.

The busy network

The base fee rises by CONGESTION gwei in a second: the black notch follows it along the arc, fees and times are worked out again. Meanwhile another small spring chases a random point within TREMBLE degrees, and the tremble is added to the needle.

Values to change

NameFileDefaultWhat it changes
STIFFNESSscript.js170How stiff the needle’s spring is (higher, quicker and snappier).
DAMPINGscript.js10How quickly the wobble dies out (low, it swings longer).
LEANscript.js0.35How far the needle leans towards the speed under the pointer, before you choose it.
TREMBLEscript.js0.5How many degrees the needle trembles while the network is busy.
CONGESTIONscript.js6How many gwei the base fee rises when the network is busy.
ETH_PRICEscript.js3120The price of one ETH in dollars, for the cost.
AUTOPLAYscript.jstrueThe card shows itself (speeds and busy network) until you touch it.

Try them in the Playground

When to use it

In the fee step of a send, in a crypto wallet, a payments or finance app, anywhere people choose between fast and cheap: the shipping of an order, the priority of a job, the quality of an upload.

On phones

The card is sized on the width and the dial on the height too (vh), so it fits the phone box; under 420 pixels the address hides and the transaction line widens. A finger picks the speeds with a tap.

With reduced motion

No spring, no tremble, no running packet: the needle already sits on the fee and goes there at once when it changes, the digits change in place, the transaction line stays full and still.

Pitfalls

  • The needle turns inside the SVG: svgOrigin with the true pivot centre in viewBox coordinates, never transformOrigin, or it would turn around the wrong point.
  • The spring is integrated in six steps per frame and the time is capped at a thirtieth of a second: with a single step and a tab coming back to the front, the needle would fly off.
  • The digit columns use yPercent (the strip is ten lines tall): GSAP does not read percentages back from the CSS.
  • The selector pill is measured again on resize: the sizes are in pixels.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

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