Skip to content
animorio
IT
Back to the library

Today’s menu cards

Scroll, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 8.5 KBGSAP + ScrollTrigger 45 KBFreeDownload the zip

Scroll inside the preview

Today’s menu of Gelso, a made-up kitchen and wine bar, on a warm black: four narrow cards in a row, one per dish, holding the real photo of the dish. As you scroll the card of the dish on the table widens into a large window while the photo inside slowly zooms back; the others shrink to strips and darken a little, with the name of the dish standing up in them. Beside them the course, the name and the price rise line by line, a saffron rule draws itself after the price and the frosted glass chip on the open card rolls to its word. Premium and spare, with real photos (CC0).

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>
<!--
  "Today’s menu cards" 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>Today's menu, with the dish cards widening on scroll</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz-italic.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- today's menu of Gelso, a made-up kitchen and wine bar. Scrolling down, the stage stays still: four narrow cards
       hold the real photos of the dishes; the card of the dish on the table widens into a window while its photo
       slowly zooms back, the name and the price rise beside it, and the other cards shrink and darken a little -->
  <main>
    <section class="apertura">
      <p class="piccolo">Gelso, kitchen &amp; wine</p>
      <h1 class="titolo">Four plates, <em>written this morning.</em></h1>
      <p class="piccolo">
        Scroll for today's menu
        <svg class="giu" viewBox="0 0 12 16" aria-hidden="true"><path d="M6 1v13M1.5 9.5 6 14l4.5-4.5" /></svg>
      </p>
    </section>

    <section class="menu" data-menu>
      <div class="palco">
        <div class="carta">
          <header class="testa">
            <p class="marchio">
              <svg class="marchio__segno" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 17.5V8.6" /><path d="M10 8.6c0-3.4 2.3-5.6 5.6-6.1-.3 3.4-2.4 5.7-5.6 6.1Z" /><path d="M10 12.2C10 9.4 8.1 7.5 5.2 7.1c.3 2.9 2 4.8 4.8 5.1Z" /></svg>
              Gelso
            </p>
            <p class="testa__giorno"><b>Today's menu</b><span> &middot; lunch &amp; dinner</span></p>
          </header>

          <div class="parole" aria-live="polite">
            <div class="voce" data-voce>
              <p class="voce__portata"><span class="finestra"><span class="riga">To start</span></span></p>
              <h2 class="voce__nome"><span class="finestra"><span class="riga">Grilled sardines,</span></span><span class="finestra"><span class="riga"><em>lemon &amp; sea salt</em></span></span></h2>
              <p class="voce__righe"><span class="finestra"><span class="riga">Caught off Camogli at dawn, charred over vine wood.</span></span></p>
              <div class="conto"><p class="conto__prezzo"><span class="finestra"><span class="riga">&euro;12</span></span></p><i class="conto__regola" data-regola></i><p class="conto__vino"><span class="finestra"><span class="riga">Glass of Vermentino <b>&euro;7</b></span></span></p></div>
            </div>
            <div class="voce" data-voce>
              <p class="voce__portata"><span class="finestra"><span class="riga">Pasta</span></span></p>
              <h2 class="voce__nome"><span class="finestra"><span class="riga">Squid ink tagliolini,</span></span><span class="finestra"><span class="riga"><em>prawns &amp; courgette</em></span></span></h2>
              <p class="voce__righe"><span class="finestra"><span class="riga">Rolled by hand at nine, a spoon of the prawn bisque.</span></span></p>
              <div class="conto"><p class="conto__prezzo"><span class="finestra"><span class="riga">&euro;18</span></span></p><i class="conto__regola" data-regola></i><p class="conto__vino"><span class="finestra"><span class="riga">Glass of Fiano <b>&euro;8</b></span></span></p></div>
            </div>
            <div class="voce" data-voce>
              <p class="voce__portata"><span class="finestra"><span class="riga">The main</span></span></p>
              <h2 class="voce__nome"><span class="finestra"><span class="riga">Seared salmon,</span></span><span class="finestra"><span class="riga"><em>peppers &amp; dill yoghurt</em></span></span></h2>
              <p class="voce__righe"><span class="finestra"><span class="riga">On the slate from the grill, peppers roasted until sweet.</span></span></p>
              <div class="conto"><p class="conto__prezzo"><span class="finestra"><span class="riga">&euro;24</span></span></p><i class="conto__regola" data-regola></i><p class="conto__vino"><span class="finestra"><span class="riga">Glass of Etna rosato <b>&euro;9</b></span></span></p></div>
            </div>
            <div class="voce" data-voce>
              <p class="voce__portata"><span class="finestra"><span class="riga">To finish</span></span></p>
              <h2 class="voce__nome"><span class="finestra"><span class="riga">Baked cheesecake,</span></span><span class="finestra"><span class="riga"><em>redcurrants &amp; cacao</em></span></span></h2>
              <p class="voce__righe"><span class="finestra"><span class="riga">Baked slow in the morning, redcurrants from the garden.</span></span></p>
              <div class="conto"><p class="conto__prezzo"><span class="finestra"><span class="riga">&euro;9</span></span></p><i class="conto__regola" data-regola></i><p class="conto__vino"><span class="finestra"><span class="riga">Glass of Moscato <b>&euro;8</b></span></span></p></div>
            </div>
          </div>

          <div class="fila" data-fila>
            <button class="piatto" type="button" data-piatto aria-label="Grilled sardines">
              <span class="piatto__in">
                <img src="sardine.webp" alt="Two grilled sardines with lemon wedges on a pewter plate" decoding="async">
                <i class="piatto__velo"></i><i class="piatto__grana"></i><i class="piatto__ombra"></i><i class="piatto__luce"></i>
                <span class="piatto__dorso">Sardines</span>
                <i class="piatto__bordo"></i>
              </span>
            </button>
            <button class="piatto" type="button" data-piatto aria-label="Squid ink tagliolini">
              <span class="piatto__in">
                <img src="tagliolini.webp" alt="Black squid ink tagliolini with prawns and courgette in a white bowl" decoding="async">
                <i class="piatto__velo"></i><i class="piatto__grana"></i><i class="piatto__ombra"></i><i class="piatto__luce"></i>
                <span class="piatto__dorso">Tagliolini</span>
                <i class="piatto__bordo"></i>
              </span>
            </button>
            <button class="piatto" type="button" data-piatto aria-label="Seared salmon">
              <span class="piatto__in">
                <img src="salmone.webp" alt="A seared salmon fillet with roasted peppers and dill yoghurt on a dark slate" decoding="async">
                <i class="piatto__velo"></i><i class="piatto__grana"></i><i class="piatto__ombra"></i><i class="piatto__luce"></i>
                <span class="piatto__dorso">Salmon</span>
                <i class="piatto__bordo"></i>
              </span>
            </button>
            <button class="piatto" type="button" data-piatto aria-label="Baked cheesecake">
              <span class="piatto__in">
                <img src="cheesecake.webp" alt="A slice of baked cheesecake with redcurrants and a line of chocolate on a white plate" decoding="async">
                <i class="piatto__velo"></i><i class="piatto__grana"></i><i class="piatto__ombra"></i><i class="piatto__luce"></i>
                <span class="piatto__dorso">Cheesecake</span>
                <i class="piatto__bordo"></i>
              </span>
            </button>
            <p class="gettone" aria-hidden="true" data-gettone>
              <svg viewBox="0 0 12 12"><path d="M2 3.2h8M2 6h8M2 8.8h5" /></svg>
              <span class="gettone__finestra"><span class="gettone__striscia" data-striscia><span>Line-caught</span><span>Hand-rolled</span><span>From the grill</span><span>Made at noon</span></span></span>
            </p>
          </div>
        </div>
      </div>
    </section>

    <section class="apertura apertura--fine">
      <h2 class="titolo titolo--medio">Until the plates <em>run out.</em></h2>
      <a class="pulsante" href="#"><span>Book a table</span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4" /></svg></a>
    </section>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.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.

59 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 “Today’s menu cards” 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 of Gelso, a made-up kitchen and wine bar, the heading “Four plates, written this morning.” invites you down. Then the stage stops: on top the mark with the mulberry leaf and “Today’s menu”, on the left the words of the dish, on the right a row of four cards with the real photos of the dishes (on a phone the row sits on top and the words below). As you scroll the card of the dish on the table widens until it takes almost the whole row, and the photo inside, zoomed in while it was a strip, slowly zooms back and keeps drifting back while the dish stays on the table; the card before shrinks into a dark, slightly less colourful strip, with the name of the dish standing up in it. Meanwhile the course, the two-line name (the second in italics), the line and the price of the card before leave upwards and the new ones rise one after the other from their windows; after the price a thin saffron rule draws itself towards the wine by the glass. The frosted glass chip rides on the open card and rolls with a small bounce from “Line-caught” to “Hand-rolled”, “From the grill” and “Made at noon”. The dishes: grilled sardines, squid ink tagliolini with prawns, salmon with peppers and cheesecake with redcurrants. With the pointer over the open card a warm light follows the mouse and the edge takes a thread of saffron; a strip gives a little under the finger and, clicked, glides the page to its dish. Everything follows the page, backwards too. At the end “Until the plates run out.” and the “Book a table” button.

How it works

A still stage and a single number

The section is 460vh tall and a 100lvh sticky stage stays still inside it. A GSAP timeline tied to the scroll with scrub SCRUB moves a single number, p, from 0 to 3 (the dish on the table), with a pause on every dish; a second number, t, runs straight without pauses and drives the slow zoom. On every update a single function rewrites everything from those numbers.

The widths in pixels

The row measures its width: a strip is STRIP of the row, the open card takes all the rest. Between two dishes the closing card and the opening one trade their width with the OPEN_EASE curve, so the others never move. Everything is recalculated on resize, even halfway.

The photo never squashes

Every photo is always as wide as the open card and sits at the centre of its own card: a strip shows only a slice of it. The zoom goes from 1+ZOOM, when the card is closed, to 1 when it is open, plus a DRIFT that keeps going back while the dish stays on the table; the strips take a dark veil (DIM) and less colour.

The rising lines and the chip

Course, name, line and price are lines in windows with overflow hidden: the dish leaving goes up in the first half of the turn (power2.in), the one arriving rises in the second (expo.out), one line after the other. The glass chip (backdrop-filter) follows the left edge of the open card and its column of words rolls with back.out; the window widens to the word.

The strips are buttons

Every card is a button: clicked, the page glides to the point of the timeline where its dish is resting (worked out from the start and end of the ScrollTrigger). The light that follows the pointer uses two CSS variables and lives only in @media (hover: hover).

Values to change

NameFileDefaultWhat it changes
STRIPscript.js0.085How wide a closed card is, as a share of the row.
ZOOMscript.js0.22How much bigger the photo is in a closed card: it zooms back from here as the card opens.
DRIFTscript.js0.05The slow zoom that keeps going while the dish stays on the table.
DIMscript.js0.42How much the closed cards darken.
OPEN_EASEscript.js'power3.inOut'The curve of a card opening and the others closing.
GRAINscript.js0.07How much film grain lies on the photos.
SCRUBscript.js0.7How many seconds the menu takes to catch up with the scroll.

Try them in the Playground

When to use it

For the menu of the day or the food menu of a restaurant, a trattoria, a bistro or a hotel restaurant: when a few dishes each deserve their own photo. It also works for the rooms of a hotel, the products of a collection or the projects of a portfolio. Swap the photos in the img tags of the HTML (the webp files in the folder), the words in the entries, the colours in :root.

On phones

The same animations at adapted sizes: the row of cards sits on top, 42% of the screen tall, and the words below; the strips stay at least 30 pixels wide. On very short screens the line under the name is left out.

With reduced motion

No movement: the cards change width at once when the next dish comes, the photos do not zoom and the words change with a fade.

Pitfalls

  • With flex-grow the cards widen on their own, but the photo inside would be cropped again at every pixel and seem to squash: the photo always has the width of the open card (a CSS variable in pixels) and is centred, so a strip shows a still slice of it.
  • The zoom cannot follow the width alone: during a pause the card stands still and the photo would stop too. A second number without pauses keeps the zoom going back while the dish stays on the table.
  • The dish leaving and the one arriving share one grid cell: the one leaving gives its half of the turn to the one arriving, or the two lines overlap.
  • The press bounce lives on a child (.piatto__in), not on the button whose width the script writes.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Mona Sans (font variabile) 5.3.0, Newsreader (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 8.5 KB; the libraries: GSAP + ScrollTrigger 45 KB.

Testing

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