Skip to content
animorio
IT
All components

Boarding pass

Tickets, Transitions, SVGGSAP, CSS onlyMediumCompressed weight: Demo 7.4 KBGSAP 28 KBFreeDownload the zip

The boarding pass of Aurel Air, a made-up airline, from Lisbon to Copenhagen: the two big airport codes with the dashed arc of the route and a little plane flying it and hovering halfway, then passenger, flight, gate, seat, boarding time and group. «Boarding in 25 min» counts down; then the status line rolls into «Gate change B14 B22», lights up once and the gate rolls from B14 to B22. Below the perforation with its two notches sits the stub with the QR code and «Save to phone», which turns into «Saved» with a tick; tapping the stub tears it off along the perforation, tipping and dropping on a spring. On white, with a single teal accent.

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>
<!--
  "Boarding pass" 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>Boarding pass</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the boarding pass of Aurel Air, a made-up airline: the two airport codes with the dashed arc and a little plane
         flying it, the details, the status line that turns into a gate change, the perforation with its notches and the
         stub with the QR code. Save to phone saves it; tapping the stub tears it off along the perforation -->
    <section class="pass" data-pass aria-label="Aurel Air boarding pass, Lisbon to Copenhagen">
      <div class="main" data-main>
        <header class="head">
          <span class="brand">
            <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M3 13.5 17 6.5M6.5 15.5l4-7.5"/></svg>
            Aurel Air
          </span>
          <span class="head__label">Boarding pass</span>
        </header>

        <div class="route">
          <div class="port">
            <span class="port__code" data-from>LIS</span>
            <span class="port__city">Lisbon · 07:40</span>
          </div>
          <svg class="arc" viewBox="0 0 200 64" aria-hidden="true">
            <path class="arc__base" d="M10 54 Q100 -14 190 54"/>
            <path class="arc__done" data-arc d="M10 54 Q100 -14 190 54" pathLength="1"/>
            <circle class="arc__end" cx="10" cy="54" r="2.6"/>
            <circle class="arc__end" cx="190" cy="54" r="2.6"/>
            <g data-plane>
              <path class="plane" d="M-7 0.9 L-2 0.9 L-4.2 6 L-2.3 6 L2.6 0.9 L6.6 0.9 Q8.4 0.9 8.4 0 Q8.4 -0.9 6.6 -0.9 L2.6 -0.9 L-2.3 -6 L-4.2 -6 L-2 -0.9 L-7 -0.9 L-8.6 -3 L-9.8 -3 L-8.8 0 L-9.8 3 L-8.6 3 Z"/>
            </g>
          </svg>
          <div class="port port--to">
            <span class="port__code" data-to>CPH</span>
            <span class="port__city">Copenhagen · 12:15</span>
          </div>
        </div>

        <dl class="grid">
          <div><dt>Passenger</dt><dd>Mira Costa</dd></div>
          <div><dt>Flight</dt><dd class="mono">AU 482</dd></div>
          <div><dt>Gate</dt><dd class="mono gate" data-gate>B14</dd></div>
          <div><dt>Seat</dt><dd class="mono">17A</dd></div>
          <div><dt>Boarding</dt><dd class="mono">07:05</dd></div>
          <div><dt>Group</dt><dd class="mono">2</dd></div>
        </dl>

        <div class="status" data-status aria-live="polite">
          <span class="status__flash" data-flash aria-hidden="true"></span>
          <span class="status__face" data-sface="board">
            <svg class="ico" viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="7"/><path d="M10 6v4.2l2.8 1.7"/></svg>
            <span>Boarding in <b class="mono" data-mins>25</b> min</span>
          </span>
          <span class="status__face" data-sface="gate">
            <svg class="ico" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 3.2 17.4 16H2.6z"/><path d="M10 8.2v3.6M10 13.6v.1"/></svg>
            <span>Gate change <s class="mono" data-old-gate>B14</s>
              <svg class="to" viewBox="0 0 16 10" aria-hidden="true"><path d="M1 5h13M10 1.5 14 5l-4 3.5"/></svg>
              <b class="mono" data-new-gate>B22</b></span>
          </span>
        </div>
      </div>

      <div class="stub" data-stub role="button" tabindex="0" aria-label="Tear off the stub">
        <svg class="qr" viewBox="0 0 25 25" data-qr aria-hidden="true" shape-rendering="crispEdges"></svg>
        <div class="stub__side">
          <p class="stub__line"><span class="mono">AU 482</span> · Seat <span class="mono">17A</span></p>
          <p class="stub__note">Scan at the gate</p>
          <button class="pill" data-pill type="button">
            <span class="pill__bg" data-pill-bg aria-hidden="true"></span>
            <span class="pill__face" data-face="save">
              <svg class="ico" viewBox="0 0 20 20" aria-hidden="true"><rect x="6" y="2.5" width="8" height="15" rx="2"/><path d="M9 14.8h2"/></svg>
              Save to phone
            </span>
            <span class="pill__face" data-face="saved">
              <svg class="ico" viewBox="0 0 20 20" aria-hidden="true"><path class="tick" data-tick d="M5 10.4 8.4 13.6 15 6.6" pathLength="1"/></svg>
              Saved
            </span>
          </button>
        </div>
      </div>
    </section>
  </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.

50 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Boarding pass” 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

The pass comes in rising slightly. The little plane leaves the Lisbon code and flies the dashed arc, drawing the route in teal behind it, up to halfway, where it stays and hovers gently. «Boarding in 25 min» goes down to 24 and 23, the digit rolling. Then the status line rolls away upwards and «Gate change B14 B22» comes from below: the line lights up teal once and fades, and in the gate box the characters roll one after the other from B14 to B22, which turns teal. A few seconds later the line goes back to the minutes. «Save to phone» squashes and springs back, turns teal and says «Saved» with a tick drawing itself. Tapping the stub tears it off: it flinches back a hair, then tips 7 degrees around its top right corner and drops on a spring; tapping it again puts it back. If nobody touches it, the demo does it all by itself and starts over.

How it works

The notches of the perforation

Each piece of the pass has a background made of two halves, each a radial gradient with a transparent circle at its corner: so the two half circles on the sides are real holes. The shadow is a drop-shadow on the wrapper, which follows the notches too, and the dashed line is a border on a pseudo-element.

The plane on the arc

The route is a quadratic SVG curve; every frame the point on the arc is read with getPointAtLength, the heading from a point half a pixel further on, and the plane, drawn around its own centre, is placed there with translate and rotate. The flown route is the same path with pathLength 1 and its dashoffset going down.

The rolling characters

Each character of the gate and of the minutes is a window one line tall: to change it the new one is added below and rises from yPercent 105 with a small back.out while the old one leaves at the top; only the characters that change roll, one after the other.

Values to change

NameFileDefaultWhat it changes
GATEscript.js"B14"The gate printed on the pass.
NEW_GATEscript.js"B22"The new gate after the change.
MINUTESscript.js25Minutes to boarding when the pass arrives.
FLY_TIMEscript.js2.2Seconds the plane takes to reach the top of the arc.
ROLL_TIMEscript.js0.55Seconds each character takes to roll into place.
TEAR_TIMEscript.js0.9Seconds the stub takes to tear off.
SPRINGscript.js0.5How springy the moves are (lower is more bounce).
HOLDscript.js2.2Seconds the torn stub stays before the demo starts over.
IDLEscript.js7Seconds after your last touch before the demo plays by itself again.

Try them in the Playground

When to use it

In the app or page of an airline, a travel agency or an event with a flight included: the gate change has to be noticed without alarming anyone, and the stub to tear gives a physical gesture to something that is usually just a QR code.

On phones

Everything is in em and the size depends on both the width and the height of the window, so the pass fits the phone box whole even with the stub torn. The status line has a fixed height, so the gate change moves nothing; the stub and the pill are big enough for a thumb.

With reduced motion

No flight, springs or rolling: the plane already sits halfway along the arc, characters and lines swap with a fade, the gate line lights up without moving and the torn stub just turns paler.

Pitfalls

  • Notches made with a radial gradient also clip a normal box-shadow: the shadow goes on the wrapper of the two pieces as filter: drop-shadow, which follows transparency.
  • The route path with pathLength 1 and a stroke-dashoffset between 0 and 1: without turning off autoRound GSAP would round it to 0 or 1. Here the dashoffset is written by hand every frame.
  • The two faces of the pill and of the status line sit on top of each other in absolute position: the longer one, in the flow, would push the other off centre.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

Tested on 2 December 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