
The layered button
Buttons, Hover, Physics
The vintage picker of the Riserva by Cellarmark, a made-up winery with its online shop, in a white card from a premium shot. Underneath is a wheel of years from 2016 to 2022 to drag, scroll or tap, snapping on a spring to the chosen year while a thin tick snaps in the middle. With every vintage the colour of the wine seen from above in the glass changes, with a light passing over it, the three tasting notes in pills swap, the score and the price roll like counters and the drinking window changes; for 2016 the Last 12 bottles label appears. The Add to cart button swells when pressed.
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>
<!--
"Vintage year picker" 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>Vintage year picker</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage" data-stage>
<!-- the vintage picker of Cellarmark, an invented winery: a wheel of years to drag, scroll or tap; the colour of
the wine seen from above in the glass, three tasting notes, the score and the price follow the chosen year -->
<section class="wine" aria-labelledby="w-title" data-card>
<header class="wine__head">
<div>
<p class="wine__house">Cellarmark</p>
<h2 class="wine__title" id="w-title">Riserva</h2>
<p class="wine__sub">Sangiovese · 750 ml</p>
</div>
<span class="rare" data-rare aria-hidden="true">
<svg viewBox="0 0 12 12"><path d="M6 1.2c.9 1.6 2.6 2.6 2.6 4.6A2.6 2.6 0 0 1 6 8.4a2.6 2.6 0 0 1-2.6-2.6C3.4 4.3 4.6 3.4 6 1.2Z"/><path d="M6 8.4v2.4M4.4 10.8h3.2"/></svg>
<span>Last <b data-rare-n>12</b> bottles</span>
</span>
</header>
<div class="glassrow">
<div class="drop" aria-hidden="true">
<svg viewBox="0 0 120 120" data-drop>
<defs>
<radialGradient id="wine-body" cx="50%" cy="50%" r="50%">
<stop offset="0" stop-color="#b83a4d" data-s0/>
<stop offset="0.58" stop-color="#7c1e2c" data-s1/>
<stop offset="0.88" stop-color="#5a1420" data-s2/>
<stop offset="1" stop-color="#a0523a" data-s3/>
</radialGradient>
<linearGradient id="wine-sweep" x1="0" y1="0" x2="1" y2="0">
<stop offset="0" stop-color="#fff" stop-opacity="0"/>
<stop offset="0.5" stop-color="#fff" stop-opacity="0.38"/>
<stop offset="1" stop-color="#fff" stop-opacity="0"/>
</linearGradient>
<clipPath id="wine-clip"><circle cx="60" cy="60" r="44"/></clipPath>
</defs>
<circle class="drop__bowl" cx="60" cy="60" r="55"/>
<circle class="drop__bowl drop__bowl--in" cx="60" cy="60" r="50.5"/>
<g data-disk>
<circle cx="60" cy="60" r="44" fill="url(#wine-body)"/>
<g clip-path="url(#wine-clip)">
<rect class="drop__sweep" x="-40" y="-10" width="34" height="140" fill="url(#wine-sweep)" transform="rotate(18 60 60)" data-sweep/>
<path class="drop__spec" d="M31 47a31 31 0 0 1 24-20" data-spec/>
</g>
<circle class="drop__rim" cx="60" cy="60" r="43.5"/>
</g>
<circle class="drop__ripple" cx="60" cy="60" r="44" data-ripple/>
</svg>
</div>
<dl class="facts">
<div class="fact">
<dt>Score</dt>
<dd><span class="roll roll--big" data-roll-score></span><span class="fact__unit">pts</span></dd>
</div>
<div class="fact">
<dt>Price</dt>
<dd><span class="fact__cur">$</span><span class="roll roll--big" data-roll-price></span><span class="fact__unit">/ bottle</span></dd>
</div>
<p class="facts__window" data-window>Drink 2025 – 2034</p>
</dl>
</div>
<ul class="notes" aria-label="Tasting notes" data-notes>
<li class="note"><span class="note__in" data-note>Black cherry</span></li>
<li class="note"><span class="note__in" data-note>Leather</span></li>
<li class="note"><span class="note__in" data-note>Rosemary</span></li>
</ul>
<div class="years" role="slider" tabindex="0" aria-label="Vintage" aria-valuemin="2016" aria-valuemax="2022" data-years>
<span class="years__label" aria-hidden="true">Vintage</span>
<div class="years__track" data-track>
<div class="years__ruler" aria-hidden="true" data-ruler></div>
<div class="years__strip" data-strip></div>
</div>
<span class="years__tick" aria-hidden="true"><i data-tick></i></span>
</div>
<button class="cart" type="button" data-cart>
<span class="cart__face" data-cart-face>
<span class="cart__glow" aria-hidden="true" data-cart-glow></span>
<span class="cart__label" data-cart-label>
<svg class="cart__bag" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 5.6h9.2l-.7 7.6H4.1z"/><path d="M5.8 5.6V4.4a2.2 2.2 0 0 1 4.4 0v1.2"/></svg>
<span>Add to cart</span>
</span>
<span class="cart__label cart__label--done" data-cart-done aria-hidden="true">
<svg class="cart__check" viewBox="0 0 16 16"><path d="M3.6 8.4 6.6 11.2 12.4 4.8" data-check/></svg>
<span>Added</span>
</span>
</span>
</button>
<p class="sr" aria-live="polite" data-live></p>
</section>
</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.
92 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 “Vintage year picker” from Animorio and fit it into my siteThe wheel has a fractional position (the year’s index) and a whole target year. On every frame of GSAP’s ticker a damped spring (stiffness and friction among the values) pulls the position towards the target, with the time step capped at 1/30 of a second; once it has arrived the ticker stops drawing.
While dragging, the position follows the finger (past the first and last year with a braking rubber band); the last 90 milliseconds give the speed, and on release the target is the year nearest to position plus speed times FLICK seconds. A tap without dragging goes to the tapped year, the mouse wheel and the arrow keys move by one year.
Each year knows its distance from the centre: from it come the scale, opacity, variable font weight and a small drop growing with the square, so the row seems to turn on a cylinder. When the rounded year changes, the rest of the card follows.
The disc is an SVG radialGradient with four stops worked out from the vintage colour (lighter in the middle, darker, the rim): a tween takes a number from 0 to 1 and mixes the stops on every frame. Score and Price are columns from 0 to 9 in boxes 1ch wide, rolling with a back.out and an elastic settle of a pixel and a half.
| Name | File | Default | What it changes |
|---|---|---|---|
VINTAGES | script.js | 2016–2022 | The vintages: year, score, price, colour of the wine and of the rim, three notes separated by commas, drinking window and bottles left (0 if it is not rare). |
START_YEAR | script.js | 2019 | The vintage chosen when it opens. |
ITEM | script.js | 66 | The distance between two years on the wheel, in pixels. |
STIFFNESS | script.js | 240 | The spring that brings the wheel to the chosen year. |
DAMPING | script.js | 21 | Lower lets it pass the year and come back. |
FLICK | script.js | 0.2 | How much the push of the finger counts when letting go of the wheel. |
FADE | script.js | 0.42 | How much the years far from the centre fade. |
SWELL | script.js | 1.045 | How much the pressed button swells. |
SPEED | script.js | 1 | The speed of the round on its own. |
AUTO | script.js | true | The wheel turning by itself through the vintages until someone touches it. |
--accent | style.css | #7c1e2c | The wine red of the tick, the label and the glow. |
--button | style.css | #1b1416 | The colour of the Add to cart button. |
On a wine’s page in the online shop of a winery or a wine shop, when the same wine comes in several vintages with different prices, scores and notes: you pick the year in one gesture and see at once what changes. It also suits whisky, cigars, tea or collectible coffee sold by year.
The card narrows to 92% of the screen and the glass, the figures and the wheel get shorter with the height of the box; the finger drags the wheel sideways while the page still scrolls up and down, and a tap on a year picks it. The button swells under the finger as under the mouse.
No springs, swaying or self-turning wheel: the card fades in, the wheel jumps straight to the chosen year, the wine colour, the notes, the window and the label change with a fade and the digits change without rolling. The button fades to Added.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.
Tested on 17 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.