Skip to content
animorio
IT
Back to the library

Patisserie menu

Images, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.1 KBGSAP 28 KBFreeDownload the zip

The counter card of Maison Ondine, a made-up patisserie, on a warm white background: five pastries on the left, a large real photo on the right. Hovering a name, the pastry photo arrives through a diagonal cut that sweeps across the frame, with a hairline of light on the blade and a slight zoom that settles, while the photo underneath slides aside and dims; going down the list the cut comes from the left, going up from the right. The name takes weight, a raspberry mark follows it on a spring and a glass label on the photo rolls to the hour the pastry came out of the oven. The five photos are real (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>
<!--
  "Patisserie 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>Patisserie menu, with the photo arriving through a diagonal cut</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/fraunces@5.3.0/opsz.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/opsz-italic.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the counter card of Maison Ondine, a made-up patisserie. On the left five pastries, on the right a large real
       photo. Hovering a name, its photo arrives through a diagonal cut that sweeps across the frame with a hairline of
       light on the blade: down the list the cut runs from the left, up the list from the right. A small glass label on
       the photo rolls to the hour the batch left the oven. When nobody touches it, a drawn pointer shows it -->
  <main class="palco">
    <article class="carta" data-carta>
      <div class="lista">
        <header class="testa">
          <p class="marchio">
            <svg class="marchio__segno" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 15c2.4-1.6 5.2-1.6 8 0s5.6 1.6 8 0" /><path d="M4 10c2.4-1.6 5.2-1.6 8 0s5.6 1.6 8 0" /></svg>
            Maison Ondine
          </p>
          <p class="testa__giorno">On the counter <em>today</em></p>
        </header>

        <ul class="dolci" data-dolci>
          <li class="dolce" data-dolce data-ora="06:40">
            <button class="dolce__tasto" type="button">
              <span class="dolce__nome">Croissant au beurre</span>
              <span class="dolce__prezzo">&#8364;3.20</span>
              <span class="dolce__nota">Normandy butter, 27 layers</span>
            </button>
          </li>
          <li class="dolce" data-dolce data-ora="07:15">
            <button class="dolce__tasto" type="button">
              <span class="dolce__nome">Tarte au citron</span>
              <span class="dolce__prezzo">&#8364;6.50</span>
              <span class="dolce__nota">Amalfi lemon, torched meringue</span>
            </button>
          </li>
          <li class="dolce" data-dolce data-ora="08:05">
            <button class="dolce__tasto" type="button">
              <span class="dolce__nome">&#201;clairs, a trio</span>
              <span class="dolce__prezzo">&#8364;9.60</span>
              <span class="dolce__nota">Raspberry, blackcurrant, passion fruit</span>
            </button>
          </li>
          <li class="dolce" data-dolce data-ora="09:30">
            <button class="dolce__tasto" type="button">
              <span class="dolce__nome">Macarons, box of six</span>
              <span class="dolce__prezzo">&#8364;12.00</span>
              <span class="dolce__nota">Raspberry and rose, rolled in sugar</span>
            </button>
          </li>
          <li class="dolce" data-dolce data-ora="10:50">
            <button class="dolce__tasto" type="button">
              <span class="dolce__nome">G&#226;teau chocolat</span>
              <span class="dolce__prezzo">&#8364;7.40</span>
              <span class="dolce__nota">70% dark, by the slice</span>
            </button>
          </li>
        </ul>
        <i class="segno" data-segno aria-hidden="true"></i>
      </div>

      <figure class="foto">
        <div class="foto__cornice" data-cornice>
          <div class="scatto" data-scatto><img src="croissant.webp" alt="A golden croissant on a white plate, in warm light" width="960" height="640" decoding="async"></div>
          <div class="scatto" data-scatto><img src="crostata.webp" alt="A lemon tart with a swirl of torched meringue and a raspberry, on a wooden board with lemons" width="1024" height="683" decoding="async"></div>
          <div class="scatto" data-scatto><img src="eclair.webp" alt="Three glazed eclairs, pink, violet and yellow, on a white plate" width="1024" height="690" decoding="async"></div>
          <div class="scatto" data-scatto><img src="macarons.webp" alt="Pink sugared macarons on a pale blue background" width="1024" height="683" decoding="async"></div>
          <div class="scatto" data-scatto><img src="torta.webp" alt="A slice of dark chocolate layer cake on a white plate, on a wooden table" width="1024" height="683" decoding="async"></div>
          <i class="lama" data-lama aria-hidden="true"><i class="lama__filo"></i></i>
          <i class="foto__riflesso" aria-hidden="true"></i>

          <div class="vetro" aria-hidden="true">
            <span class="vetro__nome">Out of the oven</span>
            <span class="vetro__ora" data-ora-vetro></span>
          </div>
        </div>
      </figure>
    </article>
  </main>

  <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2v15.6l4.1-3.9 2.7 6.1 2.6-1.1-2.6-6h5.9Z" /></svg>

  <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.

32 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 “Patisserie 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 warm white background sits a paper-coloured card with a soft layered shadow: the counter card of Maison Ondine, a made-up patisserie. At the top the brand with two raspberry waves and “On the counter today”, below five pastries divided by hairlines, the name in a serif and the price on the right: Croissant au beurre, Tarte au citron, Éclairs a trio, Macarons and Gâteau chocolat. On the right a large real photo in a rounded frame, with a faint sheen at the top as if under glass (on a phone the photo sits on top and the list below). Hovering a pastry, its name lights up, takes weight on the wght axis and moves six pixels with a small bounce, the price turns raspberry and a line with the ingredients appears below, while the others stay at half light. A thin raspberry mark runs on a spring next to the name, stretching a little as it travels and settling. Meanwhile the photo changes: the new one arrives through a diagonal cut that sweeps across the frame, slanted like a blade, with a hairline of pink light on its edge; it comes in slightly zoomed and shifted and settles, while the photo underneath slides the other way and dims. Going down the list the cut comes from the left, going up from the right. A frosted glass label at the bottom of the photo rolls, digit by digit, to the hour the pastry came out of the oven. The photos: a croissant on a white plate in warm light, a lemon tart with torched meringue and a raspberry, three glazed eclairs in pink, violet and yellow, pink sugared macarons, a slice of chocolate cake on a wooden table. When nobody touches it, a drawn pointer moves over the pastries by itself, down and then back up.

How it works

The card and the photo

A two-column card: the list of pastries (each item is a button, so it works with touch and the keyboard too) and a frame with the five photos stacked, all hidden except the active one.

The diagonal cut

The new photo moves up one layer and takes a polygon clip-path: its edge runs from a% at the top to (a − SKEW)% at the bottom, and a travels from 0 to 100 + SKEW with expo.inOut. If the chosen pastry sits higher in the list the polygon is mirrored and the cut comes from the right.

The blade of light

The same progress places a hairline of light: centred between the two points of the edge, length from Math.hypot and rotation from Math.atan2, recomputed in pixels every frame, so the hairline stays on the edge even when the window resizes. It fades in and out with the sine of the progress.

Both photos move

The new photo arrives from a 1.1 zoom shifted by 3% and settles with an expo.out longer than the cut; the one underneath slides the other way and drops to brightness(0.55). When the cut ends the photos underneath are hidden and reset.

The name, the mark and the hour

The name tweens the --w variable that feeds the wght axis, its opacity and six pixels with back.out; the raspberry mark follows the name with a hand-written spring in the GSAP ticker and stretches with its speed. The hour on the glass is made of 0 to 9 rolls that slide with a small stagger.

The drawn pointer

When nobody touches it, a repeating timeline moves a drawn pointer over the names (down to the bottom, then back up), with a small press on arrival; the first real mouse move, tap or key stops it, and it starts again after five quiet seconds.

Values to change

NameFileDefaultWhat it changes
SKEWscript.js26How far the blade of the cut leans, in percent of the photo width.
CUTscript.js0.95How many seconds the cut takes to cross the photo.
ZOOMscript.js1.1How zoomed in the new photo is when the cut starts.
DIMscript.js0.45How much the photo underneath darkens (0 = not at all).
SPRINGscript.js190How stiff the spring of the raspberry mark is.
BOUNCEscript.js0.58How damped the mark is (lower = more overshoot).
AUTO_GAPscript.js2.3How many seconds pass between two pastries when the drawn pointer drives.

Try them in the Playground

When to use it

For the menu or counter of a patisserie, a bakery, a cafe or a restaurant; but also for any short list where every item has its own photo: hotel rooms, portfolio projects, products in a collection. Swap the photos in the five img tags of the HTML (the webp files in the folder), the hour in each pastry's data-ora, the colours in :root.

On phones

The same animations at adapted sizes: the photo sits on top, the list below with smaller names and without the ingredients line; the cut, the blade, the mark and the hour are the same. You pick a pastry by tapping it.

With reduced motion

No movement: the photos cross-fade without cut or zoom, the name does not shift, the mark jumps to the item without a spring, the hour digits change at once and the drawn pointer is not shown.

Pitfalls

  • The hairline of light must be computed in pixels from the real frame size every frame: with percentages its slant does not match the clip-path edge as soon as the photo is not square.
  • A new cut starting while the other runs: the old one is sent to its end at once (progress(1)), otherwise the photos underneath are hidden at the wrong moment.
  • GSAP cannot animate a colour to an empty string: the two price colours are read once from :root.
  • Real mouse events stop the drawn pointer only when isTrusted, so its own moves never stop it.

Libraries

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

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

Testing

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