Skip to content
animorio
IT
Back to the library

Padel court booking

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.6 KBGSAP 28 KBFreeDownload the zip

Booking a padel match: three courts seen from above, four places each. Pick the hour and the places fill or empty in a cascade; tap a free one and your initials spring in, the net twangs once and the court counts one place less.

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>
<!--
  "Padel court booking" 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>Padel court booking</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">
    <!-- booking a padel match: three courts seen from above, four places each; pick the hour and the
         places fill or empty, tap a free one and you are in, with the net twanging once -->
    <section class="pc" data-pc aria-label="Padel court booking">
      <header class="pc__head">
        <span class="pc__club">
          <b>Club Marea Padel</b>
          <span>Thursday, open matches</span>
        </span>
        <b class="pc__hour" data-hour>19:00</b>
      </header>

      <div class="pc__hours" data-hours role="radiogroup" aria-label="Hour"></div>

      <div class="pc__courts" data-courts></div>

      <p class="pc__foot"><span class="pc__roll"><span data-foot>Tap a free place to join</span></span></p>
    </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>
  </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.

14 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 “Padel court booking” 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 light paper, at the top the club’s name and the chosen hour written large; below, a row of five hours with a white pill sliding onto the chosen one. Then three blue courts seen from above, with their white lines and net: at first the lines draw themselves and the four places of each court come in one after another. Taken places show the player’s initials, free ones a plus inside an outline; under each court is its name and how many places are left, and a full court dims. Changing the hour, the places close and reopen in a cascade from court to court, in the direction of the change, and the nets sway. Tapping a free place, your own initials, “You”, come in lime yellow on a spring, that court’s net twangs once like a string and the line at the bottom rolls to “You’re in: Centre, 19:00, €9 each”. Another tap and the place is free again. Moving over a court lifts it.

How it works

Drawn courts, real places

The court lines are an SVG with pathLength 1, drawn by animating stroke-dashoffset. The four places are HTML buttons laid over it in percent, so they can be tapped and reached by keyboard.

The net is a curve

The net is a path with one control point in the middle: animate that point with elastic.out from one side to zero and the line twangs like a string, on the side of the place taken.

The hour change in a cascade

Each place closes, swaps its content while invisible and reopens with back.out; the delay depends on the court and the place, and the courts’ order follows the direction of the change.

Values to change

NameFileDefaultWhat it changes
COURTscript.js#2b63e3The courts’ colour.
ACCENTscript.js#d6f24aThe colour of your place.
PRICEscript.js9What a match costs per player, in euros.
STARTscript.js2The hour chosen at first (0 = 17:00, 4 = 21:00).
STAGGERscript.js0.045The gap between one place and the next when the hour changes, in seconds.
LOOPscript.jstrueLeft alone, a pointer takes a place and changes the hour.

Try them in the Playground

When to use it

In the app or site of a padel or tennis club, a sports centre, a hotel with courts; and wherever you book a place in a small group: a shared table, a boat, a car pool, a class for four.

On phones

The same scene: the three courts fit in one row and the places are tapped with a finger. The scene is also sized on the window’s height.

With reduced motion

Courts and places are already there. Changing the hour or taking a place, initials and labels change without motion and the net stays still.

Pitfalls

  • Club, players, hours and price are made up: in a real app the places come from the server and taking one asks for confirmation and payment.
  • The hours are a radiogroup with arrow keys; each place is a button whose label gives the court, who is there or that it is free. Taken places have aria-disabled.
  • The court’s proportions are the real ones (20 by 10 metres, the service line 6.95 from the net): if you change the viewBox, keep the ratio.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 19 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 animations