Skip to content
animorio
IT
Back to the library

Store map transition

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

The store finder of a made-up coffee chain, Fennick Coffee, on an abstract map drawn by us: thin streets, blocks with their lots, a park, a diagonal avenue and the harbour. Choose a pin and it fills in terracotta with the store name; the camera moves in on the store and the streets get thinner; the pin sinks into its block, the block lifts off the map with its side and its shadow, leaving the bare ground behind, and grows into the store page with the hours, the wait and Order ahead. Back plays it all the other way. Left alone, a drawn pointer visits one store after another.

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>
<!--
  "Store map transition" 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>Fennick Coffee, find a store</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>
    <!-- the store finder of a made-up coffee chain, Fennick Coffee, on an abstract map drawn by us: thin streets and
         blocks. Choosing a pin moves the camera in, the streets get thinner, and the block of that store lifts off the
         map and becomes the page of the store, with its hours and Order ahead. Back puts everything where it was -->
    <div class="app" data-app>
      <div class="map" data-map aria-hidden="true">
        <div class="cam" data-cam>
          <svg class="map__svg" data-svg xmlns="http://www.w3.org/2000/svg"></svg>
          <div class="pins" data-pins></div>
        </div>
        <div class="map__grain"></div>
        <div class="map__veil" data-veil></div>
      </div>

      <header class="bar" data-bar>
        <span class="bar__brand">
          <svg class="bar__mark" viewBox="0 0 24 24" aria-hidden="true">
            <rect x="2.5" y="2.5" width="19" height="19" rx="6"/>
            <path d="M12 6.2c-2.6 2.2-2.6 9.4 0 11.6"/>
          </svg>
          <span class="bar__name">Fennick</span>
        </span>
        <span class="bar__search">
          <svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="7" cy="7" r="4.6"/><path d="M10.4 10.4 14 14"/></svg>
          <span>Stores near you</span>
        </span>
      </header>

      <div class="foot" data-foot>
        <span class="foot__chip"><span data-count>5</span> stores nearby</span>
        <span class="foot__scale" aria-hidden="true"><i></i><span>200 ft</span></span>
      </div>

      <article class="lift" data-lift aria-hidden="true">
        <div class="page" data-page>
          <div class="page__top" data-in>
            <button class="back" type="button" data-back>
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M9.8 3.6 5.4 8l4.4 4.4"/></svg>
              <span>Back</span>
            </button>
            <span class="page__far" data-far>0.4 mi</span>
          </div>
          <div class="page__head" data-in>
            <p class="page__brand">Fennick Coffee</p>
            <h2 class="page__name" data-name>Harbour Row</h2>
            <p class="page__addr" data-addr>14 Quay Lane</p>
          </div>
          <p class="page__status" data-in>
            <span class="tag" data-tag>Open now</span>
            <span class="page__closes" data-closes>Closes at 18:00</span>
          </p>
          <ul class="hours" data-in data-hours></ul>
          <div class="page__order" data-in>
            <p class="page__wait"><span>Ready in</span> <b data-wait>6 min</b></p>
            <button class="order" type="button" data-order>
              <span class="order__face">
                <span class="order__words" data-order-words>Order ahead</span>
                <svg class="order__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9M8.5 4.2 12.3 8 8.5 11.8"/></svg>
              </span>
            </button>
          </div>
        </div>
      </article>

      <svg class="hand" data-hand viewBox="0 0 24 24" aria-hidden="true">
        <path d="M5 3.2v15.4l4.1-3.9 2.7 6.1 2.6-1.1-2.7-6h5.6z"/>
      </svg>
    </div>
  </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 “Store map transition” 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 a cream page, in the middle, a rounded app frame with an abstract map inside: beige blocks with the thin lines of their lots, pale streets, a diagonal avenue with a dashed line, a sage park with its path and the harbour at the bottom right with three wave lines; grain on top. At the top the Fennick mark in a frosted glass pill and the search «Stores near you», at the bottom «5 stores nearby» and the scale. Five white pins with a drawn cup spring in one after another. On hover a pin rises three pixels and its shadow widens. On click it squashes, fills in terracotta and a dark pill comes out above it with the name and the minutes of wait; the camera moves in on the store on a soft curve while the streets go from 7 to 2.5 pixels, the other pins close one after another and the search and the foot leave through the edges. The pin sinks into the block and the block comes away: it rises seven pixels, shows its side and a wide shadow, and the darker ground is left underneath; then it grows into the store page, its corners round off, its colour turns from beige to warm white, the map behind is veiled and the camera takes one more step in. In cascade come Back and the distance, the name large in wide Mona Sans, the address, the Open now (or Closes soon) tag with the closing time, the hours with today's row marked by a terracotta hairline, the wait and the dark Order ahead button, whose word widens on hover and which squashes and bounces when pressed. Back does it all the other way: the page turns back into the block, drops into place, the pin pops up again, the camera moves out and the streets get wide again. Left alone, a drawn pointer picks the stores one after another, goes over Order ahead and back.

How it works

The streets are the edges of the blocks

The map is an SVG built from a fixed seed: rows and columns of streets at an uneven pace, blocks as rectangles with an edge in the colour of the street. The edge has vector-effect: non-scaling-stroke and its width in a CSS variable, --road: when the camera zooms in the blocks grow but the streets do not, and GSAP takes them from 7 to 2.5 pixels, so they really get thinner.

The camera

Map and pins sit in a layer with transform-origin 0 0. To bring the store to the centre, x = W/2 − cx·s and y = H·0.47 − cy·s; GSAP tweens an object holding x, y, s and the street width in 1.3 s on power3.inOut, and at every step scales the pins by 1/s so they keep their size.

The block that lifts

From x, y and s we know where the block will be on screen at the end of the move: an element of the same colour appears there, while the real block turns into the darker ground. The element rises 7 pixels on back.out and takes two shadows in one box-shadow: a hard one, the side, and a wide soft one below.

From block to page

The page already has its final size and sits inside the element with hidden overflow, invisible. The element tweens left, top, width, height, the radius up to 22, the colour to warm white and the shadow to the card's, in 0.8 s on expo.inOut; at 70 % the rows come in, 0.055 s apart.

Back, and on its own

Back builds the reverse timeline with the sizes of that moment: the page returns to the rectangle of the zoomed block, drops, the pin rises on back.out, the camera goes back to 1 and the streets to 7. The drawn pointer is a chain of GSAP timelines and delayedCalls: it taps a store, goes over Order ahead, presses Back and moves on; a real touch stops it for seven seconds.

Values to change

NameFileDefaultWhat it changes
ZOOMscript.js2.6How close the camera goes to the store.
ZOOM_TIMEscript.js1.3Seconds the camera takes to move in.
STREETscript.js7Width of the streets on the map, in pixels.
STREET_NEARscript.js2.5Width of the streets once the camera is close.
LIFTscript.js7Pixels the block rises before it becomes the page.
MORPH_TIMEscript.js0.8Seconds the block takes to grow into the page.
HOLDscript.js2.4Seconds the pointer stays on a store page.
LOOPscript.jstrueLeft alone, the pointer visits the stores again and again.

Try them in the Playground

When to use it

For the store finder of a chain (coffee, bakeries, gyms, bookshops), for the pickup points of an online shop, for the offices of a studio or an agency, for the properties of a hotel group or the venues of an event: when you go from the map to the page of a place and want that page to grow out of the place itself.

On phones

The same transition with adapted sizes: the app frame takes almost the whole box and its height follows the screen, the store page narrows and its gaps are sized in vh; pins are tapped with a finger.

With reduced motion

No camera and no lifting block: the store page fades in and out over the veiled map, the pins and the bars fade, the streets stay still.

Pitfalls

  • Without vector-effect: non-scaling-stroke the streets would grow with the camera instead of getting thinner: their width has to stay in screen pixels and be animated on its own.
  • The edge of a block is centred on its outline: the lifting rectangle must be inset by half the street width, or a step shows at the start.
  • The pins live in the camera layer but must be scaled by 1/s every frame, or they grow huge; their anchor is the top left corner of a zero width box.
  • The page size depends on the window: on every resize everything goes back to the map, the map is redrawn and the pointer starts again, so nothing is left halfway with old sizes.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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