Skip to content
animorio
IT
Back to the library

Map to list transition

Transitions, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.8 KBGSAP 28 KBFreeDownload the zip

The switch between the map and the list of an invented app for finding quiet places to work, in the style of product components: choosing List, the price pins lift off the map, each flies into its row and becomes that row’s price, while the map drifts away and the rows grow around them, the closest first. Map makes the trip back and every pin returns to its spot.

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>
<!--
  "Map to list 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>Nookly, quiet places to work</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>
  <!-- an invented app to find quiet places to work: switching from Map to List, the price pins lift off the map and
       fly into the rows, where they become the price of each place; the rows grow around them -->
  <main class="palco" data-palco>
    <section class="app" data-app aria-label="Nookly">
      <header class="testa">
        <div class="testa-sx">
          <span class="marchio">
            <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4 16V8.5L10 4l6 4.5V16" /><path d="M8 16v-4h4v4" /></svg>
            Nookly
          </span>
          <h1 class="titolo">Quiet places to work</h1>
          <p class="sotto"><span data-sotto>5 spots open near you</span></p>
        </div>
        <div class="scelta" role="tablist" aria-label="View" data-scelta>
          <span class="scelta-pillola" data-pillola aria-hidden="true"></span>
          <button type="button" role="tab" aria-selected="true" class="scelta-voce attiva" data-vista="mappa">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 4l4-1.5 4 1.5 4-1.5v9.5L10 13.5 6 12l-4 1.5z" /><path d="M6 2.5V12M10 4v9.5" /></svg>
            Map
          </button>
          <button type="button" role="tab" aria-selected="false" class="scelta-voce" data-vista="lista">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 4h11M2.5 8h11M2.5 12h7" /></svg>
            List
          </button>
        </div>
      </header>

      <div class="corpo" data-corpo>
        <div class="mappa" data-mappa aria-hidden="true">
          <svg viewBox="0 0 400 500" preserveAspectRatio="xMidYMid slice">
            <rect width="400" height="500" class="m-terra" />
            <path class="m-parco" d="M228 300h120v110H228z" />
            <path class="m-parco" d="M40 60h90v70H40z" />
            <path class="m-acqua" d="M-10 420C80 380 150 470 250 430s120-60 170-40v120H-10z" />
            <g class="m-isolati">
              <rect x="150" y="60" width="64" height="70" rx="6" /><rect x="236" y="40" width="96" height="90" rx="6" />
              <rect x="40" y="160" width="90" height="110" rx="6" /><rect x="150" y="160" width="64" height="110" rx="6" />
              <rect x="236" y="160" width="112" height="110" rx="6" /><rect x="40" y="300" width="166" height="80" rx="6" />
              <rect x="356" y="40" width="60" height="230" rx="6" />
            </g>
            <g class="m-strade">
              <path d="M-10 145H420" /><path d="M-10 285H420" /><path d="M140 -10V400" /><path d="M224 -10V420" />
              <path d="M346 -10V300" />
            </g>
            <g class="m-vie"><path d="M30 -10V300" /><path d="M-10 50H420" /></g>
          </svg>
        </div>

        <ol class="lista" data-lista aria-label="Places, closest first"></ol>
        <div class="segnaposti" data-segnaposti></div>
        <span class="nome-al-passaggio" data-etichetta aria-hidden="true"></span>
      </div>
    </section>

    <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.5v15.2l4.1-3.9 2.7 6.2 2.6-1.1-2.7-6.1 5.7-.3z" />
    </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

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 “Map to list 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 warm white background sits the card of Nookly, an invented app for finding quiet places to work: at the top the logo, “Quiet places to work”, “5 spots open near you” and a two-option control, Map and List, with a white pill under the chosen one. Below is a map drawn in light tones, with streets, blocks, two parks and a river, and five white pins showing the day price (€6/day, €8/day, €14/day, €12/day, €5/day) with a small tip touching their spot. Hovering a pin turns it blue and shows the place’s name above it. Choosing List the pill slides on a spring and the line under the title changes to “Closest first, price per day” (one leaves before the other enters). The pins lift a few pixels, lose their tip and shadow and fly, one after another, each into its row, where they land with a bounce and become that row’s price, in a soft blue. Meanwhile the map fades away as if zooming out, and around every price that has just landed its row grows: a flash of background, the drawn icon (a book, a cup, a desk), the name, the type, the distance and the opening hours. Hovering a row warms it and the price steps aside. Map does the opposite: the rows empty from the last, the prices turn white again and fly each to its spot on the map, where they get their tip and shadow back with a spring. A drawn pointer takes the tour on its own.

How it works

The same elements in both views

The pins live neither in the map nor in the list: they sit in a layer above and move only with x and y. On the map their position is a fraction of the width and height; in the list it is the empty slot left on purpose at the end of each row, measured with getBoundingClientRect against the same layer.

A curved flight

x and y have the same duration but different curves, power2.inOut and power3.inOut: the path bends slightly instead of going straight. Before the flight the pin rises seven pixels and loses its shadow and tip (scaleY to zero from the top); on arrival it settles with back.out.

Rows grow around the price

Each row enters only when its price has nearly landed: a yoyo flash of the background, the icon from 0.6 with back.out, then name and details from ten pixels to the left. It looks as if the pin carries the row in.

The way back

Map empties the rows from the last one, turns the colour back to white mid-flight and puts the tip and shadow back on landing. At the end of every switch the pins are set with gsap.set to the current measurements, so a window resize halfway leaves nothing out of place.

Values to change

NameFileDefaultWhat it changes
VOLOscript.js0.75How long a pin’s flight from the map to its row lasts, in seconds.
SFALSAscript.js0.07The delay between one pin and the next, in seconds.
ALZAscript.js7How many pixels a pin rises before leaving the map.
ALLONTANAscript.js1.06How much the map grows as it disappears, as if zooming out.
RIMBALZOscript.js3The strength of the spring when the pin lands.
SOSTAscript.js1.6How long each view stays still in the automatic tour, in seconds.

Try them in the Playground

When to use it

For apps and sites showing places both on a map and in a list: holiday homes, restaurants, coworking spaces, shops, events. The price flying from the map to the row tells the viewer these are the same places, just put in a line.

On phones

The same transition, with the card sized on the height too (at most the screen minus a margin): the rows split the remaining space into five equal parts, and on short screens the logo above the title hides. Tapping Map and List works like a click.

With reduced motion

No flight: pins and map fade out, the prices fade back in already inside the rows (and the other way round). The automatic tour does not start.

Pitfalls

  • The price slot in the row must be the same size as the pin: that is where it lands, and if it is smaller the price covers the row’s text.
  • The list is hidden with visibility hidden, not display none: that way the rows can be measured before they are shown.
  • The pin’s colour and its tip’s colour animate together: the tip is an SVG path and GSAP animates its fill.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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