Skip to content
animorio
IT
Back to the library

Wine by the glass

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The by the glass wine list of a made-up wine bar, Saltmarsh, in the premium style of the interface pieces: above the list sits an aroma wheel drawn in thin SVG lines, with the families inside and the notes outside. Choosing a wine turns the wheel on a spring until the leading note sits under the notch, the wine’s notes draw themselves around the rings in the colour of the wine, the glass seen from above in the middle takes that colour with a ripple, and body, acidity and tannin settle on their meters. Add a glass puts the wine in the flight and the number in the header rolls.

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>
<!--
  "Wine by the glass" 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>Saltmarsh Wine Bar, tonight's pours by the glass</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 by-the-glass list of a made-up wine bar, Saltmarsh. Above the list sits an aroma wheel drawn in thin SVG
         lines: families inside, notes outside. Choosing a wine turns the wheel until its leading note faces the notch,
         its notes draw themselves around the rings in the colour of the wine, the glass seen from above in the middle
         takes that colour with a small ripple, and body, acidity and tannin settle on their meters. Add a glass puts
         the wine in tonight's flight and the count in the header rolls -->
    <section class="card" data-card aria-label="Wines by the glass">
      <span class="card__sheen" aria-hidden="true"></span>
      <span class="card__grain" aria-hidden="true"></span>

      <header class="head">
        <div class="head__who">
          <svg class="head__mark" viewBox="0 0 24 24" aria-hidden="true"><rect x="2.5" y="2.5" width="19" height="19" rx="6"></rect><path d="M8.6 6.4h6.8c.3 2.9-.6 5.2-3.4 5.6-2.8-.4-3.7-2.7-3.4-5.6ZM12 12v5M9.4 17.4h5.2"></path></svg>
          <div>
            <p class="head__brand">Saltmarsh Wine Bar <span class="head__sep">·</span> By the glass</p>
            <h1 class="head__title">Tonight’s pours</h1>
          </div>
        </div>
        <p class="flight" data-flight>
          <span>Flight</span>
          <span class="flight__n"><span class="flight__roll" data-roll>0</span></span>
        </p>
      </header>

      <div class="read">
        <div class="wheel" aria-hidden="true">
          <svg class="wheel__svg" viewBox="-100 -100 200 200">
            <defs>
              <radialGradient id="pour" cx="42%" cy="38%" r="70%">
                <stop offset="0" data-stop="a"></stop>
                <stop offset="0.72" data-stop="b"></stop>
                <stop offset="1" data-stop="c"></stop>
              </radialGradient>
              <filter id="soft" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur stdDeviation="2.4"></feGaussianBlur></filter>
            </defs>
            <circle class="wheel__plate" r="97"></circle>
            <g data-spin>
              <g data-ticks></g>
              <g data-base></g>
              <g data-on></g>
              <g data-spikes></g>
              <g class="wheel__labels" data-labels></g>
            </g>
            <path class="wheel__notch" d="M-4.4 -106.5 0 -99.6 4.4 -106.5Z"></path>
            <g class="glass" data-glass>
              <circle class="glass__shadow" r="25" cy="2.2" filter="url(#soft)"></circle>
              <circle class="glass__wine" r="24" fill="url(#pour)" data-wine></circle>
              <circle class="glass__rim" r="23.2"></circle>
              <circle class="glass__ripple" r="24" data-ripple></circle>
              <path class="glass__shine" d="M-15.5 -9.5a18.5 18.5 0 0 1 12-9.6"></path>
              <circle class="glass__edge" r="28.6"></circle>
            </g>
          </svg>
        </div>

        <div class="nose">
          <p class="nose__lab">Leading note</p>
          <p class="nose__note"><span class="nose__roll" data-lead>Citrus</span></p>
          <p class="nose__fam" data-fam>Fruit</p>
          <div class="meters">
            <div class="meter" data-meter="body"><span class="meter__lab">Body</span><span class="meter__track"><span class="meter__fill"></span></span><span class="meter__val">0</span></div>
            <div class="meter" data-meter="acid"><span class="meter__lab">Acidity</span><span class="meter__track"><span class="meter__fill"></span></span><span class="meter__val">0</span></div>
            <div class="meter" data-meter="tannin"><span class="meter__lab">Tannin</span><span class="meter__track"><span class="meter__fill"></span></span><span class="meter__val">0</span></div>
          </div>
        </div>
      </div>

      <ul class="list" data-list></ul>

      <footer class="foot">
        <p class="foot__note" data-note>125 ml pour, served at 9°C</p>
        <button type="button" class="add" data-add aria-pressed="false">
          <span class="add__face"></span>
          <svg class="add__ico" viewBox="0 0 16 16" aria-hidden="true"><path class="add__v" d="M8 3.6v8.8"></path><path class="add__h" d="M3.6 8h8.8"></path>
            <path class="add__tick" d="M3.4 8.4 6.5 11.3 12.6 4.8" pathLength="1" stroke-dasharray="1 1" stroke-dashoffset="1"></path></svg>
          <span class="add__label"><span class="add__idle">Add a glass</span><span class="add__done">In your flight</span></span>
          <span class="add__price"><span data-price>$13</span></span>
        </button>
      </footer>
    </section>
    <p class="sr" data-live aria-live="polite"></p>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </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.

34 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 “Wine by the glass” 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 warm white ground sits the white card of the by the glass list of Saltmarsh, a made-up wine bar: at the top the mark with a glass, Saltmarsh Wine Bar · By the glass, the title Tonight’s pours and on the right the Flight pill with the number in a black circle. Below, on the left, the aroma wheel drawn in thin lines: an inner ring with six families (Fruit, Floral, Herbal, Spice, Earth, Oak), an outer one with nineteen notes, the ticks on the edge and the family names running along the circle; in the middle the glass seen from above, a disc of wine with its highlight. On the right the leading note in large type, its family and three thin meters: Body, Acidity, Tannin. Then the list: Albariño, Rosé de Provence, Nebbiolo and Syrah, with the region, the vintage and the price by the glass. When the pointer moves onto a wine the row lifts on a white ground with the wine’s light following it and the others fade back; the wheel turns on a spring until the wine’s leading note sits under the black notch, the notes that are gone slide away, the new ones draw one after the other clockwise in the colour of the wine, fuller the stronger they are, with an extra stroke outside for the strongest, and a thin bracket frames the note under the notch. The glass changes colour, from straw to salmon, to garnet, to purple, with a small bump and a ripple; the note name, the family, the numbers and the price roll; the meters stretch on a spring. The family names flip by themselves to stay upright. Add a glass turns into In your flight with a tick that draws itself, a tick appears next to the row’s price and the Flight number rolls up. Left alone, a drawn pointer goes over the wines, adds two and at the end everything goes back as it was.

How it works

A wheel made of arcs

Each family and each note is an SVG arc with a thick stroke, worked out from a start angle and an end angle. Over each grey arc sits an identical one in the colour of the wine, with pathLength="1": GSAP takes strokeDashoffset from 1 to 0 to draw it, and to -1 to slide it away. With autoRound off in gsap.defaults the stroke does not jump to whole pixels.

The short way to the notch

The rotation that brings the leading note to the top comes from the difference between the current angle and the new one, folded between -180 and 180 degrees: the wheel always takes the short way and stops with elastic.out. The notes draw in the order they sit after the turn, starting from the notch.

One colour that everything follows

The colour of the wine lives in a CSS variable, --wine, and in the three stops of the glass gradient: a tween from 0 to 1 mixes the colours with gsap.utils.interpolate and writes them back every frame, so arcs, meters, the row light and the button change together.

Values to change

NameFileDefaultWhat it changes
TURNscript.js1.25How long the wheel takes to turn to the leading note, in seconds.
SPRINGscript.js0.55How springy the wheel stops on the notch (lower swings more).
DRAWscript.js0.7How long each note takes to draw its arc, in seconds.
STAGGERscript.js0.045The delay between one note and the next as they draw around the wheel.
DIMscript.js0.45How far the other wines step back while one is chosen (1 for not at all).
PAUSEscript.js2.1Left alone: how many seconds it stays on each wine.
LOOPscript.jstrueLeft alone, a pointer goes over the wines and adds two.
--accentstyle.css#8c1d3bThe starting wine red, before the colour of the chosen wine arrives.
--basestyle.css#f1ebe6The colour of the unlit arcs and of the meter tracks.
--bgstyle.css#f2eee8The warm white of the ground.

Try them in the Playground

When to use it

For the wine list of a wine bar, a wine shop or a restaurant: whoever moves over the wines sees at once what they smell like and how structured they are without reading a tech sheet, and builds a by the glass flight from the same page.

On phones

The same animation with adapted measures: the card is sized on width and height together and fits the box, wheel included; on the phone you tap a wine to choose it and the button to add it.

With reduced motion

No movement: the wheel is already turned to the right note, the arcs are already drawn, the colour of the glass crossfades and the numbers simply change.

Pitfalls

  • GSAP rounds to whole pixels even strokeDashoffset: with pathLength="1" the arcs jumped from empty to full. It is turned off with gsap.defaults({ autoRound: false }) and an empty plugin called autoRound.
  • The family names turn with the wheel and ended upside down: each name has two arcs, one clockwise and one the other way, and after each turn the textPath switches to the one that keeps it upright, with a quick fade.
  • Rotating inside the SVG needs svgOrigin "0 0" (the centre of the viewBox), not transformOrigin: otherwise the wheel turns around its bounding box and wobbles.

Libraries

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.

Testing

Tested on 16 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 animations