Skip to content
animorio
IT
All components

Order ahead button

Buttons, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 7.5 KBGSAP 28 KBFreeDownload the zip

A coffee bar's order-ahead button on white: an espresso-lacquer pill with a porcelain cup in the round window and a thread of steam rising slowly. On hover the steam stands up and slips out of the pill; on click the order goes («Sending order»), the wisps rise tall and sway, then gather one after the other into the check, while the cup sinks, caramel fills the disc and the label becomes «Ready at» with the time and «Bar 2».

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>
<!--
  "Order ahead button" 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 Order ahead button with the cup steam that becomes the check</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" data-stage>
    <!-- a coffee bar's order-ahead button: the cup in the round end steams,
         the order goes to the bar, and the steam gathers itself into the check -->
    <button class="btn" type="button" data-btn data-autoclic>
      <span class="btn__light" aria-hidden="true"></span>

      <svg class="cup" data-cup-svg viewBox="0 0 64 96" aria-hidden="true">
        <defs>
          <clipPath id="disco"><circle cx="32" cy="74" r="22"/></clipPath>
          <radialGradient id="fondo-disco" cx="0.38" cy="0.3" r="0.8">
            <stop offset="0" stop-color="#3a2b21"/>
            <stop offset="1" stop-color="#1f1610"/>
          </radialGradient>
          <radialGradient id="caramello" cx="0.4" cy="0.32" r="0.85">
            <stop offset="0" stop-color="#e0a463"/>
            <stop offset="0.6" stop-color="#c7843f"/>
            <stop offset="1" stop-color="#a6672d"/>
          </radialGradient>
          <linearGradient id="vapore" gradientUnits="userSpaceOnUse" x1="0" y1="68" x2="0" y2="4">
            <stop offset="0" style="stop-color: var(--vapore)" stop-opacity="0.95"/>
            <stop offset="0.35" style="stop-color: var(--vapore)" stop-opacity="0.7"/>
            <stop offset="1" style="stop-color: var(--vapore)" stop-opacity="0"/>
          </linearGradient>
          <linearGradient id="porcellana" x1="0" y1="0" x2="1" y2="0">
            <stop offset="0" stop-color="#fbf5ec"/>
            <stop offset="0.55" stop-color="#efe3d2"/>
            <stop offset="1" stop-color="#cdbba5"/>
          </linearGradient>
        </defs>

        <!-- the round window: dark, then the caramel that fills it from below when the order is in -->
        <circle class="cup__disc" cx="32" cy="74" r="22" fill="url(#fondo-disco)"/>
        <g clip-path="url(#disco)">
          <circle data-fill cx="32" cy="74" r="22" fill="url(#caramello)"/>
          <g data-cup>
            <ellipse class="cup__shadow" cx="32" cy="83.6" rx="12" ry="1.6"/>
            <path class="cup__saucer" d="M19.6 83 H44.4"/>
            <path class="cup__handle" d="M40.2 69.6 h1.4 a3.1 3.1 0 0 1 0 6.2 h-2.2"/>
            <path class="cup__body" d="M23.4 67 H40.6 V72.4 C40.6 77.4 37 81 32 81 C27 81 23.4 77.4 23.4 72.4 Z" fill="url(#porcellana)"/>
            <ellipse class="cup__coffee" cx="32" cy="67.1" rx="8.4" ry="1.3"/>
            <path class="cup__glint" d="M25.6 69.4 V73.2"/>
          </g>
          <path class="cup__rimlight" d="M14.6 66 A22 22 0 0 1 30 52.1"/>
        </g>
        <circle class="cup__ring" data-ring cx="32" cy="74" r="23.4"/>

        <!-- the steam: each wisp is redrawn every frame; at the end the wisps are pulled into the check -->
        <g data-wisps fill="none" stroke="url(#vapore)" stroke-linecap="round" stroke-linejoin="round"></g>
        <path class="cup__check" data-check d=""/>
      </svg>

      <span class="btn__words">
        <span class="btn__label" data-idle><span class="btn__what">Order ahead</span></span>
        <span class="btn__label" data-busy aria-hidden="true">Sending order</span>
        <span class="btn__label" data-done aria-hidden="true">Ready at <span data-time>8:42</span></span>
      </span>
      <span class="btn__side">
        <span class="btn__price" data-price>€3.80</span>
        <span class="btn__paid" data-paid aria-hidden="true">Bar 2</span>
      </span>
    </button>
    <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.

20 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 “Order ahead button” 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

A 60 pixel espresso-coloured pill, with a one pixel edge catching the light on top and three soft shadows on the white. In the round window sits a porcelain cup on its saucer, and three wisps of steam drawn every frame rise from it. On hover (or with the Tab key) the steam stands up and slips out above the pill, a warm light follows the pointer and «Order ahead» widens on the wdth axis; pressed, the pill sinks a hair. On click the label rolls to «Sending order», the cup trembles, the steam rises tall and sways; after a moment the wisps are pulled down one after another, swing past and settle on the same broken line: the check. Meanwhile the cup sinks out of the window, caramel fills the disc from below on a spring, a ring opens and fades, the pill gives a small bump and «Ready at» arrives with the time and «Bar 2». A few seconds later (or with another click) the check unwinds, the cup comes back up and the steam starts again, slowly.

How it works

Steam redrawn

Each wisp is a 26 point path rewritten every frame: x is the sum of two sines (a wave and a longer curl) running in time, with the amplitude growing as it rises and a drift to the right; each wisp has its own phase, pace and wavelength, so they never move together. The fade is a userSpaceOnUse linearGradient on the vertical axis: the steam vanishes as it rises, on the brown pill and on the white.

From steam to check

The check is sampled by arc length, so every point of the wisp has its own place on the broken line. A value m per wisp, 0 to 1 with power2.inOut, blends the live steam into the check, with a sin(π m) swing that carries it past and lets it settle. When m passes 0.78 the wisps fade and the identical check path lights up in their place: the swap cannot be seen.

The disc fills

Inside the round window (a clipPath) the caramel disc grows from the bottom with back.out while the cup sinks with power3.in; the ring around it opens on a spring, then widens and fades. Going back unwinds the check with stroke-dashoffset and returns the cup with elastic.out.

Labels and light

The three labels share one 22 pixel row: they leave upwards widening on the wdth axis and the new one comes in from below, narrow, with back.out. The warm light is a radial-gradient following the pointer through the --mx and --my variables; --luce turns it on for hover and during the order.

States and pilot

Rest, hover (and focus), pressed, in progress with aria-busy, done with an aria-live announcement, and back by itself or with a click. A drawn pointer comes in, rests on the button, orders and waits for the whole round; at the first real touch it stops and starts again after six quiet seconds.

Values to change

NameFileDefaultWhat it changes
BREWscript.js1.8Seconds of full steam while the order goes to the bar.
GATHERscript.js1.1Seconds for the wisps to gather into the check.
HOLDscript.js3.4Seconds «Ready at» stays before going back to rest.
MINUTESscript.js6Minutes from now for the «Ready at» time.
WISPSscript.js3How many wisps of steam rise from the cup.
STEAM_HEIGHTscript.js40Pixels the steam rises above the cup while it brews.
DRIFTscript.js1How much the wisps sway (0 straight).
ACCENTscript.js#c98a4bThe caramel colour: the ring and the focus.
STEAMscript.js#bba893The steam colour.

Try them in the Playground

When to use it

In the app or site of a coffee bar, a cafe or a restaurant with takeaway: the button to order before you arrive and pick up at the counter. It also suits a bakery or a kiosk, swapping the cup.

On phones

The same animation: the pill is at most the screen width minus 32 pixels and the steam stays above it, inside the frame. A tap is hover and click together.

With reduced motion

Nothing moves: the steam stays still and faint, labels swap with a fade, the check, the caramel disc and «Ready at» arrive already in place; the pilot's pointer is hidden.

Pitfalls

  • The steam colour sat in var(--vapore) inside the stop-color attribute, which does not read CSS variables: the gradient went black. Moved into style="stop-color: var(--vapore)" it works and follows the knob.
  • The sinking cup left its saucer showing at the bottom of the caramel disc: now it sinks 34 pixels and fades at the same time.
  • «Sending to the bar» did not fit next to the cup in a 256 pixel pill and was cut off: it became «Sending order».

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 7.5 KB; the libraries: GSAP 28 KB.

Testing

Tested on 10 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