Skip to content
animorio
IT
All components

Barber picker

Pickers, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The booking card of Ashby Barber Co., a made-up barbershop, alone on black in the premium product style. Pick the barber: the copper light springs onto their tile, the ring of the monogram turns and the eight times of the day rearrange for them, the taken ones crossed by a thin line and the free count rolling. Pick a time: the copper pill slides onto it and the button says what you are booking. Press it: a copper light runs around the edge, then the tick, the card lights up and the reminder switches itself on with the bell swinging.

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>
<!--
  "Barber picker" 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 picker with the free times that rearrange</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 booking card of a made-up barbershop: pick your barber and the free times of that barber rearrange,
         pick a time and book it; the button runs a copper light around its edge, ticks, and the reminder switches on -->
    <section class="book" data-book aria-label="Book a barber">
      <span class="book__glow" data-glow aria-hidden="true"></span>

      <header class="head">
        <span class="mark" aria-hidden="true">
          <svg viewBox="0 0 24 24"><path d="M6.5 4.5 17.5 19.5M17.5 4.5 6.5 19.5" /><circle cx="6" cy="18.6" r="2.4" /><circle cx="18" cy="18.6" r="2.4" /></svg>
        </span>
        <span class="head__txt">
          <span class="head__name" data-brand>Ashby Barber Co.</span>
          <span class="head__sub" data-service>Skin fade and beard trim</span>
        </span>
        <span class="head__price">
          <b data-price>$48</b>
          <span data-minutes>50 min</span>
        </span>
      </header>

      <div class="label">
        <span>Barber</span>
        <span class="label__right">Thursday, Nov 19</span>
      </div>

      <div class="barbers" data-barbers role="radiogroup" aria-label="Barber">
        <span class="barbers__hilite" data-hilite aria-hidden="true"><span class="barbers__hilite-face"></span></span>
      </div>

      <div class="label">
        <span>Free times</span>
        <span class="label__right count"><span class="count__roll" data-count><span class="count__line">5 free</span></span></span>
      </div>

      <div class="slots" data-slots role="radiogroup" aria-label="Time">
        <span class="slots__pick" data-pick aria-hidden="true"><span class="slots__pick-face"></span></span>
      </div>

      <div class="note" data-note>
        <div class="note__roll" data-noteroll>
          <p class="note__line" data-summary>Pick a free time with Marco</p>
        </div>
        <button class="remind" type="button" data-remind aria-pressed="false" aria-label="Remind me 1 hour before">
          <svg class="remind__bell" data-bell viewBox="0 0 16 16" aria-hidden="true"><path d="M4 11.2V7.4a4 4 0 0 1 8 0v3.8l1.2 1.2H2.8Z" /><path d="M6.6 13.6a1.5 1.5 0 0 0 2.8 0" /></svg>
          <span class="remind__txt">Remind me 1 hour before</span>
          <span class="remind__track"><span class="remind__knob" data-knob></span></span>
        </button>
      </div>

      <button class="go" type="button" data-go disabled>
        <span class="go__beam" data-beam aria-hidden="true"></span>
        <span class="go__face">
          <svg class="go__check" viewBox="0 0 16 16" aria-hidden="true"><path data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6" /></svg>
          <span class="go__roll" data-goroll><span class="go__label">Pick a time</span></span>
        </span>
      </button>
    </section>

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

28 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 “Barber picker” 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 ground there is only the booking card: at the top the copper scissors mark, the name of the shop, the service Skin fade and beard trim and on the right the price and the minutes. Below, the Barber label with the day, and the three barbers in a dark well: for each one the monogram with the initials inside a steel ring, the name and the rating with the star. The first already has the light tile with the copper edge and the copper ring turning slowly. Then the Free times label with the free count and eight times in two rows; the taken ones are dimmed and crossed by a thin line. Pick another barber: the light tile springs to them and squashes a little, the ring does half a turn, the monogram bounces and the times change in a wave starting from their side, the ones that open up rise, the ones that close drop and get crossed out, while the free count rolls. Pick a free time: the copper pill opens on it, and on any other time it slides across; the line below says barber, day, time, minutes and price and the button, off until then, turns copper with Book 2:10 pm with Sami. Pressed, the button darkens and a copper light runs twice around its edge, barbers and times dim; then it turns light with the drawn tick and Booked for Thu 2:10 pm, the card rises three pixels and settles, a copper glow comes on and in place of the line the reminder Remind me 1 hour before appears and switches itself on: the knob snaps over on a spring and the bell swings. Pressed again, the card goes back to how it was. Left alone, a drawn pointer does the whole round.

How it works

One light for the tiles, one for the times

The light tile of the barber and the copper pill of the time are two single elements behind the buttons: GSAP takes them to the x, y, width and height of the chosen button, read with offsetLeft and offsetWidth, on a back.out; the face inside squashes and comes back on an elastic. On resize they are put back in place.

The times in a wave

Each barber has their list of free times. On a change, each time waits a delay proportional to its distance from the side of the chosen barber, then swaps class: those that change state roll up or down and bounce, the others take a breath of a pixel and a half. The line that crosses out is a CSS transform with its own transition.

The rolling words

The free count and the button hold a single line: the new one comes in from below while the old one leaves at the top, and the box follows the width of the new one, so the button changes sentence without jumping.

The light on the edge

The button edge is a conic-gradient cut into a ring with the content-box mask in xor: GSAP turns its angle, a CSS variable, by 720 degrees while booking, then the tick, the sentence rolls and the reminder takes the place of the line, with the spring knob and the swinging bell.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js"Ashby Barber Co."The name of the barbershop.
SERVICEscript.js"Skin fade and beard trim"The service being booked.
PRICEscript.js48The price of the service, in dollars.
MINUTESscript.js50How long the service takes, in minutes.
BOOK_TIMEscript.js1.8How many seconds the copper light runs around the edge while booking.
SPRINGscript.js1How lively the springs are (0 none, 1.6 a lot).
STAGGERscript.js0.035The seconds between one time and the next when they rearrange.
LOOPscript.jstrueLeft alone, the drawn pointer does the round again.

Try them in the Playground

When to use it

On the site or app of a barber, a hairdresser, a beauty salon or a spa, and in any booking where you choose the person first and then the time: the tattoo studio, the personal trainer, the physiotherapist.

On phones

The card narrows to 92 vw and the vertical sizes (tiles, times, line, button, gaps) use clamp with vh, so it all fits the phone box; the two lights are measured again on resize.

With reduced motion

No springs and no waves: the tile and the pill go straight to their place, the times change without moving, the words change with fades, the knob is already on the other side and the bell does not swing. The drawn pointer is not shown, the demo still repeats.

Pitfalls

  • The new line of a rolling word must be absolutely positioned while it comes in, and the box must go from the width of the old one to the new one: otherwise the button changes width at once and the text jumps.
  • A line copied with cloneNode carries GSAP’s inline style too (opacity, offset): it must be set again every time with a fromTo, not a to.
  • The lit edge is a two-layer mask in xor on the padding: with overflow hidden on the button the copper shadow below would be cut, so the button has none and the light lives in a child.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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