Skip to content
animorio
IT
Back to the library

Lost luggage tracker

SVG, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 5.5 KBGSAP 28 KBFreeDownload the zip

The tracking of a suitcase that did not arrive: a small suitcase stands on a line of four steps and at every update hops to the next, while the whole card changes colour with the status, from the red of “Missing” to the amber of the find, the blue of the journey, the green of delivery at the hotel, with its tick.

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>
<!--
  "Lost luggage tracker" 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>Lost luggage tracker</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">
    <!-- a delayed bag being traced: the suitcase hops from one step of the line to the next, the whole card
         changes colour with the status, from Missing to Delivered at the hotel -->
    <section class="lb" data-lb aria-labelledby="lb-title">
      <header class="lb__head">
        <span class="lb__tile" aria-hidden="true">
          <svg class="lb__bag" data-bagicon viewBox="0 0 24 24"><rect x="5" y="7.500" width="14" height="12.500" rx="2.600"></rect><path d="M9.500 7.500V5.800a1.300 1.300 0 0 1 1.300-1.300h2.400a1.300 1.300 0 0 1 1.300 1.300v1.700M9 11v5.500M15 11v5.500"></path></svg>
          <svg class="lb__ok" viewBox="0 0 24 24"><path data-ok pathLength="1" d="M6 12.500l4 4 8-8.700"></path></svg>
        </span>
        <div class="lb__titles">
          <h1 id="lb-title">Bag AY 482 913</h1>
          <p class="lb__status"><span data-status>Missing</span></p>
        </div>
      </header>

      <div class="lb__track">
        <svg viewBox="0 0 280 44" aria-hidden="true">
          <path class="lb__rail" d="M22 30H258"></path>
          <line class="lb__done" data-done x1="22" y1="30" x2="22" y2="30"></line>
          <path class="lb__tick" d="M22 24v12M100.700 24v12M179.300 24v12M258 24v12"></path>
          <circle class="lb__burst" data-burst cx="258" cy="30" r="6"></circle>
          <g data-bag><rect class="lb__case" x="-8" y="-17" width="16" height="13" rx="3"></rect><path class="lb__grip" d="M-3.500 -17v-2.200a1.300 1.300 0 0 1 1.300-1.300h4.400a1.300 1.300 0 0 1 1.300 1.300v2.200"></path></g>
        </svg>
        <div class="lb__steps">
          <button type="button" data-step="0" aria-current="step">Reported</button>
          <button type="button" data-step="1">Located</button>
          <button type="button" data-step="2">On the way</button>
          <button type="button" data-step="3">At hotel</button>
        </div>
      </div>

      <div class="lb__note">
        <p class="lb__what"><span data-what>Reported at Narita arrivals</span></p>
        <p class="lb__when"><span data-when>Today, 11:52</span></p>
      </div>
      <span class="lb__say" data-say aria-live="polite"></span>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

23 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 “Lost luggage tracker” 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 near black, a dark panel with a red glow at the top: a tile with a suitcase icon, “Bag AY 482 913” and under it, in red, “Missing”. Lower down a line with four ticks and their names, “Reported”, “Located”, “On the way”, “At hotel”: a small red suitcase stands on the first. At the bottom a box with what happened and when: “Reported at Narita arrivals, Today, 11:52”. At every update the suitcase hops to the next step in a small arc and squashes as it lands, the line behind it takes colour, the step’s name lights up and the panel changes colour: amber with “Located in Helsinki”, blue with “On its way to you”, green with “Delivered to your hotel”. At the last step a ring widens on the arrival point and in the top tile the suitcase makes way for a tick drawing itself. The words roll at every step; tap a step to go back to it.

How it works

The status is the step

A number from 0 to 3 says which step you are at: an attribute on the card (data-at) writes it and from there CSS picks the colour of everything through one variable.

The hop

A tween takes the position to the new step; on every frame x comes from the position and y from half a sine of the stretch covered, so the suitcase draws an arc.

The landing

At the end a second number squashes the suitcase and releases it on a spring; everything is written into the SVG group’s transform attribute.

The delivery

At the last step a circle widens its radius and fades, and in the top tile the tick draws itself with the dashoffset.

Values to change

NameFileDefaultWhat it changes
MISSINGscript.js#ff6156The colour used while the suitcase is missing.
LOCATEDscript.js#f6ae3dThe colour used once it has been found.
MOVINGscript.js#5aa2ffThe colour used while it is on its way.
DONEscript.js#39d6a4The colour of delivery.
HOPscript.js9By how many pixels the suitcase hops between one step and the next.
TRAVELscript.js0.9In how many seconds the suitcase goes from one step to the next.
SPRINGscript.js1How much the suitcase bounces when it lands: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer follows the suitcase step by step to the hotel.

Try them in the Playground

When to use it

In an airline’s or an airport’s app, in the claim email, in the app of a hotel receiving the bag for its guest. It suits anything that got lost and comes back in steps: a parcel, an order, a case file, a refund.

On phones

The same panel, 308 pixels wide at most: the line narrows with the width because it is an SVG, the four step names fit on one row and are tapped to go back to that step.

With reduced motion

The suitcase appears already on the new step, without the hop; the words change at once, the tick is already drawn and the colours change with their transition. The demo does not move by itself.

Pitfalls

  • Bag number, flights, times and hotel are made up; in the demo the steps change when tapped, in a real app they come from the baggage service’s updates.
  • The status is not told by colour alone: there are the words under the bag number, the lit step (aria-current=step) and a hidden aria-live line.
  • The suitcase is moved by writing the SVG group’s transform attribute, hop and squash included: that way the pivot is the suitcase’s base, with no transformOrigin.
  • Going back several steps the suitcase makes a single, longer hop: the duration grows with the distance but is capped.
  • Four colours is a lot: here each one is a status; if fewer are needed, keep the first and the last.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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