Skip to content
animorio
IT
All components

Porcelain bill button

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

The Request the bill button of a restaurant’s table app, in glazed white porcelain on a linen tablecloth lit by a window, like a Dribbble shot. Just inside its edge runs a line of gold still pale, unfired, like the rim of a plate. Pressed, a gilder’s brush paints the gold starting from the bill and going round both ways, with two bright beads of wet gold at its tips; then the gold is fired: a glint runs round it, a light crosses the glaze, the little well fills with cobalt glaze and a check, and the total turns blue.

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>
<!--
  "Porcelain bill 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 request the bill button in porcelain with the gold rim</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/opsz.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the Request the bill button of a restaurant's table app, glazed white porcelain with a pale, unfired gold line
         just inside its edge, like the rim of a plate. On the left a small porcelain well with a cobalt bill, on the
         right the total. Pressed, a gilder's brush paints the gold line from the bill all the way round, while the
         words shimmer; then the gold is fired, a glint runs round it, the bill turns to a check and the chip turns
         cobalt -->
    <div class="pb" data-wrap>
      <span class="pb__shadow" data-shadow aria-hidden="true"></span>
      <button class="pb__btn" type="button" data-btn data-autoclic aria-label="Request the bill for table 12, 86.40 euros">
        <span class="pb__body" data-body>
          <span class="pb__glaze" aria-hidden="true"></span>
          <span class="pb__window" aria-hidden="true"><span class="pb__window-pane" data-window></span></span>
          <span class="pb__shine" data-shine aria-hidden="true"></span>
          <span class="pb__sweep" aria-hidden="true"><span class="pb__sweep-band" data-sweep></span></span>
          <svg class="pb__gold" data-gold aria-hidden="true">
            <defs>
              <linearGradient id="pb-gold" data-grad gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="320" y2="0">
                <stop offset="0" stop-color="#9c7433"/>
                <stop offset="0.16" stop-color="#ecd393"/>
                <stop offset="0.33" stop-color="#b4863c"/>
                <stop offset="0.52" stop-color="#f6e6b4"/>
                <stop offset="0.7" stop-color="#a97c36"/>
                <stop offset="0.86" stop-color="#e3c47e"/>
                <stop offset="1" stop-color="#a27632"/>
              </linearGradient>
            </defs>
            <path class="pb__ghost" data-ghost/>
            <g class="pb__fired" data-fired>
              <path class="pb__line" data-line-a pathLength="1"/>
              <path class="pb__line" data-line-b pathLength="1"/>
            </g>
            <path class="pb__glint" data-glint pathLength="1"/>
          </svg>
          <span class="pb__tip" data-tip aria-hidden="true"></span>
          <span class="pb__tip" data-tip aria-hidden="true"></span>
          <span class="pb__edge" data-edge aria-hidden="true"></span>
          <span class="pb__rim" aria-hidden="true"></span>
          <span class="pb__row">
            <span class="pb__well" aria-hidden="true">
              <span class="pb__well-face" data-well>
                <svg class="pb__bill" data-bill viewBox="0 0 24 24">
                  <path class="pb__bill-paper" d="M7 4.6h10v15.2l-1.67-1.1-1.66 1.1-1.67-1.1-1.67 1.1-1.66-1.1L7 19.8z"/>
                  <path class="pb__bill-ln" data-ln pathLength="1" d="M9.4 8.4h5.2"/>
                  <path class="pb__bill-ln" data-ln pathLength="1" d="M9.4 11.2h5.2"/>
                  <path class="pb__bill-ln" data-ln pathLength="1" d="M9.4 14h3"/>
                </svg>
                <svg class="pb__check" viewBox="0 0 24 24"><path data-check pathLength="1" d="M6.8 12.5l3.4 3.4 7-7.2"/></svg>
              </span>
            </span>
            <span class="pb__text" aria-hidden="true">
              <span class="pb__state" data-state>
                <span class="pb__title" data-t>Request the bill</span>
                <span class="pb__sub" data-s>Table 12 · 3 guests</span>
              </span>
              <span class="pb__state" data-state>
                <span class="pb__title pb__title--busy" data-t>Preparing bill</span>
                <span class="pb__sub" data-s>Printing at the counter</span>
              </span>
              <span class="pb__state" data-state>
                <span class="pb__title" data-t>On its way</span>
                <span class="pb__sub" data-s>Your server is coming</span>
              </span>
            </span>
            <span class="pb__chip" data-chip-box aria-hidden="true">
              <span class="pb__chip-glaze" data-chip-glaze></span>
              <span class="pb__chip-main" data-chip-main>&euro;86.40</span>
              <span class="pb__chip-each" data-chip-each>&euro;28.80 each</span>
            </span>
          </span>
        </span>
      </button>
    </div>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

26 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 “Porcelain bill 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 sand coloured linen tablecloth, with window light coming from the upper left and a very fine grain, a single pill button 60 pixels tall in glazed white porcelain: bright where the window catches it, a little grey and cool where it turns under, with a rolled edge that makes a line of light on top and a long warm shadow on the linen. The window is mirrored in the glaze, two panes split by a mullion, and just inside the edge runs a line of gold still pale and matte, like gold paste before it goes into the kiln. On the left a small well pressed into the porcelain with a cobalt blue bill; in the middle Request the bill, in a serif face, with Table 12 · 3 guests under it; on the right the total, €86.40, in a hollow of the glaze. With the mouse over it the button rises a pixel and a half and the shadow stretches, the window’s reflection slides towards the pointer, a white arc runs along the edge to stay on its side, the bill rises and tilts a little and the total gives way to the share per guest, €28.80 each. Pressed, the porcelain sinks and springs back; the words become Preparing bill with a gold reflection passing through, Printing at the counter under them, the bill’s lines print one after another, and a gilder’s brush paints the gold line starting next to the bill and going round over the top and under the bottom at once to the other end, with two beads of wet, shiny gold at its tips that slow down in the curves. When the two strokes meet the gold is fired: a white glint runs all the way round it, a light crosses the glaze, the bill sinks into the well, which fills with cobalt glaze, and a white check draws itself, the total is glazed cobalt from the left and turns white, the button swells by a hair and says On its way, Your server is coming. After a moment the gold goes pale again, the cobalt drains away and the bill comes back up. Until someone touches it, the button goes round by itself.

How it works

Porcelain in layers

The button is a single box (moved only by GSAP) with absolute layers: the glaze made of three gradients (the window light, the cool turn underneath, the body), the window’s reflection with its mullion cut by a mask, the light under the pointer in soft-light, the success light and on top the rolled edge made of inset shadows. Outside, a blurred shadow wider at the bottom, which stretches when the button rises.

The gold line in pixels

An SVG as big as the pill, measured on resize, with three paths built in pixels 4.5 from the edge: the pale paste going all the way round, and two half loops starting next to the bill, one over the top and one under the bottom, with pathLength 1. The stroke takes a userSpaceOnUse linearGradient in light and dark bands, like burnished gold.

The brush

A single number from 0 to 1, moved by GSAP with power1.inOut, sets the strokeDashoffset of both half loops; on every frame getPointAtLength on the real length carries the two beads of gold (radial gradients) to the tips of the strokes. Meanwhile a looping timeline prints the bill’s lines with staggered strokeDashoffset.

Fired gold

A fourth path, the whole loop, has a 0.07 stroke-dasharray with a double warm drop-shadow: the glint runs with strokeDashoffset from 0.08 to −0.98. A slanted white band crosses the glaze with xPercent, the well fills with cobalt by animating two CSS variables (scale and opacity of its ::after) on a spring, and the total is glazed with a clip-path inset.

The light that follows

The white arc on the edge is a conic-gradient cut down to the edge by mask-composite (exclude, and xor for WebKit), with the pointer’s angle always taken the short way round; the window’s reflection slides and widens a little with two quickTo calls, as on a curved glaze.

Values to change

NameFileDefaultWhat it changes
TOTALscript.js86.4The bill’s total, in euros.
GUESTSscript.js3How many guests share it, for the share shown on hover.
TABLEscript.js12The table number.
DONEscript.jsOn its wayWhat the button says when the bill is coming.
WORKscript.js1.8How many seconds the brush takes to paint the gold all the way round.
GLINTscript.js1The strength of the glint and the sweep when the gold is fired: 0 none, 1.5 bright.
SPRINGscript.js1How springy the moves are: 0.4 calm, 2 very bouncy.
HOLDscript.js2How many seconds the success stays before going back to rest.
AUTOscript.jstrueThe button goes round by itself until someone touches it.

Try them in the Playground

When to use it

For the table app or the QR menu of a restaurant, a trattoria, a hotel bar or a bistro: asking for the bill without raising a hand, with the total and the share per guest already in view. It works in plain sight while the till prints and ends with an elegant moment, fit for a well kept place.

On phones

On the phone the button is at most 86% of the screen wide and the words get a point smaller; there is no hover, so at the touch the light and the edge arc turn towards the finger and the window’s reflection follows it, and the rest is the same.

With reduced motion

Nothing moves: the words and the total change in place with a fade, the gold line fades in whole instead of being painted, the bill gives way to the cobalt and the check and the total turns blue with a fade; no glint and no sweeping light.

Pitfalls

  • A rect with pathLength 1 starts at its top left corner, and the brush began far from the bill: the paths are written by hand in pixels and start at the pill’s left end, one for the top and one for the bottom.
  • With preserveAspectRatio none the gold line was distorted in the curves: the SVG is measured in pixels on resize, with a radius of half the height minus the margin.
  • The beads of gold with the normalised length ended up off the stroke: getPointAtLength wants the real length, taken with getTotalLength at every measure.
  • The loop started when the script was read, and the poster landed on different moments: it starts from the page’s load event.

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 3 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