Skip to content
animorio
IT
Back to the library

Restaurant map

Hover, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 14 KBGSAP 28 KBFreeDownload the zip

The “Where to eat in Bologna” page of Forkful Guides, a made-up food guide: a quiet line map of the old town, with its streets, porticoes, Piazza Maggiore and the two towers, and six pins. Pointing at a pin (or tapping it) lifts it on a spring, its shadow spreads and a bubble card opens from it with a real photo of the dish, the name of the place, its quarter, the average price and the score; on the next pin the card slides over and the photo changes behind a soft curtain, while the list of the six places beside it lights up in step.

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>
<!--
  "Restaurant map" 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>Where to eat in Bologna: the restaurant map with the dish photo opening from the pin</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>
  <!-- the "Where to eat in Bologna" page of Forkful Guides, a made-up food guide: a calm drawn map of the old town
       with six pins. Pointing at a pin (or tapping it) lifts it on a spring, its shadow spreads, and a bubble card
       opens from it with a real photo of the dish, the name of the place, its quarter, the average price and a score.
       Moving to another pin slides the card over and swaps the photo behind a soft curtain; the list beside the map
       lights up in step -->
  <main class="stage" data-stage>
    <header class="testa">
      <p class="marchio">
        <svg class="marchio__segno" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 3v7.5a2.5 2.5 0 0 0 5 0V3M10.5 3v18" /><path d="M17 21V3c-1.9 1.1-3 3.6-3 6.6V14h3" /></svg>
        Forkful Guides
      </p>
      <h1 class="titolo">Where to eat in <em>Bologna</em></h1>
      <p class="sottotitolo">Six tables in the old town we keep going back to</p>
    </header>

    <div class="guida">
      <div class="mappa" data-mappa>
        <svg class="mappa__disegno" viewBox="0 0 600 440" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
          <defs>
            <clipPath id="dentro"><path d="M96 168 C118 120 156 84 214 62 C268 44 336 42 398 58 C456 74 504 112 526 164 C546 214 544 270 520 318 C494 364 440 396 372 410 C304 422 228 414 170 388 C118 364 84 320 76 268 C70 232 80 198 96 168 Z" /></clipPath>
            <pattern id="tratteggio" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><path d="M0 0v6" class="m-tratto" /></pattern>
          </defs>

          <!-- outside the old walls -->
          <g class="m-fuori">
            <path d="M0 120 C60 128 92 150 96 168" /><path d="M214 62 C200 30 186 12 176 0" /><path d="M398 58 C410 30 430 10 448 0" />
            <path d="M526 164 C560 156 584 150 600 148" /><path d="M520 318 C556 336 580 352 600 360" /><path d="M372 410 C380 420 386 432 390 440" />
            <path d="M170 388 C150 410 132 426 118 440" /><path d="M76 268 C46 274 22 280 0 284" />
          </g>
          <!-- the canal, north west -->
          <path class="m-canale" d="M0 70 C70 76 120 96 150 118 C176 136 196 140 236 132" />

          <!-- the ring road where the walls stood -->
          <path class="m-viale" d="M96 168 C118 120 156 84 214 62 C268 44 336 42 398 58 C456 74 504 112 526 164 C546 214 544 270 520 318 C494 364 440 396 372 410 C304 422 228 414 170 388 C118 364 84 320 76 268 C70 232 80 198 96 168 Z" />
          <path class="m-viale m-viale--fine" d="M96 168 C118 120 156 84 214 62 C268 44 336 42 398 58 C456 74 504 112 526 164 C546 214 544 270 520 318 C494 364 440 396 372 410 C304 422 228 414 170 388 C118 364 84 320 76 268 C70 232 80 198 96 168 Z" transform="translate(300 230) scale(0.972) translate(-300 -230)" />

          <g clip-path="url(#dentro)">
            <!-- the gardens in the south east corner -->
            <path class="m-verde" d="M418 352 C440 330 482 326 506 342 C522 356 516 384 492 398 C462 414 426 404 414 384 C408 372 410 360 418 352 Z" />
            <path class="m-verde m-verde--chiaro" d="M110 300 C124 290 150 292 158 306 C164 318 154 332 136 334 C118 336 104 322 110 300 Z" />

            <!-- the blocks of houses, barely there -->
            <g class="m-isolati">
              <rect x="180" y="150" width="46" height="34" rx="4" transform="rotate(18 203 167)" /><rect x="244" y="110" width="26" height="70" rx="4" />
              <rect x="314" y="96" width="22" height="80" rx="4" /><rect x="350" y="96" width="26" height="62" rx="4" transform="rotate(4 363 127)" />
              <rect x="398" y="124" width="54" height="30" rx="4" transform="rotate(-8 425 139)" /><rect x="150" y="232" width="74" height="18" rx="4" transform="rotate(-4 187 241)" />
              <rect x="140" y="262" width="70" height="20" rx="4" transform="rotate(-16 175 272)" /><rect x="296" y="276" width="30" height="96" rx="4" />
              <rect x="336" y="262" width="22" height="98" rx="4" transform="rotate(-6 347 311)" /><rect x="410" y="214" width="80" height="22" rx="4" transform="rotate(26 450 225)" />
              <rect x="226" y="290" width="40" height="70" rx="4" transform="rotate(14 246 325)" /><rect x="460" y="190" width="50" height="20" rx="4" />
              <rect x="190" y="340" width="34" height="30" rx="4" transform="rotate(-30 207 355)" /><rect x="106" y="190" width="60" height="18" rx="4" transform="rotate(4 136 199)" />
            </g>

            <!-- the small streets, a quiet net -->
            <g class="m-vicoli">
              <path d="M150 140 L200 186" /><path d="M176 120 L232 176" /><path d="M236 92 L254 196" /><path d="M270 70 L276 200" />
              <path d="M340 66 L332 190" /><path d="M380 76 L372 186" /><path d="M420 96 L398 194" /><path d="M462 126 L410 206" />
              <path d="M120 250 L240 236" /><path d="M128 286 L246 252" /><path d="M160 344 L262 262" /><path d="M214 380 L274 264" />
              <path d="M330 268 L340 404" /><path d="M360 262 L404 392" /><path d="M396 250 L470 362" /><path d="M432 244 L516 296" />
              <path d="M110 200 L250 214" /><path d="M150 168 L262 206" /><path d="M318 150 L470 160" /><path d="M300 120 L456 112" />
              <path d="M200 300 L250 330 L308 324" /><path d="M318 300 L380 318 L440 314" />
            </g>

            <!-- the porticoes: the long covered walks, drawn as a fine dashed edge along the main streets -->
            <g class="m-portici">
              <path d="M84 222 L268 218" transform="translate(0 6)" /><path d="M84 222 L268 218" transform="translate(0 -6)" />
              <path d="M300 214 L302 46" transform="translate(6 0)" /><path d="M300 214 L302 46" transform="translate(-6 0)" />
              <path d="M352 214 L528 304" transform="translate(3 -6)" /><path d="M352 214 L528 304" transform="translate(-3 6)" />
              <path d="M286 254 L280 412" transform="translate(6 0)" /><path d="M286 254 L280 412" transform="translate(-6 0)" />
              <path d="M262 246 L110 372" transform="translate(4 5)" /><path d="M262 246 L110 372" transform="translate(-4 -5)" />
            </g>

            <!-- the main streets, from the square out to the gates -->
            <g class="m-vie">
              <path d="M84 222 L268 218" /><path d="M310 218 L352 214" /><path d="M300 214 L302 46" />
              <path d="M352 214 L528 304" /><path d="M352 214 L534 196" /><path d="M352 214 L446 396" />
              <path d="M286 254 L280 412" /><path d="M262 246 L110 372" /><path d="M352 214 L436 70" />
            </g>

            <!-- the big square, hatched, and the two towers -->
            <rect class="m-piazza" x="266" y="220" width="40" height="34" rx="2" />
            <rect class="m-piazza m-piazza--segno" x="266" y="220" width="40" height="34" rx="2" fill="url(#tratteggio)" />
            <circle class="m-torre" cx="352" cy="214" r="4.2" /><circle class="m-torre" cx="358.5" cy="209" r="3" />
          </g>

          <!-- the names, set small and quiet -->
          <g class="m-nomi">
            <text x="286" y="268" text-anchor="middle">Piazza Maggiore</text>
            <text transform="translate(150 213)">Via Ugo Bassi</text>
            <text transform="translate(311 128) rotate(-90)" text-anchor="middle">Via Indipendenza</text>
            <text transform="translate(440 272) rotate(27)" text-anchor="middle">Strada Maggiore</text>
            <text transform="translate(452 196) rotate(-6)" text-anchor="middle">Via San Vitale</text>
            <text transform="translate(272 344) rotate(88)" text-anchor="middle">Via d’Azeglio</text>
            <text transform="translate(170 318) rotate(-40)" text-anchor="middle">Via Saragozza</text>
            <text transform="translate(394 316) rotate(62)" text-anchor="middle">Via Santo Stefano</text>
            <text x="466" y="374" text-anchor="middle" class="m-nomi--verde">Giardini</text>
            <text x="60" y="84" class="m-nomi--acqua">Canale di Reno</text>
          </g>
        </svg>

        <!-- the map's own controls, like a real map widget -->
        <p class="mappa__etichetta">Old town <span>6 places</span></p>
        <div class="mappa__zoom" aria-hidden="true">
          <span><svg viewBox="0 0 12 12"><path d="M6 2v8M2 6h8" /></svg></span>
          <span><svg viewBox="0 0 12 12"><path d="M2 6h8" /></svg></span>
        </div>
        <svg class="mappa__nord" viewBox="0 0 24 24" aria-hidden="true"><path class="nord__ago" d="M12 3.5 15 12h-6z" /><path class="nord__coda" d="M12 20.5 9 12h6z" /></svg>

        <!-- the six pins: positioned in % of the drawing, the card is one element that travels between them -->
        <div class="segnaposti" data-segnaposti></div>

        <article class="bolla" data-bolla aria-live="polite">
          <div class="bolla__corpo" data-corpo>
            <div class="bolla__foto" data-foto>
              <img class="bolla__img" data-img alt="" width="1200" height="800" decoding="async">
              <img class="bolla__img" data-img alt="" width="1200" height="800" decoding="async">
              <i class="bolla__bordo" data-bordo aria-hidden="true"></i>
              <span class="bolla__piatto" data-piatto><span class="riga"></span></span>
            </div>
            <div class="bolla__testo">
              <p class="bolla__nome"><span class="finestra" data-nome></span></p>
              <p class="bolla__dove"><span class="finestra" data-dove></span></p>
              <p class="bolla__dati">
                <span class="voto">
                  <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.6l1.9 4 4.3.5-3.2 3 .9 4.3L8 11.3l-3.9 2.1.9-4.3-3.2-3 4.3-.5z" /></svg>
                  <span class="finestra" data-voto></span>
                </span>
                <span class="prezzo"><span class="finestra" data-prezzo></span></span>
              </p>
            </div>
          </div>
          <i class="bolla__coda" data-coda aria-hidden="true"></i>
        </article>

        <!-- the drawn pointer that walks the pins on its own until a real one arrives -->
        <svg class="fantasma" data-fantasma viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2v15.6l4.1-3.9 2.6 5.9 2.6-1.1-2.6-5.8h5.7z" /></svg>
      </div>

      <section class="elenco" aria-label="The six places">
        <p class="elenco__testa">The list <span>Six places</span></p>
        <div class="elenco__corpo">
          <i class="elenco__luce" data-luce aria-hidden="true"></i>
          <ol class="elenco__righe" data-righe></ol>
        </div>
      </section>
    </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 “Restaurant map” 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

At the top of the page the mark of Forkful Guides, a made-up food guide, and the heading “Where to eat in Bologna”, with Bologna in red. Below, a map of the old town in a paper-coloured card with a 1px edge and layered shadows: the ring road where the walls stood, the main streets leaving Piazza Maggiore (hatched), the porticoes drawn as a fine dashed edge along the streets, the blocks barely there, the Canale di Reno, the gardens, the two towers and the street names, small and quiet; at the top the glass label “Old town, 6 places”, at the bottom the zoom buttons and the north mark. The six white pins with a fork drop in one after another and bounce. Pointing at one (or tapping it) turns the pin red, lifts it on a spring with a little sway and spreads its shadow on the ground; the others step back. The bubble card opens from it, its tail pointing at the pin: the real photo of the dish with grain and a glass label with its name, the name of the place, its kind and quarter, the score with a star and the reviews, the average price. The card sits above, below or beside the pin, wherever there is room, and never covers it. Moving to another pin slides the card over with a small settle, the new photo comes in behind a soft curtain from the side the card travels to (the old one slides away and darkens) and the words rise line by line. Beside it (under it on a phone) the list of the six places: a white light runs to the row of the place, its thumbnail takes its colour, the score turns red and an arrow appears. Leaving the map the card goes back into the pin. On its own, a drawn pointer walks the six pins and starts again; it steps aside as soon as a real pointer arrives. The photos are real: cold cuts and cheese on slate, tagliatelle al ragù, an espresso pouring into its cup at the bar machine, a cup of pistachio gelato in the street, hands folding tortellini, a tray of lasagne.

How it works

The map and the pins

The map is an SVG with a 600 by 440 viewBox in a card with the same aspect-ratio, so the six pins, placed in percent from their x and y on the drawing, always land on the right street. Each pin is a button: the CSS places the button, GSAP moves the body inside it (y up to -LIFT, scale and an elastic sway), and the shadow on the ground stays put and spreads.

One card that travels

The card is a single element. For each pin four places are tried (above, below, right, left) and the first that fits whole inside the map wins, otherwise the one that needs the least push: so it never covers its own pin, on a phone too. The outer shell slides with x and y in SLIDE seconds, the body inside opens and closes with a scale from the tail's origin and settles a little on arrival.

The photo behind the curtain

The frame holds two stacked img tags. The new one starts with a clip-path inset closed from the side the card travels to and opens in CURTAIN seconds, sliding and settling from a slight zoom; the old one slides the other way and darkens. A strip of soft light follows the curtain's edge. On top of the photo a grain painted once on a canvas, at the strength GRAIN.

The words and the list

Name, quarter, score, price and dish each sit in their own window: the old line leaves upwards, the new one rises with back.out, staggered. In the list a single light runs from row to row with x, y, width and height measured on the row, and is measured again on resize together with the card.

The drawn pointer

An SVG pointer goes from pin to pin with a small arc, taps and stays DWELL seconds, then leaves the map, the card closes and it starts again. At the first real mouse move or tap (isTrusted) it goes away, and it comes back on its own after eight quiet seconds.

Values to change

NameFileDefaultWhat it changes
LIFTscript.js9How many pixels the pin rises when you point at it.
SPRINGscript.js'back.out(2.6)'The spring of the pin rising, with its small overshoot.
SLIDEscript.js0.75The seconds the card takes to slide to the next pin.
CURTAINscript.js0.8The seconds of the soft curtain that swaps the photo.
GRAINscript.js0.28How much grain lies on the photos.
DWELLscript.js1.9The seconds the drawn pointer stays on each pin.
ACCENTscript.js#c2462bThe colour of the pin in use and of the score.

Try them in the Playground

When to use it

For the “where to eat” page of a food guide or a travel blog, the locations map of a restaurant chain, the places worth a walk near a hotel or the venues of an event spread around town. The places live in the POSTI list at the top of the script (name, quarter, dish, price, score, spot on the drawing and photo), the photos in the folder, the colours in :root.

On phones

The same animations at adapted sizes: the map on top, measured on width and height, and the list under it in two columns with the name and the score; tap a pin or a row. The card is smaller and sits beside the pin when there is no room above or below.

With reduced motion

No movement: the pins only change colour, the card appears and changes place with a fade, the new photo fades in, the list's light turns on at the row without running, and the drawn pointer is not there.

Pitfalls

  • The card's .sotto class (tail on top) had the same name as the subtitle, hidden on phones with display none: the card vanished. Keep state class names apart from layout ones.
  • The photo's clip-path would cut the shadow too: the shadow is on the whole card, the clip-path only on the img tags inside the frame.
  • GSAP writes the transform inline: the pin button is placed by the CSS with a negative margin (not with translate) and GSAP moves the body inside; the same for the card, shell and body.
  • The tail is a turned square half inside the card: for each of the four sides only the two edges that stick out are drawn, otherwise the card's edge line runs across the tail.
  • On resize the card and the list's light jump straight to their place, even halfway through a slide.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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