Skip to content
animorio
IT
All components

Iced latte order button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 9.1 KBGSAP 28 KBFreeDownload the zip

A coffee bar’s order button, in the style of product interface pieces, on a warm white: the pill’s round window holds a glass seen from the side, with ice at the bottom. On click the cold brew pours and rises with a rippling surface, the cubes lift off and float up, the milk falls through in clouds and curls into the coffee, condensation beads on the cold glass and a drop runs down, the straw drops in and looks broken under the surface; the button says «Ready in 4 min» with the digit rolling.

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>
<!--
  "Iced latte order 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 iced latte button with the glass that fills up</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 button: tap it, cold brew pours over the ice in the glass,
         the cubes float up, milk falls through in clouds, a straw drops in and the order is ready -->
    <div class="order" data-order>
      <p class="order__top">
        <span class="order__shop">Fernhill Coffee</span>
        <span class="order__where">Bar 2 · pick up at the counter</span>
      </p>

      <button class="btn" type="button" data-btn data-autoclic aria-pressed="false">
        <span class="btn__glass" data-window aria-hidden="true">
          <svg class="glass" data-glass viewBox="0 -4 60 78">
            <defs>
              <clipPath id="dentro"><path d="M14.7 11.2 45.3 11.2 42.6 63.6 17.4 63.6Z"/></clipPath>
              <linearGradient id="caffe" x1="0" y1="0" x2="0" y2="1">
                <stop offset="0" stop-color="#7a4b2a"/>
                <stop offset="0.35" stop-color="#4a2a17"/>
                <stop offset="1" stop-color="#2a170c"/>
              </linearGradient>
              <linearGradient id="latte" x1="0" y1="0" x2="0" y2="1">
                <stop offset="0" stop-color="#f3e6d3"/>
                <stop offset="0.6" stop-color="#d8bb98" stop-opacity=".85"/>
                <stop offset="1" stop-color="#b98c62" stop-opacity="0"/>
              </linearGradient>
              <linearGradient id="vetro" x1="0" y1="0" x2="1" y2="0">
                <stop offset="0" stop-color="#ffffff" stop-opacity=".55"/>
                <stop offset="0.12" stop-color="#ffffff" stop-opacity=".08"/>
                <stop offset="0.8" stop-color="#ffffff" stop-opacity=".04"/>
                <stop offset="1" stop-color="#ffffff" stop-opacity=".35"/>
              </linearGradient>
              <linearGradient id="fondo-vetro" x1="0" y1="0" x2="0" y2="1">
                <stop offset="0" stop-color="#e9eef0" stop-opacity=".7"/>
                <stop offset="1" stop-color="#b7c2c6" stop-opacity=".85"/>
              </linearGradient>
              <filter id="nuvola" x="-30%" y="-30%" width="160%" height="160%"><feGaussianBlur stdDeviation="1.7"/></filter>
              <clipPath id="sopra"><rect data-clip-up x="0" y="-10" width="60" height="40"/></clipPath>
              <clipPath id="sotto"><rect data-clip-down x="0" y="30" width="60" height="50"/></clipPath>
            </defs>

            <!-- the shadow on the bar and the glass body behind everything -->
            <ellipse class="glass__ombra" cx="31" cy="70.6" rx="17" ry="2.2"/>
            <path class="glass__corpo" d="M13.4 10 46.6 10 43.6 69 16.4 69Z"/>

            <!-- the stream from the tap, cold brew then milk -->
            <rect data-stream x="29" y="-12" width="2" height="0" rx="1" fill="#4a2a17"/>

            <g clip-path="url(#dentro)">
              <path data-coffee fill="url(#caffe)" d=""/>
              <path data-cream fill="url(#latte)" d="" opacity="0"/>
              <g data-clouds filter="url(#nuvola)"></g>
              <!-- the straw: the part under the surface is shifted, like light bending in the drink -->
              <g data-straw-under opacity="0" clip-path="url(#sotto)">
                <g transform="translate(1.6 0)"><line class="straw straw--sotto" x1="38" y1="-14" x2="24.5" y2="62"/><line class="straw__righe straw--sotto" x1="38" y1="-14" x2="24.5" y2="62"/></g>
              </g>
              <g data-ice></g>
              <path data-surface class="glass__pelo" d=""/>
            </g>

            <!-- the straw above the surface (and above the rim) -->
            <g data-straw-over opacity="0" clip-path="url(#sopra)">
              <line class="straw" x1="38" y1="-14" x2="24.5" y2="62"/><line class="straw__righe" x1="38" y1="-14" x2="24.5" y2="62"/>
            </g>

            <!-- glass: thick base, rim, highlights -->
            <path class="glass__base" d="M17.4 63.6 42.6 63.6 43.6 69 16.4 69Z"/>
            <path class="glass__vetro" d="M13.4 10 46.6 10 43.6 69 16.4 69Z"/>
            <path class="glass__luce" d="M16.2 13.5 18.3 60"/>
            <path class="glass__luce glass__luce--fine" d="M43.2 14 41.6 52"/>
            <ellipse class="glass__bordo" cx="30" cy="10" rx="16.6" ry="1.5"/>
            <g data-drops></g>
          </svg>
        </span>

        <span class="btn__words">
          <span class="btn__label" data-idle><span class="btn__what">Order · Iced latte</span><span class="btn__price">€4.20</span></span>
          <span class="btn__label btn__label--busy" data-busy aria-hidden="true">Pouring your latte</span>
          <span class="btn__label btn__label--done" data-done aria-hidden="true">Ready in
            <span class="roll" data-roll><span class="roll__col" data-roll-col></span></span> min</span>
        </span>
      </button>

      <p class="order__note">
        <span class="order__state" data-note-idle>Oat milk · extra ice · to take away</span>
        <span class="order__state order__state--done" data-note-done aria-hidden="true">
          <svg class="tick" viewBox="0 0 16 16"><path data-tick d="M3.5 8.4 6.6 11.4 12.6 4.8"/></svg>
          Order 58 · we’ll call your name
        </span>
      </p>
    </div>

    <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 “Iced latte order 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

On a warm white there is the line «Fernhill Coffee» with «Bar 2 · pick up at the counter», below it an almost black pill with «Order · Iced latte» and the price €4.20, and below that «Oat milk · extra ice · to take away». On the left the pill has a round window that pokes out above and below: inside, on a light counter, a glass seen from the side, a little narrower at the bottom, with a thick base, the rim, two glints on the glass and the shadow on the counter; at the bottom three ice cubes piled up. Hovering tilts the glass and the cubes clink. On click the pill gives and comes back on a spring, the label becomes «Pouring your latte» and a thread of cold brew comes down and fills the glass: the surface ripples as it rises, and when it reaches the cubes they lift off, float up one after another and stay there bobbing. Then a thread of milk comes down: the top of the coffee turns lighter and the milk sinks in soft clouds that spread and curl. Meanwhile the glass gets cold and fills with beads of condensation, and a bigger drop runs down its side leaving a clear trail. At the end a caramel striped paper straw drops in and knocks the cubes: under the surface it is shifted sideways, like a real straw seen through the glass. The label becomes «Ready in 4 min», with the digit rolling in from 9 to 4, and below the tick of «Order 58 · we’ll call your name» draws itself. On a second click the full glass slides off to the right and an empty one comes in from the left, with the cubes dropping in and bouncing. A drawn pointer runs the loop by itself and steps aside at the first real touch.

How it works

One drawing, redrawn every frame

The glass is an SVG, but the liquid is not animated piece by piece with GSAP: GSAP animates a few numbers (the level, the milk, the clouds, the ripple, the cold, the straw) and a loop on the ticker redraws from those numbers the surface, the coffee, the milk band, the clouds, the falling thread, the cubes and the condensation. So everything stays consistent: the thread always ends on the surface, the straw always breaks at the surface.

The rippling surface

The coffee’s edge is a line of points every two units, raised by two sines with different frequencies that slide over time; their amplitude is the «ripple», which grows while the thread falls and settles with a soft ease-out. All the liquid sits in a clipPath with the inner shape of the glass, narrower at the bottom.

Ice on springs

Each cube has a real spring, with velocity and damping: it sits at the bottom until the liquid reaches it, then its target becomes the surface and it rises there by itself, with the right bob. A knock (the straw, the hover) is just a push on its velocity.

The milk clouds

The milk is a light band under the surface, with a gradient that fades to nothing, plus eight ellipses blurred by a Gaussian filter: they are born under the thread, sink to different depths, spread and swirl left and right on a slow sine.

The broken straw

The straw is drawn twice: above the liquid, clipped by a rectangle that ends at the surface, and below the liquid, clipped by the complementary rectangle and shifted by 1.6 units. Every frame both rectangles follow the surface, so the refraction kink always stays at the surface.

The condensation

Sixteen droplets with a highlight, placed on the glass mostly towards the sides with fixed numbers, appear one after another as the «cold» rises; then a bigger drop runs down the side and leaves a clearer trail.

Values to change

NameFileDefaultWhat it changes
POURscript.js2.2How long the cold brew takes to pour over the ice, in seconds.
MILKscript.js1.6How long the milk takes to pour and fall through in clouds, in seconds.
HOLDscript.js3.2How many seconds it stays ready before the loop starts again by itself.
MINUTESscript.js4The waiting minutes written on the button once the order is placed.
INKscript.js#17120eThe colour of the pill.
ACCENTscript.js#c9813fThe caramel colour: the straw’s stripes, the digits and the tick.

Try them in the Playground

When to use it

For the order button of a bar, a coffee shop or a drinks ordering app, where the wait is part of the pleasure: the glass filling up tells you what is happening on the other side of the counter.

On phones

On the phone the pill takes the screen’s width (at most 372 pixels with a 16-pixel margin) and the glass window shrinks to 86 pixels; there is no hover, everything else is the same.

With reduced motion

The glass fills with a fade, without the falling thread, without ripples and without bouncing cubes; the straw and the labels appear with a fade and the drawn pointer is not shown.

Pitfalls

  • The liquid is redrawn from the ticker with the real time step, and the ice springs use exponential damping on that step: with a fixed step, on a 120 Hz screen the cubes would rise twice as fast.
  • The round window is moved with the CSS translate property and the glass inside it with GSAP: on the same element GSAP’s transform would wipe out the CSS translate.
  • The two rectangles that clip the straw must be updated every frame together with the surface: updated only at the end, the kink would sit in the wrong place while filling.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 30 October 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