
The layered button
Buttons, Hover, Physics
The Black pass of an invented private athletic club, Corvane Athletic Club, in brushed graphite titanium on a white page: it leans toward the pointer or the finger on a real spring and the light behaves like light on brushed metal, a tall streak sliding across the hairlines, a machined edge lighting up on the lamp's side and a two layer shadow sliding the other way. The member's name is engraved, the visits of the month fill a small lime ring. One tap turns it over on a spring: on the back the entry code waits under engraved hatching and reveals itself digit by digit, with the barcode growing and a line counting the seconds it stays valid.
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>
<!--
"Titanium membership 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>The titanium club membership card that catches the 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>
<main class="stage">
<!-- the membership pass of a private athletic club, in brushed titanium. It leans toward the pointer (or the finger)
and the light slides across the brushing; the name is engraved, the visits of the month fill a small ring.
A tap turns it over on a spring: on the back the entry code is hidden under engraved hatching until a touch
reveals it, with its barcode and the seconds it stays valid -->
<div class="wrap" data-wrap>
<div class="floor" data-floor aria-hidden="true">
<i class="floor__soft"></i>
<i class="floor__tight"></i>
</div>
<div class="tilt" data-tilt>
<div class="flip" data-flip>
<section class="face face--front" data-front aria-label="Corvane Athletic Club membership pass">
<i class="metal" aria-hidden="true"></i>
<i class="brush" aria-hidden="true"></i>
<svg class="guilloche" data-guilloche viewBox="0 0 400 252" preserveAspectRatio="none" aria-hidden="true"></svg>
<i class="aniso" aria-hidden="true"></i>
<i class="hot" aria-hidden="true"></i>
<i class="bevel" aria-hidden="true"></i>
<div class="front">
<div class="front__top">
<p class="brand">
<svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.6 21 7.8v8.4L12 21.4 3 16.2V7.8z"/><path d="M12 7.2 16.8 10v4.9L12 17.7l-4.8-2.8V10z"/></svg>
<span class="brand__text"><span class="etch brand__name">Corvane</span><span class="etch brand__sub">Athletic Club</span></span>
</p>
<div class="visits" data-visits>
<svg class="ring" viewBox="0 0 44 44" aria-hidden="true">
<circle class="ring__groove" cx="22" cy="22" r="18"/>
<circle class="ring__edge" cx="22" cy="22" r="18"/>
<circle class="ring__fill" data-ring cx="22" cy="22" r="18" pathLength="100" stroke-dasharray="100 100" stroke-dashoffset="100" transform="rotate(-90 22 22)"/>
</svg>
<span class="visits__num" aria-hidden="true"><span class="etch" data-visits-num>0</span></span>
<span class="visits__label etch" aria-hidden="true">visits in Nov</span>
<span class="sr" data-visits-sr>14 of 20 visits this month</span>
</div>
</div>
<svg class="nfc" viewBox="0 0 24 24" aria-hidden="true"><path d="M8.2 7.4a6.4 6.4 0 0 1 0 9.2"/><path d="M11.6 5a9.8 9.8 0 0 1 0 14"/><path d="M15 2.8a13 13 0 0 1 0 18.4"/></svg>
<div class="front__bottom">
<div class="member">
<span class="member__label etch">Member</span>
<strong class="member__name etch" data-name>Elena Marsh</strong>
<span class="member__since etch">Since 2019 · Mercer St.</span>
</div>
<div class="tier">
<span class="tier__level etch">Black</span>
<span class="tier__badge"><span class="etch">Founding member</span></span>
</div>
</div>
</div>
<button class="hit" type="button" data-turn aria-label="Turn the pass over to see the entry code"></button>
</section>
<section class="face face--back" data-back aria-label="Entry code" inert>
<i class="metal metal--back" aria-hidden="true"></i>
<i class="brush" aria-hidden="true"></i>
<i class="stripe" aria-hidden="true"></i>
<i class="aniso" aria-hidden="true"></i>
<i class="hot" aria-hidden="true"></i>
<i class="bevel" aria-hidden="true"></i>
<div class="back">
<div class="back__top">
<span class="etch back__label"><svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.6 21 7.8v8.4L12 21.4 3 16.2V7.8z"/><path d="M12 7.2 16.8 10v4.9L12 17.7l-4.8-2.8V10z"/></svg>Entry code</span>
<button class="turn" type="button" data-unturn aria-label="Turn the pass back">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4.4 9.2a5.8 5.8 0 0 1 10.2-3.1"/><path d="M15.2 3.4v3.2H12"/><path d="M15.6 10.8a5.8 5.8 0 0 1-10.2 3.1"/><path d="M4.8 16.6v-3.2H8"/></svg>
</button>
</div>
<button class="code" type="button" data-reveal aria-label="Reveal the entry code">
<span class="code__digits" data-digits aria-hidden="true"></span>
<span class="code__hint" data-code-hint aria-hidden="true">Tap to reveal</span>
</button>
<div class="back__bottom">
<svg class="bars" data-bars viewBox="0 0 160 30" preserveAspectRatio="none" aria-hidden="true"></svg>
<div class="valid">
<span class="valid__track"><i class="valid__line" data-valid></i></span>
<span class="etch valid__text" data-valid-text>Valid for 30 s at the turnstile</span>
</div>
</div>
</div>
</section>
</div>
</div>
<p class="note" data-note aria-hidden="true">Tap the pass for your entry code</p>
</div>
<p class="sr" aria-live="polite" data-live></p>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
33 values to change
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 “Titanium membership card” from Animorio and fit it into my siteEvery frame the script writes four CSS variables on the tilting element: where the light is (--lx, --ly), which side it comes from (--la) and how strong it is (--li). Every layer of the metal reads them: the broad reflection moves its background-position, the streak is a linear gradient centred on --lx, the hot spot a radial gradient, the edge a conic-gradient starting at --la. On the back, turned by 180 degrees, the light is mirrored with --lxb equal to 100 minus --lx.
The hairlines are feTurbulence noise in an SVG written in the CSS, with baseFrequency 0.0035 horizontally and 0.95 vertically: the noise stretches until it becomes strands of metal. On brushed metal light stretches across the lines, so the reflection is not a circle but a tall band, with a warm thread on the left and a cold one on the right like real titanium, in mix-blend-mode overlay.
The pointer gives a goal between minus 1 and 1; a spring with STIFFNESS and DAMPING, integrated in three sub-steps with the step capped at a thirtieth of a second, brings the pass there, where it wobbles a little and settles. A second, stiffer spring sinks it under the finger (further and a bit smaller) while the wide shadow tightens and the close one darkens.
The turn is a tween from 0 to 180 degrees with a home made ease: 1 minus e to the minus d times t times the cosine of 2.5 pi times t, which passes the mark only once and is exactly 1 at the end. Both faces have backface-visibility hidden; the sine of the angle pushes the light across once more, so the pass catches a flash as it turns, and the hidden face becomes inert for the keyboard.
Each digit sits on a block hatched with a repeating-linear-gradient. On a tap the blocks squash and fade one after the other, the digit spins through random numbers (without zero) and stops on its own with the same spring; the barcode bars, SVG rectangles generated from a fixed seed, grow from the centre with transform-box fill-box; the validity line goes down with a linear tween of CODE_LIFE seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
TILT | script.js | 14 | How far the pass leans toward the pointer, in degrees. |
STIFFNESS | script.js | 170 | How firmly the spring pulls the pass toward the pointer. |
DAMPING | script.js | 15 | How quickly the sway dies out: low wobbles, high is stiff. |
FLIP | script.js | 1.15 | How many seconds the pass takes to turn over. |
SPRING | script.js | 1 | How springy the turn and the digits are: 0.5 calm, 2 very bouncy. |
VISITS | script.js | 14 | The visits this month, on the ring. |
GOAL | script.js | 20 | How many visits the full ring stands for. |
MEMBER | script.js | Elena Marsh | The name engraved on the pass. |
CODE_LIFE | script.js | 30 | How many seconds the code stays valid once revealed. |
AUTO | script.js | true | Leans, turns and shows the code by itself until someone touches it. |
For the digital pass of a gym, an athletic club, a pilates studio or a private club: in the members area of the app or site, on the membership page, when it is time to go through the turnstile. It also works for a premium loyalty card, a museum membership or an event pass: the back with the code that reveals itself avoids showing the code to whoever stands behind.
On the phone the pass takes almost the whole width and every size is a share of its width (cqw units), so it stays identical in small. Dragging a finger over the pass leans it, a tap turns it, a tap on the code shows it. The smallest words have a minimum in pixels to stay readable.
The pass stays still, slightly leaning and with the light already in place. The turn becomes a fade between the two faces, the ring is already full, the digits of the code fade in without spinning and the bars are already whole.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.
Tested on 6 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.