Skip to content
animorio
IT
Back to the library

Tennis draw

Scroll, SVGGSAP, CSS onlyMediumCompressed weight: Demo 13 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The singles draw of the Fallowmere Open, a made-up grass court tennis tournament, on an almost black lawn green: as you scroll the boxes draw themselves in thin lines and the eight quarterfinalists slide into place. A drawn tennis ball hops from match to match, the games of every set roll in like on a scoreboard, the loser fades, the winner's line runs on to the next round and the name slides into the next box. Then the semifinals and the final in the middle, under a thin line cup that draws itself and lights up ball yellow together with the champion's path.

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>
<!--
  "Tennis draw" 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>Fallowmere Open, singles draw</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>
  <!-- the singles draw of a made-up grass court tournament, the Fallowmere Open. The stage sticks while you scroll
       and the scroll plays the last week: the eight quarterfinalists slide into the draw, a tennis ball hops from
       match to match, the set scores roll, the loser fades, the winner's line draws on to the next round and the name
       slides into the next box. Then the semifinals, then the final in the middle under a thin line trophy that lights
       up with the champion. -->
  <main>
    <section class="draw" data-draw>
      <div class="stage" data-stage>
        <div class="light" data-light aria-hidden="true"></div>
        <div class="grain" aria-hidden="true"></div>

        <div class="frame" data-frame>
          <article class="panel" data-panel>
            <span class="panel__edge" aria-hidden="true"></span>
            <span class="panel__glow" aria-hidden="true"></span>

            <header class="head">
              <span class="mark" aria-hidden="true">
                <svg viewBox="0 0 16 16"><rect x="2.5" y="3.5" width="11" height="9" rx="1"/><path d="M8 3.5v9M2.5 6h11M2.5 10h11M5 6v4M11 6v4"/></svg>
              </span>
              <p class="brand">Fallowmere Open <span class="brand__sub muted">Singles draw</span></p>
              <p class="meta">
                <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 12.5c1.6-1.2 2.2-4 2.6-7M6.6 12.5c.6-1.6.8-4.6.4-7.8M10 12.5c-.2-2 .4-5 1.6-7.4M13.5 12.5c-1-1.4-1.6-3.6-1.4-5.6"/></svg>
                <span>Grass</span><span class="meta__sep" aria-hidden="true"></span><span class="muted">Best of three</span>
              </p>
            </header>

            <div class="map" data-map>
              <svg class="bracket" data-svg role="img" aria-label="The singles draw of the Fallowmere Open, from the quarterfinals to the final">
                <defs>
                  <radialGradient id="cup-glow" cx="0.5" cy="0.5" r="0.5">
                    <stop offset="0" style="stop-color:var(--ball)" stop-opacity="0.5"/>
                    <stop offset="0.45" style="stop-color:var(--ball)" stop-opacity="0.14"/>
                    <stop offset="1" style="stop-color:var(--ball)" stop-opacity="0"/>
                  </radialGradient>
                  <linearGradient id="sheen" x1="0" y1="0" x2="1" y2="0">
                    <stop offset="0" stop-color="#fff" stop-opacity="0"/>
                    <stop offset="0.5" stop-color="#fff" stop-opacity="0.7"/>
                    <stop offset="1" stop-color="#fff" stop-opacity="0"/>
                  </linearGradient>
                  <radialGradient id="ball-shade" cx="0.36" cy="0.32" r="0.75">
                    <stop offset="0" style="stop-color:var(--ball-hi)"/>
                    <stop offset="0.55" style="stop-color:var(--ball)"/>
                    <stop offset="1" style="stop-color:var(--ball-lo)"/>
                  </radialGradient>
                </defs>
                <g data-base></g>
                <g data-links></g>
                <g data-boxes></g>
                <g data-cup></g>
                <g data-ball></g>
              </svg>
            </div>

            <footer class="foot">
              <div class="rounds" data-rounds>
                <span class="rounds__pill" data-pill aria-hidden="true"></span>
                <span class="rounds__tab" data-round="0"><span class="long">Quarterfinals</span><span class="short">QF</span></span>
                <span class="rounds__tab" data-round="1"><span class="long">Semifinals</span><span class="short">SF</span></span>
                <span class="rounds__tab" data-round="2">Final</span>
              </div>
              <div class="champ" data-champ>
                <div class="champ__wait" data-wait aria-hidden="true"><span class="bar bar--a"></span><span class="bar bar--b"></span></div>
                <p class="champ__line" data-champline>
                  <span class="champ__label muted">Champion</span>
                  <b class="champ__name" data-champname>R. Castellane</b>
                  <span class="champ__score muted" data-champscore></span>
                </p>
              </div>
            </footer>
          </article>
        </div>
        <p class="sr" aria-live="polite" data-live></p>
      </div>
    </section>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.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.

29 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 “Tennis draw” 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 an almost black lawn green, with the mown stripes of the grass barely visible, sits the glass panel of the Fallowmere Open: the yellow mark with a drawn court, 'Singles draw', the 'Grass, Best of three' pill. Inside, the draw: on a wide screen the quarterfinals on both sides, the semifinals further in and the final in the middle under the cup; on the phone the same draw upright, the quarterfinals above and below and the final in the middle with the cup beside it. As you scroll the boxes draw themselves, the thin lines of the draw trace on and the eight players slide in with their seeds. Then the ball drops onto the first match and squashes a little: the games of the sets roll from zero to their number, the loser fades, a yellow notch marks the winner and their line runs on to the next round, where the name slides into the empty box. The ball hops from match to match on an arc that depends on the distance, spins, makes a small second bounce and its shadow narrows when it is high. Before the final the shelf and the cup draw themselves; once the last set is won the cup lights up yellow with a sheen across it, the champion's path turns yellow, the light behind the panel grows and at the bottom the waiting shimmer gives way to 'Champion R. Castellane 7–6 6–4'. The round switcher at the bottom follows the scroll with a sliding pill; hovering a name lights that player's whole path.

How it works

One held stage and one timeline

The section is 460vh tall and the stage inside is sticky at 100vh (100lvh where available). The whole tournament is one paused GSAP timeline that ScrollTrigger drives with scrub: the scroll is the time, and scrolling back takes the draw apart. Lenis smooths the scrolling.

Two draws from the same data

Players, sets and winners live in two objects; two functions turn them into positions in the viewBox, a wide one (800 by 290, both halves into the middle) and a tall one (340 by 360, top and bottom into the middle). The script picks the one that fits the stage and, if that changes on resize, rebuilds everything at the scroll point you were at.

Lines and boxes that draw themselves

Every line and every outline is a path with a stroke-dasharray equal to its length (getTotalLength): the timeline takes stroke-dashoffset from there to zero. Underneath there is the whole draw in a fainter line, on top the line of every winner that traces on when the match is over.

Games that roll

Every set score is a column of digits from zero to the result, inside a clipPath the size of the row: the timeline lifts it by 14 units a digit with a light back.out, so the number stops with a small settle like on a scoreboard.

The hopping ball

Every hop is a tween of a number from 0 to 1: in onUpdate x goes straight, y draws a parabola as high as the distance, then there is a small second bounce; the spin follows the travel and the shadow narrows and fades with the height. On landing an inner group squashes with svgOrigin at the bottom of the ball.

The champion

At the end the timeline takes the colour of the champion's lines and of the cup to ball yellow, lights the glow and the fill of the cup, sweeps a slanted sheen inside the cup (clipPath) and swaps the waiting shimmer in the foot for the name and the score of the final.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the whole tournament takes: 2 = twice as long.
HOPscript.js1How high the ball hops from one match to the next (0 = it slides).
SQUASHscript.js1How much the ball squashes as it lands (0 = not at all).
DIMscript.js0.36How far the loser of every match fades (1 = not at all).
GLOWscript.js1How strong the light of the trophy and of the champion is.
ROLLscript.js0.45How long the set scores take to roll into place.

Try them in the Playground

When to use it

On a tournament page (tennis, padel, chess, e-sports, five-a-side, a company tournament), in the results section of a sports club or a sports app, in the story of a season or a knockout award: wherever the reader should watch the tournament move on round after round to the winner while scrolling.

On phones

The same animations at adapted sizes: under 600 pixels wide or on a stage taller than it is wide the draw turns upright (the quarterfinals above and below, the final in the middle with the cup beside it) and the panel is as wide as the height allows, so everything fits in 341 by 410.

With reduced motion

No long scroll and no movement: the draw is already complete, the scores in place, the champion and the cup lit; the panel fades in.

Pitfalls

  • An element that already has a CSS transform (the waiting shimmer centred with translateY(-50%)) loses it if GSAP animates its y: there only the opacity is animated.
  • Tweens that start halfway through the timeline and touch the same element several times (the ball, the digit column) need immediateRender: false, or the fromTo created later rewrites the start state at once and the ball jumps to the wrong place.
  • The ball is not moved with GSAP x and y but with the transform attribute written in onUpdate: every hop depends only on its own progress, and scrolling back the ball retraces the same arcs.
  • When the draw switches (from wide to tall) on resize, the old timeline is taken back to zero before it is killed: the foot and the light go back to their start state and the new one picks them up clean.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 13 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 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 animations