Skip to content
animorio
IT
All components

Vintage year picker

Pickers, Hover, PhysicsGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

92 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 “Vintage year picker” 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 white ground there is a single white card with wide corners, its one pixel edge catching the light at the top, a soft layered shadow with a thread of wine red and a very fine grain. At the top Cellarmark in small letters, the Riserva written large in a serif face and under it Sangiovese · 750 ml. On the left the wine seen from above in the glass: two thin rings of glass and inside the disc of the wine, lighter in the middle and darker towards the edge, with the rim more orange for the old vintages and more purple for the young ones, and a small highlight. On the right Score and Price in large figures, and under them the drinking window. Then three pills with the tasting notes and, at the bottom, the wheel of years on a thin ruler, faded at the sides, with the red tick in the middle, and the black Add to cart button. Dragged with the finger or the mouse, the wheel follows the hand and, let go, takes the push and snaps to the nearest year on a spring that slightly passes the mark and comes back; the years far from the centre are smaller, lighter, fainter and drop slightly, as on a cylinder. Every time a year passes the tick snaps, the wine disc changes colour, swaying as if the glass moved, a light runs across it in the direction of the wheel and a thin ring widens; the pills leave upwards and the new ones come in from below, changing width on a spring, Score and Price roll like counters and settle by a pixel. For 2016 the Last 12 bottles label hops in. Pressed, the button swells and lights with a red glow; let go, it comes back with an elastic and becomes Added with the tick drawing itself, then turns back to Add to cart. Until someone touches it, the wheel goes by itself to 2016, then to 2021, to 2018, presses Add to cart, moves to 2022 and comes back to 2019.

How it works

A spring on the wheel

The 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.

Dragging with a push

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.

The years on a cylinder

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 wine colour and the digits

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.

Values to change

NameFileDefaultWhat it changes
VINTAGESscript.js2016–2022The 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_YEARscript.js2019The vintage chosen when it opens.
ITEMscript.js66The distance between two years on the wheel, in pixels.
STIFFNESSscript.js240The spring that brings the wheel to the chosen year.
DAMPINGscript.js21Lower lets it pass the year and come back.
FLICKscript.js0.2How much the push of the finger counts when letting go of the wheel.
FADEscript.js0.42How much the years far from the centre fade.
SWELLscript.js1.045How much the pressed button swells.
SPEEDscript.js1The speed of the round on its own.
AUTOscript.jstrueThe wheel turning by itself through the vintages until someone touches it.
--accentstyle.css#7c1e2cThe wine red of the tick, the label and the glow.
--buttonstyle.css#1b1416The colour of the Add to cart button.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • The ticker writes the years’ scale and position on every frame: the cascading entrance of the years must end before the ticker wakes up, or the two cancel each other.
  • During a fast drag the year changes many times in a row: the pills timeline is killed and restarted on every change and the new word is written inside the timeline, so a pill is never left empty or with the old word.
  • A pill’s width is measured by writing the new word with width auto and is set back to the old one before the tween, in the same frame, otherwise the row jumped.
  • The wine colour is mixed from the colours drawn at that moment, not from the previous vintage’s: passing three years in a row gives no jumps in hue.
  • The wheel uses touch-action: pan-y, so on a phone the finger drags the years sideways without blocking the page scroll.

Libraries

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.

Testing

Tested on 17 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 components