Skip to content
animorio
IT
Back to the library

Delivery map tracking

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

The card to follow a delivery, in the clean style of today’s apps: on a quiet map of grey blocks the route draws itself in blue while the van follows it, the minutes to arrival roll and the steps below fill in. Hover a step and a small label points at its place on the map, and the place makes its move: the bakery’s awning bounces, the front door opens.

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>
<!--
  "Delivery map tracking" 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>The delivery tracked on a map, with the route drawing itself</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" data-stage>
    <!-- an order tracking card: the route draws itself on a quiet map while the van follows it, the minutes count down,
         the steps below fill in; hovering a step points at its place on the map with a small label -->
    <section class="track" data-card aria-label="Pellmore Bakery order, live tracking">
      <header class="track__head">
        <div class="track__titles">
          <p class="track__kicker">Pellmore Bakery <span>/ 2 items</span></p>
          <p class="track__title" aria-live="polite">
            <span class="eta" data-eta-wrap><span class="eta__word">Arriving in</span> <span class="eta__num" data-eta><span data-eta-a>12</span><span data-eta-b aria-hidden="true"></span></span> <span class="eta__unit">min</span></span>
            <span class="done" data-done aria-hidden="true"><svg viewBox="0 0 24 24"><path data-done-check d="M5.6 12.6l4 4 8.6-9"></path></svg><span>Delivered</span></span>
          </p>
        </div>
        <p class="track__clock" data-clock>12:18</p>
      </header>

      <div class="map" data-map>
        <svg viewBox="0 0 360 180" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
          <rect class="map__ground" width="360" height="180"></rect>
          <g class="map__blocks">
            <rect x="-6" y="56" width="118" height="26" rx="5"></rect>
            <rect x="128" y="-6" width="96" height="46" rx="5"></rect>
            <rect x="128" y="98" width="96" height="34" rx="5"></rect>
            <rect x="240" y="56" width="128" height="76" rx="5"></rect>
            <rect x="-6" y="148" width="118" height="40" rx="5"></rect>
            <rect x="240" y="148" width="128" height="40" rx="5"></rect>
            <rect x="240" y="-6" width="40" height="46" rx="5"></rect>
            <rect x="-6" y="-6" width="118" height="46" rx="5"></rect>
          </g>
          <g class="map__streets" data-streets>
            <path d="M-10 48H370"></path>
            <path d="M-10 90H370"></path>
            <path d="M-10 140H370"></path>
            <path d="M120 -10V190"></path>
            <path d="M232 -10V190"></path>
            <path d="M288 -10V48"></path>
          </g>
          <g class="map__names">
            <text x="150" y="86">Linden Ave</text>
            <text x="250" y="44">Quay St</text>
            <text x="54" y="136">Mill Rd</text>
          </g>

          <path class="route route--rest" data-rest d="M40 140H110Q120 140 120 130V100Q120 90 130 90H222Q232 90 232 80V58Q232 48 242 48H306"></path>
          <path class="route route--done" data-route d="M40 140H110Q120 140 120 130V100Q120 90 130 90H222Q232 90 232 80V58Q232 48 242 48H306"></path>

          <g class="pin pin--shop" data-shop transform="translate(30 140)">
            <g data-shop-in>
              <rect class="pin__bg" x="-13" y="-13" width="26" height="26" rx="8"></rect>
              <g class="pin__icon" transform="translate(-7 -7)">
                <path d="M2 6.4V13h10V6.4"></path>
                <path data-awning d="M1 6.4 2.4 1.6h9.2L13 6.4c0 1-.9 1.6-2 1.6s-2-.6-2-1.6c0 1-.9 1.6-2 1.6s-2-.6-2-1.6c0 1-.9 1.6-2 1.6S1 7.4 1 6.4Z"></path>
                <path d="M5.6 13v-3h2.8v3"></path>
              </g>
            </g>
          </g>

          <g class="pin pin--home" data-home transform="translate(320 48)">
            <g data-home-in>
              <rect class="pin__bg" x="-13" y="-13" width="26" height="26" rx="8"></rect>
              <g class="pin__icon" transform="translate(-7 -7)">
                <path data-roof d="M1 6.6 7 1.6l6 5"></path>
                <path d="M2.6 5.4V13h8.8V5.4"></path>
                <path class="pin__door" data-door d="M5.8 13V9.2h2.4V13"></path>
              </g>
            </g>
          </g>

          <g class="van" data-van>
            <g data-van-in>
              <rect class="van__bg" x="-15" y="-11" width="30" height="22" rx="8"></rect>
              <g class="van__icon" data-van-icon>
                <path d="M-8.6 -4h9.2v7.6h-9.2Z"></path>
                <path d="M0.6 -1.6h3.6l3 3v2.2h-6.6"></path>
                <circle cx="-5" cy="4.4" r="1.6"></circle>
                <circle cx="4" cy="4.4" r="1.6"></circle>
              </g>
            </g>
          </g>

          <g class="tip" data-tip>
            <rect class="tip__bg" data-tip-bg x="0" y="-26" width="80" height="19" rx="9.5"></rect>
            <text class="tip__text" data-tip-text x="0" y="-13.2" text-anchor="middle"></text>
          </g>
        </svg>
      </div>

      <div class="steps" data-steps role="list" aria-label="Delivery steps">
        <span class="steps__line" aria-hidden="true"><span class="steps__fill" data-fill></span></span>
        <div role="listitem" class="step is-on" data-step data-tip-text="Ordered at 12:04" data-at="shop">
          <span class="step__ring"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 3.5h12v17l-2-1.4-2 1.4-2-1.4-2 1.4-2-1.4-2 1.4Z"></path><path d="M9 8.5h6M9 12h6M9 15.5h3.5"></path></svg></span>
          <span class="step__name">Ordered</span><span class="step__time">12:04</span>
        </div>
        <div role="listitem" class="step is-on" data-step data-tip-text="Packed at 12:11" data-at="shop">
          <span class="step__ring"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3.6 7.6 12 3.4l8.4 4.2v8.8L12 20.6l-8.4-4.2Z"></path><path d="M3.6 7.6 12 11.8l8.4-4.2"></path><path d="M12 11.8v8.8"></path></svg></span>
          <span class="step__name">Packed</span><span class="step__time">12:11</span>
        </div>
        <div role="listitem" class="step" data-step data-tip-text="Left at 12:18" data-at="van">
          <span class="step__ring"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M2.8 6.6h10.6v9.6H2.8Z"></path><path d="M13.4 9.4h4.2l3.6 3.6v3.2h-7.8"></path><circle cx="7" cy="17.4" r="1.9"></circle><circle cx="17.2" cy="17.4" r="1.9"></circle></svg></span>
          <span class="step__name">On the way</span><span class="step__time">12:18</span>
        </div>
        <div role="listitem" class="step" data-step data-tip-text="Expected 12:30" data-at="home">
          <span class="step__ring"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3.4 11 12 3.8l8.6 7.2"></path><path d="M5.6 9.2v11h12.8v-11"></path><path d="M10.2 20.2v-5.4h3.6v5.4"></path></svg></span>
          <span class="step__name">Delivered</span><span class="step__time" data-last-time>12:30</span>
        </div>
      </div>

      <footer class="courier">
        <span class="courier__face" aria-hidden="true">MR</span>
        <span class="courier__text">
          <span class="courier__name"><span data-courier>Mika</span> <span class="courier__van">/ Electric van</span></span>
          <span class="courier__line" data-line aria-live="polite"><span data-line-a>Picked up your order</span><span data-line-b aria-hidden="true"></span></span>
        </span>
        <button class="msg" type="button" data-msg>
          <svg viewBox="0 0 24 24" aria-hidden="true"><path data-bubble d="M4.5 6.5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H11l-4.2 3.4V16.5H6.5a2 2 0 0 1-2-2Z"></path></svg>
          <span>Message</span>
        </button>
      </footer>
    </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.

38 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 “Delivery map tracking” 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 white background, alone in the middle, there is the white card of a delivery from Pellmore Bakery, a made-up bakery: at the top Arriving in 12 min, with the minutes in blue, and on the right the time in a small pill. Below, a quiet map: grey blocks, white streets drawing themselves one after another, three small street names, the bakery at the bottom left and the house at the top right, each on its white tile with a line icon. Between the two, the grey dotted route. Under the map four steps with their icons in a circle, Ordered, Packed, On the way and Delivered, joined by a line that fills with blue; at the bottom the courier, Mika, with the status line and the Message button. When the van leaves, a blue tile with a white van comes out of the bakery with a bounce and follows the streets: behind it the route draws itself in blue, on the climbs it leans slightly and on the straights it sits up again, the minutes to arrival roll one at a time, the clock moves on, the line of steps grows and the status line changes with the street. Hover a step and its icon redraws with a running stroke and rises by two pixels, and on the map a black label points at its place: Packed at 12:11 above the bakery, with the awning bouncing; Expected 12:30 under the house, with the roof lifting and the door opening a crack; and for On the way the label follows the van with the street and the minutes. Press Message and the button squashes, the speech bubble swells and Mika answers. On arrival the van goes into the house, the house turns blue and opens its door, the headline becomes Delivered with a check drawing itself. A drawn pointer does it all by itself, then starts again.

How it works

The map in SVG

The map is a single SVG with a 360 by 180 viewBox and preserveAspectRatio slice: blocks as rounded rectangles, streets as white lines nine units thick, small street names. Everything lives in the SVG’s coordinates, so van, labels and route stay in place at any size with no recalculation.

The route drawing itself

The route is one path with curves at the corners, used twice: grey and dotted underneath (an almost empty stroke-dasharray with round caps), blue on top. The blue one’s length is read with getTotalLength and its stroke-dashoffset goes from the whole length to zero together with a number p, from 0 to 1, that GSAP carries along in DRIVE seconds.

The van following the street

On every update getPointAtLength gives the van’s point and two nearby points tell whether it is climbing: the tile leans nine degrees uphill and sits up again on the straight, with a soft chase, so it never snaps at the corners. The minutes, the clock and the line of steps all come from the same p.

The rolling digits

The minutes and the status line have two stacked spans in a window with hidden overflow: the old one rises and fades, the new one comes in from below with back.out, then the two swap roles. It only changes when the value really changes.

The label and the places’ moves

Hovering a step redraws the lines of its icon with stroke-dashoffset, and on the map an SVG group with a rounded rectangle and a text settles above the bakery, under the house or on the van; its width is read with getComputedTextLength. Each place has its own move: the awning squashes and springs back with elastic, the roof lifts, the door narrows with scaleX.

Values to change

NameFileDefaultWhat it changes
ETA_MINscript.js12The minutes to arrival when the van leaves the bakery.
DRIVEscript.js6.5The seconds of the van’s trip from the bakery to the front door.
ACCENTscript.js"#3d5afe"The colour of the route, the van and the steps already done.
COURIERscript.js"Mika"The name of the person bringing the delivery.
HOLDscript.js2.4The seconds Delivered stays before starting again.
SPRINGscript.js0.55The seconds of the springs: labels, steps and places that bounce.

Try them in the Playground

When to use it

For the order page of an online shop, a bakery or a restaurant that delivers, or for a courier’s app: whoever is waiting sees at once where the parcel is, how long is left and how far along the order is.

On phones

The same animation with adapted sizes: the card takes the width of the box, the map is also sized on the height and crops a little above and below, the steps stay four with smaller names and a tap on a step shows its label for a moment.

With reduced motion

No streets drawing themselves, no bounces and no run: the map fades in, the van moves forward in three steps without sliding, minutes and lines change with a fade and on arrival Delivered appears with the check already drawn.

Pitfalls

  • The places’ moves are on an inner group, not on the one carrying the position: GSAP’s transform would wipe the outer group’s translate and the bakery would end up in the top left corner.
  • With preserveAspectRatio slice the map crops above and below when the card is wide and short: bakery, house, route and labels stay between 35 and 145 units, and the house’s label goes below it, not above.
  • Mona Sans’s tabular figures draw a slashed zero: the minutes and the clock use the normal figures.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 26 October 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