
The inchworm menu
Menus, Hover, Transitions
The gift card of a homeware shop, on near black, where every amount has its own material: 50 dollars is linen paper, 100 frosted glass, 250 brushed brass, 500 black metal. Choosing the amount, with a tap or by dragging the light pill along the picker, the new material crosses the card behind a band of light, the figures roll, the finish's name turns over and the glow under the card takes its colour. Add to bag gives under the finger, the card dips into it and the price turns into a check.
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>
<!--
"Material gift 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 gift card that changes material with the amount</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 gift card of a homeware shop on a near black page. Each amount has its own finish: $50 is linen paper,
$100 frosted glass, $250 brushed brass, $500 black onyx metal. Choosing an amount (a tap, or dragging the
light pill along the picker) wipes the new material across the card behind a band of light, the figures roll,
the name of the finish turns over and the glow under the card takes its colour. A soft light on the card
follows the pointer; on the metals it is a long brushed streak. Add to bag presses, shines and says Added -->
<div class="gc" data-gc>
<span class="gc__pool" data-pool aria-hidden="true"></span>
<div class="gc__card" data-card>
<div class="gc__skin" data-skin aria-hidden="true">
<span class="gc__mat gc__mat--linen" data-mat></span>
<span class="gc__mat gc__mat--frost" data-mat>
<span class="gc__blob gc__blob--a" data-blob></span>
<span class="gc__blob gc__blob--b" data-blob></span>
<span class="gc__frost"></span>
</span>
<span class="gc__mat gc__mat--brass" data-mat></span>
<span class="gc__mat gc__mat--onyx" data-mat></span>
<span class="gc__grain"></span>
<span class="gc__sheen" data-sheen></span>
<span class="gc__streak" data-streak></span>
<span class="gc__wipe" data-wipe></span>
<span class="gc__rim" data-rim></span>
</div>
<div class="gc__face" data-face>
<div class="gc__top">
<span class="gc__brand">
<svg class="gc__mark" viewBox="0 0 20 20" aria-hidden="true">
<path d="M4 16V4h12"/>
<path d="M4 10h8"/>
<path class="gc__mark-arc" d="M12.5 16a3.5 3.5 0 0 1 3.5-3.5"/>
</svg>
<span data-brand>Forma House</span>
</span>
<span class="gc__finish" data-finish><span class="gc__finish-word">Linen</span></span>
</div>
<div class="gc__bottom">
<span class="gc__label">Gift card</span>
<span class="gc__amount" data-amount aria-hidden="true"></span>
</div>
<span class="gc__valid">Valid 24 months · Online and in store</span>
</div>
</div>
<div class="gc__pick" role="radiogroup" aria-label="Gift card amount" data-pick>
<span class="gc__thumb" data-thumb aria-hidden="true"></span>
<button class="gc__opt" type="button" role="radio" data-opt><b data-opt-amount>$50</b><span>Linen</span></button>
<button class="gc__opt" type="button" role="radio" data-opt><b data-opt-amount>$100</b><span>Frost</span></button>
<button class="gc__opt" type="button" role="radio" data-opt><b data-opt-amount>$250</b><span>Brass</span></button>
<button class="gc__opt" type="button" role="radio" data-opt><b data-opt-amount>$500</b><span>Onyx</span></button>
</div>
<button class="gc__add" type="button" data-add>
<span class="gc__add-face" data-add-face>
<span class="gc__add-shine" aria-hidden="true"><span class="gc__add-band" data-add-band></span></span>
<span class="gc__add-words" aria-hidden="true">
<span class="gc__add-word" data-add-word>Add to bag</span>
<span class="gc__add-word" data-add-word>Added to bag</span>
</span>
<span class="gc__add-chip" aria-hidden="true">
<span class="gc__add-price" data-add-price></span>
<svg class="gc__add-check" viewBox="0 0 16 16"><path data-add-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/></svg>
</span>
</span>
</button>
</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.
35 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 “Material gift card” from Animorio and fit it into my siteThe card's skin holds the four materials stacked, all in CSS: linen is four repeating gradients (the weave) under a radial light, glass two blurred blobs under a white veil, brass and black metal a horizontal brushing of one pixel lines over a banded gradient. Over them all the grain (an feTurbulence data URI, in overlay), the pointer light and the one pixel rim.
The chosen material goes on top with a new z-index and is uncovered with clip-path, from inset(0 100% 0 0) to inset(0), or from the other side when going back; a slanted band in screen mode travels the same way on the same curve, so the light always sits on the moving edge. When it is done the other materials are hidden, but only if nothing else has been chosen meanwhile.
Each column is a strip of eleven cells (blank and 0-9) moved with yPercent; the blank column shrinks to zero width, so 50 becomes 100 without a jump. The figures are proportional: every column takes the width of its own digit, measured once and again on resize. The right column starts first, with back.out.
A tap picks the amount under the finger; past five pixels of dragging the picker captures the pointer, the pill follows the finger and the amount changes as soon as its centre passes the next one; let go, it goes back to its place on a spring. touch-action: pan-y lets the page scroll vertically. From the keyboard the arrows, Home and End.
The light on the card chases the pointer on a spring integrated by hand on gsap.ticker; the ink, the glow under the card and the strength of the metals' streak are CSS variables GSAP takes to the material's values. Add to bag is a timeline: the shine, the card dipping and coming back on an elastic, the word turning over and the check drawn with stroke-dashoffset.
| Name | File | Default | What it changes |
|---|---|---|---|
AMOUNTS | script.js | 50, 100, 250, 500 | The four amounts, from linen to black metal. |
CURRENCY | script.js | $ | The sign before the amount. |
BRAND | script.js | Forma House | The shop's name on the card. |
WIPE | script.js | 0.75 | How many seconds the new material takes to cross the card. |
SHEEN | script.js | 1 | How strong the light following the pointer is. |
SPRING | script.js | 1 | How springy the card, the pill and the button are: 0.5 calm, 2 very bouncy. |
STEP | script.js | 1.4 | How many seconds each finish stays when the demo runs by itself. |
HOLD | script.js | 1.5 | How many seconds ‘Added to bag’ stays before going back. |
AUTO | script.js | true | Goes through the finishes by itself until someone touches it. |
For the gift card page of an online shop, a homeware, fashion or beauty store: the higher amount looks and feels more precious, and choosing the amount becomes a small pleasure.
The same animation with adapted sizes: everything is at most 84% of the screen wide and also measured on the height, the card's words follow its width (cqw units), the pill is dragged with a finger and the light on the card goes where you touch.
Nothing moves: the new material fades in over the old one, the figures and the finish's name fade in place, the light on the card stays still, the colours under the glass stay still and Add to bag swaps its label and check with a fade.
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 2 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.