Skip to content
animorio
IT
Back to the library

Spun metal background

Backgrounds, WebGL, HoverGSAP, WebGL, CSS onlyAdvancedCompressed weight: Demo 9.5 KBGSAP 28 KBFreeDownload the zip

An animated background for a cloud platform’s hero, on dark titanium: behind the headline a face of spun metal, with the lathe’s very fine concentric lines and a chamfered step around the words. The lamp’s bow-tie glint swings round the centre to always point at the pointer, a weaker copper light turns on the other side; on the button the light narrows, and pressed, the lathe spins up again and a polishing wave runs out to the edge. A hand-written WebGL shader.

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>
<!--
  "Spun metal background" 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 spun metal background with the glint that follows the pointer</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 hero of an invented cloud platform, Mill, over a face of spun titanium: fine concentric grooves turned on a
       lathe, a stepped bezel around the words, and a lamp whose bow-tie glint swings round to follow the pointer -->
  <main class="stage" data-stage>
    <canvas class="metal" data-metal aria-hidden="true"></canvas>
    <span class="grain" aria-hidden="true"></span>

    <section class="hero" aria-labelledby="hero-title">
      <p class="pill" data-in>
        <span class="pill__tag">New</span>
        <span class="pill__text">Mill 3 ships zero-downtime deploys</span>
        <svg class="pill__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5"></path></svg>
      </p>
      <h1 class="title" id="hero-title" data-in>Infrastructure,<br>machined to fit</h1>
      <p class="lede" data-in>Deploy, observe and scale from one quiet console. Every edge finished, every request accounted for.</p>
      <div class="actions" data-in>
        <button class="cta" type="button" data-cta>
          <span class="cta__face" data-face>
            <span class="cta__shine" aria-hidden="true"></span>
            <span class="cta__row cta__row--idle" data-row="idle">
              <span class="cta__label">Start building</span>
              <svg class="cta__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 4 12.5 8l-4 4"></path></svg>
            </span>
            <span class="cta__row cta__row--busy" data-row="busy" aria-hidden="true">
              <svg class="cta__spin" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.6"></circle></svg>
              <span class="cta__label">Spinning up</span>
            </span>
            <span class="cta__row cta__row--done" data-row="done" aria-hidden="true">
              <svg class="cta__tick" viewBox="0 0 16 16"><path d="M3.6 8.4 6.6 11.2 12.4 4.9"></path></svg>
              <span class="cta__label">Workspace ready</span>
            </span>
          </span>
        </button>
        <span class="note">14 days free, no card</span>
      </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.

27 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 “Spun metal background” 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

The first screen of an invented cloud platform, Mill, on near-black titanium: a pill «New · Mill 3 ships zero-downtime deploys», the big two-line headline «Infrastructure, machined to fit», a lighter line of text and the button «Start building» with «14 days free, no card» beside it. Behind it there is a face of spun metal: very fine concentric lines, each with its own tone, a step around the words whose chamfer catches the light on one side and darkens on the other, and further out a second, finer groove. On arrival the lathe spins fast and slows down, the lamp comes on from the left and swings round to its place, a ring of light runs to the edge, and the words rise one after another with a one-pixel settle. The glint is the real one of metal brushed in circles: a bow tie of light through the centre, pointing at the lamp; the lamp follows the pointer on a spring and the bow tie swings after it, brighter on its side. A weaker copper light sits on the other side and drifts on its own. On the button the bow tie narrows and brightens, a blade of light crosses the button and the arrow jumps forward; pressed, it squashes and springs back, the lathe spins up at once and the lines shimmer, a polishing wave runs to the edge, and the button turns to «Spinning up» with a turning arc and then to «Workspace ready» with the tick drawing itself, before going back. If nobody moves the pointer, a drawn one moves around the page and presses the button.

How it works

One triangle covering the page

The WebGL canvas draws a single triangle bigger than the screen; the fragment shader works out, for each pixel, its distance from the centre of the headline and its angle, that is which line of the lathe it falls on.

The lines of the lathe

Every line RING pixels wide has a random tone, over it there are wider bands and a slow change along the circle, out of phase for each line: when the lathe turns, that is what makes the metal shimmer.

The bow-tie glint

Metal brushed in circles reflects where the line is perpendicular to the light: the product of the direction from the centre and the lamp’s direction, raised to SHARP, draws a bow tie through the centre pointing at the lamp. Stronger near the lamp and on its side, modulated by the lines.

The step and the grooves

Around the headline, at BEZEL times the short side, a narrow band works as a chamfer: its normal faces the centre on one side and outwards on the other, so the side facing the lamp lights up and the other darkens. Inside, the plate is a little lower and darker, so the headline stays readable.

The lamp on a spring

The lamp follows the pointer on a hand-written spring; with no pointer it goes back up to the right and sways slowly. On the button it moves to its centre and the bow tie narrows. The copper light sits on the other side, with COPPER.

The press and the drawn pointer

A press spins the lathe up again (the speed rises and falls with GSAP), sends a ring of light out to the edge and moves the button through three states. After AUTO_PILOT seconds without a pointer a looping timeline moves a drawn pointer; the first real movement stops it.

Values to change

NameFileDefaultWhat it changes
RINGscript.js1.6Spacing of the lathe lines, in pixels.
SHARPscript.js9How narrow the bow-tie glint is (higher, thinner).
SHINEscript.js1How strong the lamp light is.
COPPERscript.js0.6How strong the second, copper light is (0 off).
BEZELscript.js0.46Radius of the step around the headline, relative to the short side (0 no step).
SPINscript.js0.15How fast the lathe turns on its own, turns per second (0 still).
FOLLOWscript.js0.9How much the light follows the pointer (0 not at all, 1 fully).
AUTO_PILOTscript.js4After how many seconds without a pointer the drawn one starts moving (0 never).

Try them in the Playground

When to use it

For the hero of a developer platform, a SaaS, a hardware brand or a «made with care» product: when you need a dark background that feels like real material and leaves the headline in front.

On phones

Same animations: the centre of the lathe sits behind the headline, the step is sized on the short side of the screen, the lamp follows the finger; text and button fit inside the box.

With reduced motion

With reduced motion the metal is already lit and still, with the lamp in place, the words only fade in and the button goes straight to «Workspace ready».

Pitfalls

  • The bow tie always passes through the centre, that is behind the headline: the plate inside the step has to stay darker and the glint near the centre off, otherwise the white letters vanish into the light.
  • Single-pixel lines make moiré: the spacing has to be multiplied by devicePixelRatio and never go under a pixel and a half.
  • The change along the circle must use a whole multiple of the angle (5 here): otherwise on the left, where atan jumps from plus to minus pi, a seam appears.
  • Without WebGL the CSS background stays: a conic-gradient under thin rings, which already looks like spun metal.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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