Skip to content
animorio
IT
All components

Book a lane button

Buttons, Hover, Physics, SVGGSAP, CSS onlyAdvancedCompressed weight: Demo 13 KBGSAP 28 KBFreeDownload the zip

The Book a lane button of Pinfall Social, a made-up bowling bar: a graphite pill with a tiny lane on the right, seen from above, with the ball and the ten pins in their triangle. On hover the ball takes aim and the hook line appears; on click the pill presses in, the ball rolls with a hook, hits the pocket and the pins tip over and scatter with a small real physics, while the words roll to Lane 6 · 8:30 pm and then to Strike with a tick. Then the machine’s sweep bar clears the lane, lowers ten fresh pins and the ball comes back.

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 lane 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>Book a lane button</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 lane button of Pinfall Social, a made-up bowling bar: a graphite pill with the words on the left and
         a tiny lane on the right, seen from above, with the ball at the foul line and the ten pins in their triangle.
         On hover the ball takes aim and a faint hook line shows the way to the pocket. Pressed, the pill sinks and
         springs back, the ball rolls down the lane with a hook, hits the pocket and the pins tip over and scatter with
         a small physics of their own; the words roll to Lane 6 · 8:30 pm, then Strike with a drawn tick; the sweep bar
         clears the deck, the machine lowers ten fresh pins, the ball comes back and the button rests again -->
    <svg class="defs" aria-hidden="true" focusable="false">
      <defs>
        <radialGradient id="bw-pin-top" cx="38%" cy="34%" r="70%">
          <stop offset="0" stop-color="#ffffff"/>
          <stop offset="0.55" stop-color="#f3efe7"/>
          <stop offset="1" stop-color="#cfc8bb"/>
        </radialGradient>
        <linearGradient id="bw-pin-side" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stop-color="#ffffff"/>
          <stop offset="0.5" stop-color="#f1ece3"/>
          <stop offset="1" stop-color="#bdb5a7"/>
        </linearGradient>
        <radialGradient id="bw-ball" cx="34%" cy="30%" r="78%">
          <stop offset="0" stop-color="#ff9a7c"/>
          <stop offset="0.38" stop-color="#ff5a36"/>
          <stop offset="0.8" stop-color="#c2321a"/>
          <stop offset="1" stop-color="#8f2210"/>
        </radialGradient>
      </defs>
    </svg>
    <div class="bowl" data-bw>
      <span class="bowl__shadow" data-shadow aria-hidden="true"></span>
      <button class="bowl__btn" type="button" data-btn data-autoclic aria-label="Book a lane at Pinfall Social, lanes from 28 dollars">
        <span class="bowl__body" data-body>
          <span class="bowl__face" aria-hidden="true"></span>
          <span class="bowl__glow" data-glow aria-hidden="true"></span>
          <span class="bowl__words" aria-hidden="true">
            <span class="bowl__state" data-state>
              <span class="bowl__main">Book a lane</span>
              <span class="bowl__sub">Pinfall Social · from $28</span>
            </span>
            <span class="bowl__state" data-state>
              <span class="bowl__main">Finding a lane</span>
              <span class="bowl__sub">Friday · 4 players</span>
            </span>
            <span class="bowl__state" data-state>
              <span class="bowl__main bowl__main--num">Lane <span class="reels" data-reel="lane"></span> · <span class="reels" data-reel="hour"></span>:<span class="reels" data-reel="min"></span> pm</span>
              <span class="bowl__sub">Booked · Pinfall Social</span>
            </span>
            <span class="bowl__state" data-state>
              <span class="bowl__main bowl__main--strike">
                <svg class="bowl__tick" viewBox="0 0 16 16"><path data-tick d="M3.2 8.6 6.6 11.8 12.9 4.6"/></svg>
                <span class="bowl__strike" data-strikeword>Strike</span>
              </span>
              <span class="bowl__sub">See you Friday</span>
            </span>
          </span>
          <span class="bowl__lane" data-lane aria-hidden="true">
            <svg class="bowl__marks" data-marks></svg>
            <span class="bowl__deck"></span>
            <span class="bowl__pit"></span>
            <span class="bowl__flash" data-flash></span>
            <span class="bowl__pins" data-pins></span>
            <span class="bowl__sweep" data-sweep></span>
            <span class="ball" data-ball>
              <span class="ball__shadow"></span>
              <svg class="ball__svg" viewBox="0 0 20 20">
                <circle cx="10" cy="10" r="9.6" fill="url(#bw-ball)"/>
                <g data-holes>
                  <circle cx="7.4" cy="7.1" r="1.25" class="ball__hole"/>
                  <circle cx="10.6" cy="6.2" r="1.25" class="ball__hole"/>
                  <circle cx="9.9" cy="11.4" r="1.6" class="ball__hole"/>
                </g>
                <ellipse cx="7" cy="5.6" rx="3.1" ry="1.7" transform="rotate(-28 7 5.6)" class="ball__gloss"/>
                <circle cx="10" cy="10" r="9.35" class="ball__rim"/>
              </svg>
            </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.

31 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 lane 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 white ground there is a single pill button 60 pixels tall, satin graphite, with a thread of light on top and a soft layered shadow on the floor. On the left Book a lane in white and under it, small, Pinfall Social · from $28. On the right, sunk into the pill, a tiny lane seen from above: the thin boards, the two gutters, the foul line, the dots and the seven arrows in a V, the slightly lighter pin deck and the dark pit at the end. On the line sits the coral red ball with its three holes, the highlight and its shadow; at the end the ten ivory pins in their triangle, seen from above, with the red ring of the neck. On opening the pill rises, the pins come down one after the other from the back row and the ball rolls in from the return. On hover a soft light follows the pointer, the ball shifts by a breath and turns slightly as if taking aim, and a red dotted line draws itself along the hook to the pocket. Pressed, the pill squashes and comes back with an elastic; the words go to Finding a lane and the ball sets off: it swings wide and then hooks back in, spinning, and hits the pocket between the head pin and the three pin. The pins that are hit tip over: the round top view gives way to the pin lying on its side, which flies off in the direction of the hit, spins, knocks the others down, bounces off the gutters and the cushion at the back and stops; the one still standing teeters and goes down too. On impact the lane lights up with a glow and the pill shakes by a pixel. The words rise to Lane 6 · 8:30 pm with the digits rolling one column after the other and settling, with Booked · Pinfall Social under them; a second and a half later comes Strike, with the tick drawing itself and the word stretching on the wdth axis and coming back with an elastic. Then the machine’s sweep bar comes down, pushes the pins into the pit and goes up, ten fresh pins land from above with a small settle, the ball rolls back and the words go back to Book a lane. From the keyboard Enter and space press it, and the focus shows as a red ring.

How it works

The curve of the ball

The throw is a quadratic Bézier curve from the foul line to the pocket, with the control point moved up by HOOK pixels, and after the pocket a straight line along its last direction into the pit. A GSAP tween takes the progress from 0 to 1 with a power1.in and then on at a steady speed; on every step the ball takes the point on the curve and the holes turn with it.

Pins that really collide

In GSAP’s ticker, three substeps per frame with the time capped at 1/30 of a second: the ball is a circle moved on its own and its speed is read from how far it moved; every pin is a circle with a position, a speed, a rotation and a spin. Ball-pin and pin-pin collisions are solved with an impulse along the normal (bounce 0.55 and 0.45), plus a small random angle from a seeded generator, so every throw falls the same way.

Standing and lying

Each pin has two SVG drawings: the round top view and the pin on its side. On the first hit the round one shrinks away while the lying pin grows out of its width with a little thud on its height, turned in the direction of the push; then exponential friction, bounces off the gutters that add spin and the cushion at the back that stops them.

The machine and the digits

The sweep bar is an element a timeline carries from in front of the pins to the pit: in the physics step it pushes every pin it touches and those past the pit fade out. The fresh pins come down with a scale from 1.7 to 1 and a back.out, from the back row to the front. The digits of Lane 6 · 8:30 pm are columns of random numbers with the right one at the bottom, sliding with a power3.out and an elastic settle of a pixel and a half.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js0.95The seconds the ball takes from the foul line to the pins.
HOOKscript.js9How far the ball swings out before hooking into the pocket, in pixels (0 is straight).
SCATTERscript.js1How hard the pins fly when they are hit.
FRICTIONscript.js3.4How quickly the pins slow down and stop.
HOLDscript.js1.5The seconds Lane 6 · 8:30 pm stays before Strike.
LANEscript.js6The number of the booked lane.
HOURscript.js8The hour of the booking, in the evening.
MINUTESscript.js30The minutes of the booking.
PRESSscript.js0.97How much the pressed pill shrinks.
SPRINGscript.js1How springy the press, the words and the fresh pins are.
--accentstyle.css#ff5a36The coral red of the ball, the pins’ rings, the tick and the aim line.
--pill-histyle.css#2a2c31The graphite at the top of the pill.

Try them in the Playground

When to use it

On the booking page of a bowling alley, a bar with lanes, an arcade or a leisure centre, in the app of a place for nights out with friends and parties: wherever a lane is booked for a time and the confirmation should feel like a small celebration.

On phones

The pill narrows to 90% of the screen, the lane stays between 126 and 168 pixels and the words get slightly smaller; a tap throws like a click, and the light appears under the finger.

With reduced motion

No rolling ball, flying pins, elastics or aim: the ball and the pins fade out, the words fade to Lane 6 · 8:30 pm and to Strike with the digits already in place, then the pins and the ball fade back.

Pitfalls

  • With the collisions alone the tenth pin was sometimes left standing and the words still said Strike: half a second after the hit, any pin still up teeters and falls.
  • With the pit always open nearly all the pins dropped into it and the scatter could not be seen: at the back there is a cushion that bounces softly, and the pit opens only when the machine’s bar goes by.
  • At 200 pixels a second a single frame let the ball pass through a pin without touching it: three substeps per frame.
  • The word states were centred with translateY(-50%) in the CSS, which GSAP’s transform wiped out: the column is now centred with flex and GSAP moves only y.
  • In flex the text pieces of Lane 6 · 8:30 pm lost the spaces around the digits: the line is a block and only the digit columns are inline-flex.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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