Skip to content
animorio
IT
Back to the library

Carbon fibre background

Backgrounds, Hover, WebGLGSAP, WebGL, CSS onlyAdvancedCompressed weight: Demo 10.0 KBGSAP 28 KBFreeDownload the zip

An animated background for an AI platform’s hero, on a sheet of lacquered carbon fibre: the stepped 2x2 twill catches the light of a distant lamp, and the fibre tows light up and go dark like a checkerboard as the light follows the pointer. Where the pointer passes the sheet dips and the weave flips in a ring around it; press the button and a flex wave runs across the whole sheet. 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>
<!--
  "Carbon fibre 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 carbon fibre background with the weave that bends under 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 AI inference platform, Plait, over a sheet of lacquered carbon fibre: a 2x2 twill whose
       tows catch a distant light one way or the other, a soft dent that follows the pointer and flips the weave around
       it, and a flex wave that runs across the sheet when the button is pressed -->
  <main class="stage" data-stage>
    <canvas class="weave" data-weave 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">Plait 2 routes across 40 regions</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>Inference,<br>woven for load</h1>
      <p class="lede" data-in>Every model call spread across a mesh of GPUs that bends under traffic and never drops a thread.</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">Deploy a model</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">Weaving cluster</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">Cluster live</span>
            </span>
          </span>
        </button>
        <span class="note">First million tokens free</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.

26 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 “Carbon fibre 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 platform for running AI models, Plait, on a near-black sheet of carbon fibre: a pill «New · Plait 2 routes across 40 regions», the big two-line headline «Inference, woven for load», a lighter line of text and the button «Deploy a model» with «First million tokens free» beside it. Behind it is the 2x2 twill of real carbon: every fibre tow goes over two and under two, shifted by one on each row, so the weave makes its diagonal steps; every tow has its own tone, the fibres inside have fine lines, and the gaps between tows and the spots where a tow dives under the other stay in shadow. The light is the real one of fibres: a tow shines when it runs across the light, so the vertical and horizontal tows light up in turn and the weave changes pattern depending on where the lamp is, stronger near it and almost black far away. A second, weaker lavender light sits on the other side of the headline and drifts on its own; on top there is the lacquer, with a soft reflection. On arrival the lamp comes on low on the left and swings round to its place top right, the weave flips as it passes, a flex wave starts from behind the headline and the words rise one after another with a one-pixel settle. The lamp follows the pointer on a slow spring; the sheet instead dips under the pointer on a quick one, deeper the faster the pointer runs, and around the dip the weave flips in a ring. On the button the light narrows and brightens, a blade of light crosses the button and the arrow jumps forward; pressed, it squashes and springs back, the sheet sinks under it and bounces, a flex wave runs to the edge flipping the weave as it goes, and the button turns to «Weaving cluster» with a turning arc and then to «Cluster live» 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 splits the page into cells TOW pixels wide, one for each stretch of tow.

The 2x2 twill

In each cell the vertical tow is on top if (column + row) modulo 4 is 0 or 1, otherwise the horizontal one: two over and two under, shifted by one, that is the diagonal steps of carbon. The position along the stretch tells where the tow rises and where it dives under the other, and those spots go into shadow.

The light of fibres

Every tow has a tangent, the direction of its fibres, tilted where it rises or dives. The light is Kajiya-Kay: the tow shines the more its tangent is perpendicular to the half vector between light and eye, raised to SHARP. The light has a different direction for every pixel, so vertical and horizontal tows light up in turn across the sheet.

The dip and the wave

Under the pointer the sheet has a Gaussian dip DENT deep, added as a slope to the normal and to the tangents: where the sheet bends the tows change angle to the light and the weave flips. The wave of the press is a ring of slope running out to the edge.

Two springs

The lamp follows the pointer on a slow spring, the dip on a quick one; its depth grows with the pointer’s speed and slowly closes when it stops. On the button the lamp moves to its centre and the light narrows. The second, lavender light sits on the other side of the headline, with ACCENT_LIGHT.

The press and the drawn pointer

A press sinks the sheet under the button with an elastic bounce, sends out the flex wave 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
TOWscript.js9Width of one fibre tow of the weave, in pixels.
SHARPscript.js14How narrow the glint along the fibres is (higher, crisper).
SHINEscript.js1How strong the lamp light is.
ACCENT_LIGHTscript.js0.55How strong the second, lavender light is (0 off).
DENTscript.js1How deep the sheet dips under the pointer (0 flat).
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 an AI platform, a developer service, a SaaS or a hardware brand: when you need a dark background that feels like a real technical material, reacts to the pointer and leaves the headline in front.

On phones

Same animations: the weave keeps its size in pixels, the lamp follows the finger and the sheet dips under the finger; text and button fit inside the box.

With reduced motion

With reduced motion the carbon is already lit and still, with the lamp in place and no dip, the words only fade in and the button goes straight to «Cluster live».

Pitfalls

  • With the lamp high above the sheet the half vector points almost straight up and both tows shine the same: it looks like grey cloth. The lamp has to stay low, grazing, so vertical and horizontal tows split into light and dark checks.
  • Fibre lines denser than a pixel and a half make moiré: their number depends on the tow width and never goes below three per tow.
  • The dip goes into the tangents as a slope along the fibre (the sheet’s slope dotted with the tow’s direction): added only to the normal, the weave does not flip and you only see a shadow.
  • Without WebGL the CSS background stays: a repeating-conic-gradient checkerboard under diagonal lines and a sheen, which already looks like carbon.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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