Skip to content
animorio
IT
All components

Book a barber button

Buttons, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 7.7 KBGSAP 28 KBFreeDownload the zip

The Book a cut button of Oakline Barbers, a made-up barbershop, on black: in the pill the faces of the three barbers, the next free time and an ivory disc with a little barber pole whose red and blue stripes climb slowly. Pressed, the pill opens on the three barbers; pick one and their face moves in front of the others with a brass ring while their free times slide in. Pick a time and the drawer folds away, the pole spins fast while it books and turns into a tick, and the line reads the booking.

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>
<!--
  "Book a barber 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 barber booking button with the striped pole that spins while it confirms</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 Book a cut button of Oakline Barbers, a made-up barbershop: pressed, it opens on the three barbers,
         then on the free times of the one you choose; the little striped barber pole in the disc spins while it
         books, and turns into a tick -->
    <div class="wrap" data-wrap>
      <div class="card" data-card>
        <span class="card__glow" data-glow aria-hidden="true"></span>
        <div class="card__clip" aria-hidden="true"><span class="card__grain"></span><span class="card__sheen" data-sheen></span></div>

        <div class="top">
          <div class="faces" data-faces aria-hidden="true">
            <span class="face" data-face style="--c: var(--b1)">TH</span>
            <span class="face" data-face style="--c: var(--b2)">MO</span>
            <span class="face" data-face style="--c: var(--b3)">RI</span>
          </div>
          <div class="words" data-words aria-live="polite">
            <span class="state" data-state="rest"><b>Book a cut</b><small>Next free · Sat 10:30</small></span>
            <span class="state" data-state="barber"><b>Choose your barber</b><small>Oakline · 3 chairs today</small></span>
            <span class="state" data-state="time"><b data-time-title>Mo, Saturday</b><small>Pick a time</small></span>
            <span class="state" data-state="busy"><b>Booking</b><small data-busy-sub>Sat 11:15 with Mo</small></span>
            <span class="state" data-state="done"><b data-done-title>Sat 11:15 with Mo</b><small data-done-sub>Skin fade · 40 min · £28</small></span>
          </div>
          <span class="disc" data-disc aria-hidden="true">
            <svg class="pole" data-pole viewBox="0 0 20 34">
              <defs>
                <clipPath id="pole-clip"><rect x="5" y="5" width="10" height="24" rx="5"/></clipPath>
              </defs>
              <rect class="pole__base" x="5" y="5" width="10" height="24" rx="5"/>
              <g clip-path="url(#pole-clip)">
                <g data-stripes>
                  <path class="pole__red" d="M0 4 L20 -6 L20 -1 L0 9 Z M0 16 L20 6 L20 11 L0 21 Z M0 28 L20 18 L20 23 L0 33 Z M0 40 L20 30 L20 35 L0 45 Z M0 52 L20 42 L20 47 L0 57 Z"/>
                  <path class="pole__blue" d="M0 10 L20 0 L20 2.6 L0 12.6 Z M0 22 L20 12 L20 14.6 L0 24.6 Z M0 34 L20 24 L20 26.6 L0 36.6 Z M0 46 L20 36 L20 38.6 L0 48.6 Z M0 58 L20 48 L20 50.6 L0 60.6 Z"/>
                </g>
                <rect class="pole__shine" x="6.6" y="5" width="2.2" height="24" rx="1.1"/>
              </g>
              <rect class="pole__cap" x="4" y="2.4" width="12" height="3.4" rx="1.7"/>
              <rect class="pole__cap" x="4" y="28.2" width="12" height="3.4" rx="1.7"/>
            </svg>
            <svg class="tick" data-tick viewBox="0 0 24 24"><path data-tick-path d="M6.5 12.5l3.6 3.6 7.4-8.2"/></svg>
          </span>
          <button class="hit" type="button" data-book aria-label="Book a cut at Oakline Barbers"></button>
        </div>

        <div class="drawer" data-drawer>
          <div class="barbers" data-barbers role="group" aria-label="Barbers">
            <button class="barber" type="button" data-barber="0" style="--c: var(--b1)"><span class="barber__face">TH</span><span class="barber__name">Theo</span><span class="barber__next">10:30</span></button>
            <button class="barber" type="button" data-barber="1" style="--c: var(--b2)"><span class="barber__face">MO</span><span class="barber__name">Mo</span><span class="barber__next">11:15</span></button>
            <button class="barber" type="button" data-barber="2" style="--c: var(--b3)"><span class="barber__face">RI</span><span class="barber__name">Rina</span><span class="barber__next">13:00</span></button>
          </div>
          <div class="times" data-times role="group" aria-label="Free times">
            <button class="time" type="button" data-slot>11:15</button>
            <button class="time" type="button" data-slot>12:00</button>
            <button class="time" type="button" data-slot>14:45</button>
            <button class="time" type="button" data-slot>16:30</button>
          </div>
        </div>
      </div>

      <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3l13 7.4-5.7 1.5L9.6 18z"/></svg>
    </div>
  </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.

46 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 “Book a barber 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 black background there is a pill sixty-four pixels tall, warm graphite fading downwards, with a fine grain and a thread of light on the edge that follows the pointer. On the left the faces of the three barbers, Theo, Mo and Rina, overlapping; beside them Book a cut and below it the next free time. On the right an ivory disc holding a little barber pole: a white cylinder with brass caps and red and blue stripes climbing slowly, forever, like real poles, with a still highlight on the glass. On hover the pill lifts a pixel, the faces fan out a little, the words widen on the wdth axis and the stripes climb faster. Pressed, the pill gives, then grows downwards on a spring and the line rolls to Choose your barber: the three barbers come in one after the other, each with their face, name and first free time. Choose Mo and their card takes a brass edge while the others dim by half; up top their face moves in front of the others with a brass ring, the other two step back smaller and fainter, and the line says Mo, Saturday. Their four free times slide in from the left. Choose 11:15 and the time pill turns red with a little knock, the drawer folds away, the line says Booking and the pole speeds up until it spins round; at the end of the turn it shrinks and disappears, a green tick draws itself in its place, the pill gives a small beat, a light crosses it and the line says Sat 11:15 with Mo with the treatment and price below. A drawn pointer shows the whole loop on its own and starts again.

How it works

The pole that climbs by itself

The stripes are two SVG paths of parallelograms, red and blue, repeating every twelve units, clipped inside the cylinder with a clipPath. A single tween moves them up twelve units, linear and endless: since the drawing repeats, the loop does not show. The speed is that tween’s timeScale, which rises on hover, when the pill opens and while it books.

The pill that becomes a drawer

The pill is one element with hidden overflow: GSAP changes its height from sixty-four pixels to the measured height of the drawer, and its radius from 32 to 24, with back.out. The drawer is always there underneath, invisible until the pill uncovers it; the barbers and the times come in with a stagger.

The faces in a row

The three faces up top are absolute and GSAP lines them up with x; once a barber is chosen the order changes and their face goes first with the highest z-index and a brass ring made with a second box-shadow, while the others shrink and fade, each on its own spring.

The confirmation

One timeline: the drawer folds away, the line rolls to Booking, the pole speeds up and makes a full turn, then shrinks and makes way for the tick drawn with stroke-dashoffset; the pill gives a beat on an elastic and a shine crosses it.

Values to change

NameFileDefaultWhat it changes
SHOPscript.jsOaklineThe name of the shop, in the line under Choose your barber.
SERVICEscript.jsSkin fade · 40 min · £28The treatment and price under the finished booking.
POLE_SPEEDscript.js2.4How many seconds the pole stripes take to climb one turn, at rest.
SPINscript.js1.2How many seconds the pole spins fast while it confirms.
SPRINGscript.js0.75How long the spring that opens the pill and moves the faces lasts.
STAGGERscript.js0.06How many seconds between one barber (or time) coming in and the next.
HOLDscript.js3.2How many seconds the booking stays written before the autopilot starts again.

Try them in the Playground

When to use it

On the site of a barber, hairdresser or beautician, on the salon page of a booking app, next to the price list of cuts: wherever people should pick the person and the time without leaving the page.

On phones

The pill is as wide as the screen minus a margin, up to 352 pixels, and open it stays under 230 pixels tall; a finger picks the barbers and the times, which are at least 34 pixels tall. Without hover the faces do not fan out and the edge light stays in the middle.

With reduced motion

The pole stays still, no springs or spins: the pill takes its height at once, lines and parts cross-fade and the tick draws in place.

Pitfalls

  • The pole stripes must repeat exactly every twelve units, otherwise a jump shows at the end of each loop: the two paths are written by hand with the same step.
  • Buttons cannot sit inside a button: Book a cut is a transparent button laid over the top row, and the barbers and times are separate buttons in the drawer.
  • Faces laid out in flex would all move together: they are absolute, each with its own x, so the chosen one moves in front and the others step back on their own springs.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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