Skip to content
animorio
IT
Back to the library

Brushed metal card

3D, WebGL, PhysicsWebGL, Canvas, GSAPAdvancedCompressed weight: Demo 8.7 KBGSAP 28 KBThree.js + RoomEnvironment 176 KBFreeDownload the zip

A made-up bank’s titanium card in 3D: brushed metal with engraved lettering, a champagne chip and a bevelled edge that catches the light, reflecting a studio room. It leans toward the pointer, a drag spins it on by inertia until a spring settles it on its front or its back, and a click flips it over. Libraries.dev style: a real material on a real piece, on near black.

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>
<!--
  "Brushed metal card" 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>Arcline Titanium</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
  <script type="importmap">
    { "imports": {
      "three": "https://cdn.jsdelivr.net/npm/three@0.178.0/build/three.module.min.js",
      "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.178.0/examples/jsm/"
    } }
  </script>
</head>
<body>
  <!-- a made-up bank, Arcline: its titanium card, brushed metal with engraved lettering, in 3D. Hover tilts it toward
       the pointer, drag spins it with inertia, a click flips it to the back -->
  <main class="palco" data-palco>
    <header class="testa" data-testa>
      <span class="etichetta">Arcline Titanium</span>
      <span class="sotto" data-stato>Founding member</span>
    </header>

    <div class="scena" data-scena>
      <canvas class="tela" data-tela role="img" aria-label="A brushed titanium payment card turning in 3D"></canvas>
      <!-- if WebGL is missing: a flat brushed card -->
      <div class="ripiego" data-ripiego aria-hidden="true"><span>ARCLINE</span></div>
    </div>

    <p class="aiuto" data-aiuto>
      <span class="aiuto-voce">Drag to spin</span>
      <span class="aiuto-voce">Click to flip</span>
    </p>

    <!-- the fake pointer of the autopilot -->
    <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3l14 8-6.2 1.6L10 19z"/>
    </svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script type="module" 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.

21 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 “Brushed metal card” 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 background, with a soft studio light in the middle, is the card of Arcline, a made-up bank: brushed titanium with the fine lines of the metal, ARCLINE and TITANIUM engraved, a champagne chip with its tracks, the contactless arcs, the bank’s mark made of three arcs, the holder’s name, “Founding member”, the expiry and the last four digits. The edge is bevelled and catches the room’s light. At rest the card sways slowly and floats up and down a little. The pointer tilts it toward itself on a spring, while the title and the line below shift slightly the other way. Dragged, it turns around its vertical axis; thrown, it keeps spinning by inertia showing front, edge and back, slows down with friction and a spring settles it on the nearest face in the direction it was going, with a small bounce. A click flips it to the other face: on the back are the magnetic stripe, the signature strip with the name, the code and the fine print. Underneath, a soft shadow widens and narrows with the width the card shows. The autopilot shows it all: it comes close, tilts it, throws it, flips it and flips it back.

How it works

A body and two faces

The body is an ExtrudeGeometry of a rounded rectangle, 0.05 thick with a 0.012 bevel, in a dark glossy metal. On the front and the back sit two ShapeGeometry meshes of the same shape, with their UVs remapped from 0 to 1 across width and height, so the front and back textures land exactly.

Metal painted on a canvas

Each face has two 2048 pixel canvases: colour and roughness. The ground is brushed with nine thousand thin horizontal strokes, light and dark, and the lettering is engraved by drawing it twice, a light copy offset by two pixels and a dark one on top; in the roughness map the engravings are rougher than the metal. The material is a MeshPhysicalMaterial with metalness 1, some anisotropy and RoomEnvironment’s room as the reflection.

Inertia and spring

Dragging adds degrees to the spin and keeps an average of the speed. On release that speed, capped at MAX_SPIN, spins the card by itself and decays with exp(-FRICTION·dt); below 140 degrees per second a spring (stiffness 70, damping 10.5) takes it to the nearest multiple of 180 in the direction of the spin. A click without movement moves the target by 180 degrees: the same spring flips it.

Tilt and shadow

The pointer’s position in the scene gives the wanted tilt, up to TILT degrees, and a second spring chases it, so it overshoots a hair when it comes back flat. The shadow is a floor plane with a radial gradient, as wide as the card seen from above: cos(spin)·width plus the thickness.

Values to change

NameFileDefaultWhat it changes
TILTscript.js14How many degrees the card leans toward the pointer.
FRICTIONscript.js1.6How fast a thrown spin slows down (higher = sooner).
MAX_SPINscript.js900The fastest spin a throw can give, in degrees per second.
IDLE_SWAYscript.js1How much the card sways by itself at rest (0 = still).
BRUSHscript.js1How strong the brushed lines of the metal are.
SHINEscript.js1How bright the studio reflections are.
AUTO_PILOTscript.js11 shows the gestures with a fake pointer when nobody touches the card, 0 turns it off.

Try them in the Playground

When to use it

For the page of a payment card, a subscription or an exclusive membership card: in a fintech, a digital bank or a service’s members programme, where the card is the product and you want people to touch and turn it like a real object.

On phones

The same card, smaller: it spins as you drag with a finger and flips with a tap; the tilt follows the finger while it is on the card.

With reduced motion

The card stays still, slightly tilted, without swaying or spinning on: dragging and clicking take it straight to its front or its back, without a spring.

Pitfalls

  • The faces are ShapeGeometry: their default UVs are the shape’s coordinates, so they must be remapped from 0 to 1, otherwise the texture repeats or runs off the card.
  • ExtrudeGeometry’s bevel sticks out by bevelThickness in front and behind: the painted faces must sit just beyond it, or the body’s metal covers them in patches.
  • The canvas lettering waits for the font (document.fonts.load), otherwise the first texture comes out in the system font.
  • The back face is rotated 180 degrees around the vertical axis, so it reads straight when the card is turned over.

Libraries

Three.js 0.178.0, GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 8.7 KB; the libraries: GSAP 28 KB, Three.js + RoomEnvironment 176 KB.

Testing

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