Skip to content
animorio
IT
Back to the library

Evening menu

Images, HoverGSAPMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The evening menu of Ivenna, a made-up small restaurant, on a warm cream page: six dishes with a serif name, the ingredients small and the price on the right after leader dots. Over a dish its real photo rises from behind the line like a postcard with a white border, grain and a soft shadow, follows the pointer with some inertia and tilts with the speed of the hand. Changing line the old photo slides away and the new one lands with a small bounce; a click widens the photo into a card with the suggested wine and a glass that fills.

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>
<!--
  "Evening menu" 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 evening menu with the dish photo that follows the pointer</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full-italic.css">
  <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 evening menu of Ivenna, a made-up small restaurant. Over a dish its real photo rises from behind the line
         like a postcard that tilts after the pointer; changing line the old photo slides away and the new one lands
         with a small bounce. A click opens the dish in a card with the wine to pair it with -->
    <section class="menu" data-menu aria-label="Ivenna evening menu">
      <header class="menu__head" data-head>
        <span class="brand">
          <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
            <circle cx="12" cy="12" r="10.6"/>
            <path d="M12 5.4c-2.6 2.4-3.4 5-2.4 7.6.7 1.8 1.6 3.4 2.4 5.6.8-2.2 1.7-3.8 2.4-5.6 1-2.6.2-5.2-2.4-7.6Z"/>
          </svg>
          <span class="brand__name">Ivenna</span>
        </span>
        <span class="menu__when">
          <span class="menu__title">Evening menu</span>
          <span class="menu__hours">Served 7 to 11 pm</span>
        </span>
      </header>
      <span class="menu__rule" data-rule aria-hidden="true"></span>

      <ul class="dishes" data-dishes>
        <li class="dish" data-dish data-wine="Vermentino" data-region="Liguria, 2023" data-glass="9" data-note="Salty, bright, a little almond" data-tint="#e9d98a">
          <button class="dish__hit" type="button" aria-haspopup="dialog">
            <span class="dish__line"><span class="dish__name">Burrata &amp; heirloom tomatoes</span><span class="dish__lead" aria-hidden="true"></span><span class="dish__price">14</span></span>
            <span class="dish__ing">basil oil, sea salt, grilled sourdough</span>
          </button>
        </li>
        <li class="dish" data-dish data-wine="Barbera d’Alba" data-region="Piedmont, 2021" data-glass="11" data-note="Cherry, soft earth, fresh finish" data-tint="#7a1e2c">
          <button class="dish__hit" type="button" aria-haspopup="dialog">
            <span class="dish__line"><span class="dish__name">Wild mushroom risotto</span><span class="dish__lead" aria-hidden="true"></span><span class="dish__price">19</span></span>
            <span class="dish__ing">porcini, aged parmesan, brown butter</span>
          </button>
        </li>
        <li class="dish" data-dish data-wine="Chablis" data-region="Burgundy, 2022" data-glass="13" data-note="Flint, lemon, cool and long" data-tint="#efe3a6">
          <button class="dish__hit" type="button" aria-haspopup="dialog">
            <span class="dish__line"><span class="dish__name">Seared scallops</span><span class="dish__lead" aria-hidden="true"></span><span class="dish__price">24</span></span>
            <span class="dish__ing">cauliflower cream, capers, lemon</span>
          </button>
        </li>
        <li class="dish" data-dish data-wine="Nebbiolo" data-region="Langhe, 2020" data-glass="14" data-note="Rose, tar, firm and warm" data-tint="#6c1a24">
          <button class="dish__hit" type="button" aria-haspopup="dialog">
            <span class="dish__line"><span class="dish__name">Dry aged sirloin</span><span class="dish__lead" aria-hidden="true"></span><span class="dish__price">32</span></span>
            <span class="dish__ing">bone marrow, charred shallot, jus</span>
          </button>
        </li>
        <li class="dish" data-dish data-wine="Pinot Noir" data-region="Alto Adige, 2022" data-glass="12" data-note="Red berries, silk, a little spice" data-tint="#8e2a38">
          <button class="dish__hit" type="button" aria-haspopup="dialog">
            <span class="dish__line"><span class="dish__name">Grilled salmon</span><span class="dish__lead" aria-hidden="true"></span><span class="dish__price">27</span></span>
            <span class="dish__ing">roasted peppers, thyme, crème fraîche</span>
          </button>
        </li>
        <li class="dish" data-dish data-wine="Vin Santo" data-region="Tuscany, 2016" data-glass="10" data-note="Dried apricot, honey, walnut" data-tint="#b8742a">
          <button class="dish__hit" type="button" aria-haspopup="dialog">
            <span class="dish__line"><span class="dish__name">Tiramisu</span><span class="dish__lead" aria-hidden="true"></span><span class="dish__price">10</span></span>
            <span class="dish__ing">espresso, mascarpone, bitter cocoa</span>
          </button>
        </li>
      </ul>
    </section>

    <!-- the postcard: one for all the dishes, the photos stacked inside -->
    <div class="post" data-post aria-hidden="true">
      <div class="post__rise" data-rise>
        <div class="post__tilt" data-tilt>
          <div class="post__card">
            <div class="post__photos" data-photos>
              <div class="ph" data-ph><img src="burrata.webp" alt="Burrata with halved cherry tomatoes and olive oil on a white plate, with gold cutlery" width="1024" height="683" decoding="async"></div>
              <div class="ph" data-ph><img src="risotto.webp" alt="A bowl of mushroom risotto with a sprig of rosemary" width="1024" height="768" decoding="async"></div>
              <div class="ph" data-ph><img src="capesante.webp" alt="Golden seared scallops in a dark pan" width="960" height="641" decoding="async"></div>
              <div class="ph" data-ph><img src="bistecca.webp" alt="A sliced medium rare steak on a plate with a fork and knife, a wine glass behind" width="1024" height="683" decoding="async"></div>
              <div class="ph" data-ph><img src="salmone.webp" alt="Grilled salmon with roasted peppers and a spoon of cream on a dark slate" width="960" height="640" decoding="async"></div>
              <div class="ph" data-ph><img src="torta.webp" alt="A slice of tiramisu dusted with cocoa and a mint leaf, on a white plate" width="1024" height="683" decoding="async"></div>
              <span class="post__grain"></span>
              <span class="post__gloss" data-gloss></span>
            </div>
            <div class="post__cap">
              <span class="post__name" data-cap></span>
              <svg class="post__stamp" data-stamp viewBox="0 0 40 40">
                <defs><path id="ring" d="M20 20m-13 0a13 13 0 1 1 26 0a13 13 0 1 1 -26 0"/></defs>
                <circle cx="20" cy="20" r="17.5"/>
                <text><textPath href="#ring">IVENNA EVENING MENU</textPath></text>
              </svg>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- the card the postcard opens into: the dish and the wine to pair it with -->
    <div class="veil" data-veil></div>
    <article class="open" data-open role="dialog" aria-modal="false" aria-labelledby="open-name" hidden>
      <div class="open__photo" data-open-photo>
        <img data-open-img src="burrata.webp" alt="" width="1024" height="683">
        <span class="post__grain"></span>
      </div>
      <div class="open__body">
        <p class="open__kicker" data-in>Tonight at Ivenna</p>
        <h2 class="open__name" id="open-name" data-in data-open-name></h2>
        <p class="open__ing" data-in data-open-ing></p>
        <p class="open__price" data-in><span data-open-price></span></p>
        <div class="wine" data-in data-wine-row>
          <svg class="wine__glass" viewBox="0 0 24 36" aria-hidden="true">
            <defs><clipPath id="bowl"><path d="M5 2h14c.6 6 .4 11-2.2 13.4C15.4 16.8 13.8 17.4 12 17.4s-3.4-.6-4.8-2C4.6 13 4.4 8 5 2Z"/></clipPath></defs>
            <rect class="wine__fill" data-fill x="0" y="0" width="24" height="18" clip-path="url(#bowl)"/>
            <path class="wine__line" d="M5 2h14c.6 6 .4 11-2.2 13.4C15.4 16.8 13.8 17.4 12 17.4s-3.4-.6-4.8-2C4.6 13 4.4 8 5 2ZM12 17.4V32M7.4 33.4h9.2"/>
          </svg>
          <span class="wine__text">
            <span class="wine__label">Pairs with</span>
            <span class="wine__name" data-open-wine></span>
            <span class="wine__note" data-open-note></span>
          </span>
          <span class="wine__glassprice"><span data-open-glass></span><span class="wine__per">glass</span></span>
        </div>
      </div>
      <button class="open__close" type="button" data-close aria-label="Close">
        <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"/></svg>
      </button>
    </article>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></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.

44 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 “Evening menu” 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 with a thread of paper grain sits the evening menu of Ivenna: the mark with a leaf in a thin circle, «Evening menu» and «Served 7 to 11 pm» on the right, a thin rule that draws itself. Below, six dishes, from burrata with tomatoes to tiramisu: the serif name (Fraunces), the ingredients small and the price on the right, after a row of thin leader dots. Over a dish the other lines step back, the name gains weight and moves three pixels, the price turns terracotta and the dots give a small elastic kick. From behind the line the real photo of the dish rises, a postcard with a white border, grain, a sliding gloss and a soft layered shadow, with the name in italics and a round stamp at the bottom. The postcard follows the pointer with some inertia, tilts with the speed of the hand, leans a little toward the pointer and breathes slowly even at rest. Changing line the old photo slides away upwards (or downwards when going up), the new one lands from the other side with a small bounce, the postcard takes the knock and the stamp turns. A click widens the photo into the card of the dish: name, ingredients, price and the line of the suggested wine, with a drawn glass that fills with the colour of the wine and sways. Left alone, a pointer runs over three dishes, opens the steak and closes it again.

How it works

The menu

Each dish is a button inside an li: a flex line with the name (white-space: nowrap, text-overflow: ellipsis), the dots and the price in tabular-nums, and the ingredients below. The leader dots are a flex: 1 element one pixel tall with a radial-gradient repeated every 5 px; name and price stay on the same baseline.

The postcard rising from behind the line

One postcard for all the dishes, with the six photos stacked inside. Three wrappers: the first follows the pointer (gsap.quickTo on x and y, FOLLOW seconds), the second rises with yPercent from 112 to 0 while its clip-path goes from inset(-12% -12% 100% -12%) to inset(-12%): the two numbers move together, so the lower edge stays still on the line and the photo seems to come out from behind it. If there is no room above the line it goes below with the same trick reversed.

The tilt after the hand

In the gsap.ticker the speed of the postcard (how far it moved since the last frame) becomes rotation, up to TILT degrees, with a soft return (10% of the difference each frame); the vertical speed gives some rotationX and the distance from the pointer some rotationY with perspective. A very slow sine makes it breathe even at rest, and the gloss slides with the tilt.

Changing line

The old photo leaves upwards (yPercent -38, opacity 0, power2.in) and the new one comes in from below with yPercent from 100 to 0 on back.out(BOUNCE); going up, the other way round. Meanwhile the postcard wrapper makes a small turn and a squash that settle with elastic.out, the stamp turns by 30 degrees and the italic name takes turns.

The card with the wine

On click the final card is already in place and full size: its clip-path starts from the rectangle of the postcard photo (measured with getBoundingClientRect) and opens to inset(0 round 10px) in OPEN_TIME seconds on expo.out, while the photo inside goes from scale 1.22 to 1 and the postcard fades. Then the lines of text come in, staggered, and the wine in the glass (a rect clipped by the shape of the bowl) rises while the glass sways. Closing is the same timeline reversed, faster.

The phone and the pointer on its own

A finger has no hover: a first tap on a dish raises its photo over the line, a second tap opens it, a tap outside sends it back down. Left alone, a GSAP timeline brings a fake pointer over three dishes, feeding its positions to the same function as the mouse, then opens a dish and closes it, and starts again.

Values to change

NameFileDefaultWhat it changes
FOLLOWscript.js0.55Seconds the postcard takes to catch up with the pointer: the inertia.
TILTscript.js9Largest tilt in degrees when the hand moves fast.
TILT_SPEEDscript.js0.5How much the speed of the hand turns into tilt.
RISEscript.js0.62Seconds the postcard takes to rise from behind the line.
SWAPscript.js0.6Seconds the new photo takes to land when the line changes.
BOUNCEscript.js1.6The bounce of the new photo (1 none, 3 a lot).
OPEN_TIMEscript.js0.85Seconds the photo takes to widen into the card with the wine.
DIMscript.js0.42How visible the other dishes stay while one is on show.
IDLEscript.js4Seconds before the pointer walks the menu by itself.
LOOPscript.jstrueLeft alone, the pointer runs over the dishes and opens one, over and over.

Try them in the Playground

When to use it

For the menu of a restaurant, a bistro, a wine bar or a cafe with a kitchen, where one photo per dish helps choose without filling the page; but also for any short list with one picture per item: hotel rooms, the wines of a winery, the products of a small collection. Swap the photos in the six img of the postcard, the wine in the data-wine, data-region, data-glass and data-note of each dish, the colours in :root.

On phones

The same animation with adapted sizes: the lines, the postcard and the card are measured on width and height with clamp and min(vw, vh), and the card puts the photo above the text when it is narrow. A finger tap on a dish raises its photo over the line, a second tap opens it into the card with the wine, a tap outside sends it back down.

With reduced motion

No chasing and no tilt: the postcard fades in over the line, the photos cross-fade and the card with the wine opens with a fade, the glass already full. No pointer on its own.

Pitfalls

  • The clip-path cuts the shadow too: while rising the postcard has a 12% margin around it, and at the end the clip-path is removed (none), so the whole soft shadow shows.
  • For the photo to seem to come out from behind the line, the shift (yPercent) and the lower cut of the clip-path must travel the same distance on the same curve: with two different curves the lower edge would wobble above the line.
  • GSAP writes its transform inline: chasing, rising and tilting sit on three different wrappers, or one would wipe out the other; the white border and the shadow sit on the fourth, CSS only.
  • With the entrance opacity set by GSAP on the button, the CSS dimming of the other lines would no longer show: the entrance animates the li, the CSS the buttons.
  • The top lines have no room above them for the postcard: there it goes below the line, with the same clip-path trick reversed.
  • A finger has no hover: the first tap shows the photo and only the second opens the card, or on a phone the postcard would never be seen.

Libraries

GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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