Skip to content
animorio
IT
Back to the library

Flipping menu dishes

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

Tonight’s menu at Ortolan, a made-up restaurant: four dishes seen from above, real photos cut round, on paper-coloured cards. With the pointer over it a card tilts towards it with a sliding sheen, then turns over in 3D and shows on its back the ingredients with their line icons, the allergens as labels and the price; leaving, it turns back on a spring.

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>
<!--
  "Flipping menu dishes" 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>Menu dishes that flip to show their ingredients</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>
  <main class="stage" data-stage>
    <!-- tonight's menu of a made-up restaurant, Ortolan: four dishes seen from above. Hovering a card tilts it towards
         the pointer, then it turns over and shows what goes into the dish, the allergens and the price; leaving, it
         turns back on a spring. On a phone a tap turns it -->
    <section class="menu" aria-label="Tonight’s menu" data-menu>
      <header class="menu__head">
        <div class="brand">
          <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3.4c3.6 2.6 5.3 5.6 5.3 9.1A5.3 5.3 0 0 1 12 17.8a5.3 5.3 0 0 1-5.3-5.3c0-3.5 1.7-6.5 5.3-9.1Z"/><path d="M12 9.2v11.4"/><path d="M12 13.2l2.4-2"/></svg>
          <span class="brand__name" data-brand>Ortolan</span>
        </div>
        <p class="menu__tag"><span>Tonight’s menu</span><span class="menu__sep" aria-hidden="true"></span><span>Autumn</span></p>
      </header>
      <div class="dishes" data-dishes></div>
      <p class="menu__hint" data-hint>Hover a dish to see what’s in it</p>
    </section>

    <svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true"><path d="M5.2 3.6 18.6 12l-6.1 1.5-3.4 5.4Z"/></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.

19 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 “Flipping menu dishes” 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 there is tonight’s menu at Ortolan, a made-up restaurant: at the top its mark, a leaf drawn in terracotta, with the name, and on the right Tonight’s menu and the season. Below, four paper-coloured cards with round corners, each with a real photo of a dish seen from above, cut round with a soft shadow and a thread of light on its edge: a saffron risotto with a roast tomato and parsley, a salmon fillet with lemon and salad, sliced tomatoes with mozzarella and basil and a lemon meringue tart; a thread of steam rises from the two hot dishes. The cards arrive one after another and the dishes spin in with an elastic. With the pointer over it, a card tilts towards it and a sheen slides across it, while its shadow on the table moves; after a moment the dish makes half a turn and the card flips over in 3D, ending on a spring. On the back there are the name of the dish, the ingredients one under the other, each with its small line icon, the allergens as terracotta text labels and, at the bottom, the price. When the pointer leaves, the card turns back to the front with the same spring. A drawn pointer turns three dishes by itself, one after another, and then starts again; on a phone the cards are two by two and a tap turns them.

How it works

One card, three layers

Each dish is a slot with perspective, inside it a button that GSAP tilts with rotationX and rotationY and, inside that, the part that turns with rotationY 180. Both faces have backface-visibility hidden and the back starts already turned in CSS: this way the tilt and the flip don’t cancel each other.

The tilt towards the pointer

As the pointer moves, its position on the card is worked out from minus one to one, and two quickTo calls carry the tilt up to TILT degrees; the same value moves the sheen, a soft-light gradient, and the shadow on the table in the opposite direction.

The flip on a spring

After DWELL seconds with the pointer over it, the dish makes half a turn on its plate, then the card goes to 180 degrees with back.out(BOUNCE); the shadow squashes halfway, when the card is edge-on, and on the back the ingredients, the labels and the price come in staggered.

The photos cut round

Each dish is a real photo, already cropped square around the food, which CSS makes round with border-radius 50% and object-fit cover; on top a veil with a rim of light and an inner shadow at the bottom makes it look like a plate resting on the card. GSAP turns the photo’s container, so the dish really spins on itself on arrival and before the flip. The steam of the hot dishes is a small SVG over the photo: three paths that rise and fade in an endless loop.

The autopilot

A loop of delayedCalls moves the drawn arrow over three dishes, turns them, holds them for HOLD seconds and turns them back. At the first real touch it stops and lets the viewer play, and it starts again after nine quiet seconds.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js"Ortolan"The name of the made-up restaurant, written at the top beside the mark.
ACCENTscript.js"#c8553d"The only accent colour: the mark, the icons and the allergen labels.
TILTscript.js12The maximum degrees a card tilts towards the pointer.
DWELLscript.js0.32The seconds with the pointer over it before the card turns.
FLIPscript.js0.85The seconds of the card’s turn.
BOUNCEscript.js1.6The strength of the spring when the card finishes turning.
HOLDscript.js1.7The seconds the drawn pointer stays on a turned dish.

Try them in the Playground

When to use it

For the menu of a restaurant, a bar or a deli, or for the products of a food shop: the card shows the dish, and anyone who wants to know what’s in it, whether there are allergens and how much it costs turns it over without leaving the page.

On phones

The same animation with adapted sizes: the cards are two by two and the menu is also sized on the height, the back keeps three ingredients and a tap turns a card over, another turns it back.

With reduced motion

No tilt, no flip and no steam: the back appears with a fade over the front, and the autopilot stays still.

Pitfalls

  • Tilt and flip on the same card cancel each other: GSAP writes one transform per element, so the tilt goes on the button and the flip on a child, and the back keeps its rotateY(180deg) in CSS.
  • Without transform-style: preserve-3d on both levels the back flattens and is seen reversed, with mirrored text.
  • The button needs a real height (aspect-ratio) because the faces are absolute: without it the card measures zero and nothing shows.
  • On a phone pointerenter arrives together with the tap: the tilt and the flip on hover only listen to the mouse, and touch uses the click.
  • A food photo taken at an angle looks crooked in a circle: pick a photo taken from above and crop it square with the food in the middle, because the round cut takes off the corners and whatever sits near the edge disappears.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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