Skip to content
animorio
IT
Back to the library

Favourites table

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

The first page of the menu of an invented Mexican kitchen, Nopal: no lists and no cards, but the evening's four favourite dishes seen from above on a wooden table, one for each part of the menu, in real photos. Hovering or tapping a plate lifts it and straightens it, and its name, ingredients and price change beside it on rollers; ‘Order’ sends a copy of the plate into the order, ‘All starters’ flies the plate itself into the page of its part, where it becomes the first dish of the list.

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>
<!--
  "Favourites table" 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>Favourites table</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="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the menu of Nopal, a made up Mexican neighbourhood kitchen: the landing shows tonight's favourites, one from
         every part of the menu, as real plates seen from above on a wooden table. Hovering or tapping a plate lifts it
         and its name, notes and price come in beside it; Order sends a little copy of the plate to the order, and
         «All starters» flies the plate itself into the starters page, where it becomes the first dish of the list -->
    <article class="card" data-card>
      <span class="card__edge" aria-hidden="true"></span>

      <header class="head">
        <span class="brand">
          <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true">
            <path d="M10 17.5V9.2"/>
            <path d="M10 9.2c0-3.4 2.2-5.6 4.4-5.6 0 3.4-2.1 5.6-4.4 5.6z"/>
            <path d="M10 12.4c0-2.6-1.8-4.4-3.8-4.4 0 2.6 1.7 4.4 3.8 4.4z"/>
          </svg>
          <span class="brand__name">Nopal</span>
          <span class="brand__sub">Cocina de barrio</span>
        </span>
        <span class="tab" aria-live="polite" data-tab>
          <!-- the order is a little basket: the plate drops in, the basket takes its weight and the pill fills green for a moment -->
          <span class="tab__fill" aria-hidden="true" data-tabfill></span>
          <span class="cart" aria-hidden="true" data-cart>
            <img class="cart__item" src="nachos.webp" alt="" data-cartitem>
            <svg viewBox="0 0 20 20"><path class="cart__handle" d="M6.6 8.4 9.2 3.9M13.4 8.4 10.8 3.9"/><path class="cart__body" d="M2.9 8.4h14.2l-1.7 7.3a1.7 1.7 0 0 1-1.7 1.3H6.3a1.7 1.7 0 0 1-1.7-1.3z"/><path class="cart__slats" d="M8 11.2v3.1M12 11.2v3.1"/></svg>
          </span>
          <span class="tab__plus" aria-hidden="true" data-plusone>+1</span>
          <span class="tab__words">Your order</span>
          <span class="tab__count"><span class="tab__col" data-tabcol></span></span>
        </span>
      </header>

      <div class="views">
        <!-- the landing: the table with the four favourites and the words of the one you are on -->
        <section class="fav" data-fav aria-label="Tonight's favourites">
          <div class="table" data-table>
            <span class="table__wood" aria-hidden="true"></span>
            <span class="table__lamp" aria-hidden="true"></span>
            <button class="plate" type="button" style="--x:27%;--y:29%;--r:-5deg" aria-label="Loaded nachos, starters" data-plate>
              <span class="plate__lift" data-lift>
                <span class="plate__rim">
                  <img class="plate__img" src="nachos.webp" width="640" height="640" alt="" draggable="false" data-img>
                  <span class="plate__gloss" aria-hidden="true"></span>
                </span>
                <span class="plate__tag" aria-hidden="true">Starters</span>
              </span>
            </button>
            <button class="plate" type="button" style="--x:73%;--y:26%;--r:4deg" aria-label="Picadillo tacos, tacos" data-plate>
              <span class="plate__lift" data-lift>
                <span class="plate__rim">
                  <img class="plate__img" src="tacos.webp" width="640" height="640" alt="" draggable="false" data-img>
                  <span class="plate__gloss" aria-hidden="true"></span>
                </span>
                <span class="plate__tag" aria-hidden="true">Tacos</span>
              </span>
            </button>
            <button class="plate" type="button" style="--x:29%;--y:74%;--r:3deg" aria-label="Churros and cajeta, sweets" data-plate>
              <span class="plate__lift" data-lift>
                <span class="plate__rim">
                  <img class="plate__img" src="churros.webp" width="640" height="640" alt="" draggable="false" data-img>
                  <span class="plate__gloss" aria-hidden="true"></span>
                </span>
                <span class="plate__tag" aria-hidden="true">Sweets</span>
              </span>
            </button>
            <button class="plate" type="button" style="--x:72%;--y:72%;--r:-3deg" aria-label="Lime agua fresca, drinks" data-plate>
              <span class="plate__lift" data-lift>
                <span class="plate__rim">
                  <img class="plate__img" src="lime.webp" width="640" height="640" alt="" draggable="false" data-img>
                  <span class="plate__gloss" aria-hidden="true"></span>
                </span>
                <span class="plate__tag" aria-hidden="true">Drinks</span>
              </span>
            </button>
          </div>

          <div class="info">
            <p class="info__kicker">Tonight's favourites</p>
            <p class="info__cat"><span class="info__mask"><span data-cat>Starters</span></span></p>
            <h2 class="info__name"><span class="info__mask"><span data-name>Loaded nachos</span></span></h2>
            <p class="info__line"><span class="info__mask"><span data-line>Black beans, queso, pico de gallo, crema</span></span></p>
            <p class="price" data-price aria-label="11 dollars">
              <span class="price__cur">$</span>
              <span class="price__col" data-col></span>
              <span class="price__col" data-col></span>
            </p>
            <div class="info__actions">
              <button class="order" type="button" data-order>
                <span class="order__face" data-orderface>
                  <svg class="order__icon" viewBox="0 0 16 16" aria-hidden="true"><path class="order__plus" data-plus d="M8 3.5v9M3.5 8h9"/><path class="order__tick" data-tick pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/></svg>
                  <span class="order__words"><span data-orderwords>Order</span></span>
                </span>
              </button>
              <button class="all" type="button" data-all>
                <span class="all__words"><span data-allwords>All starters</span></span>
                <svg class="all__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.6 4l4 4-4 4"/></svg>
              </button>
            </div>
          </div>
        </section>

        <!-- one part of the menu: the favourite lands as the hero, the rest of the dishes follow in a list -->
        <section class="cat" data-cat-view aria-label="Menu section" inert>
          <div class="cat__top">
            <button class="back" type="button" data-back>
              <svg class="back__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M13 8H3.5M7.4 4l-4 4 4 4"/></svg>
              <span>Favourites</span>
            </button>
            <h2 class="cat__title" data-cat-title>Starters</h2>
          </div>
          <div class="cat__body">
            <span class="cat__hero" data-hero>
              <img class="cat__img" src="nachos.webp" width="640" height="640" alt="" draggable="false" data-hero-img>
              <span class="plate__gloss" aria-hidden="true"></span>
            </span>
            <ol class="dishes" data-dishes></ol>
          </div>
        </section>
      </div>

      <!-- the plate that flies, between the table and the page of its part of the menu, and the little copy that goes to the order -->
      <span class="flyer" aria-hidden="true" data-flyer><img src="nachos.webp" alt="" data-flyer-img><span class="plate__gloss"></span></span>
      <span class="chip" aria-hidden="true" data-chip><img src="nachos.webp" alt="" data-chip-img></span>
    </article>

    <svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer><path d="M5 3l13.5 8.2-6.1 1.3 3.4 6.6-2.6 1.3-3.4-6.6L5 18.4z"/></svg>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

34 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 “Favourites table” 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

A warm white card: at the top the ‘Nopal’ mark, a drawn leaf, and ‘Cocina de barrio’; on the right the ‘Your order’ pill with the number of dishes ordered. Below, a wooden table with its grain and the light of a lamp, and on it four ceramic plates seen from above, each a little askew with its own tag: nachos (Starters), tacos (Tacos), churros (Sweets) and a lime agua fresca (Drinks), real photos. Beside them ‘Tonight's favourites’, the part, the big dish name, the ingredients, the price and two buttons. Hovering or tapping a plate, it rises a few pixels on a spring, grows a little, straightens and its shadow widens, while the others darken; part, name and ingredients rise in their masks and the price turns on rollers (the tens fold away when not needed). ‘Order’ gives, a small copy of the plate arcs to the basket drawn in the ‘Your order’ pill and drops into it, left peeking over the rim; the basket receives it: it sinks with the weight and springs back with a wobble, the pill squashes and swells, fills green for a moment, a ‘+1’ rises and the number rolls, while the button becomes ‘Added’ with a checkmark that draws itself. ‘All starters’ flies the plate itself off the table into the big place on the ‘Starters’ page: the table fades, the title widens on the wdth axis, the four dishes of the part come in one after another with their prices and the favourite carries a ‘Favourite’ tag. ‘Favourites’ (or Esc) makes the journey backwards. On its own it tries the tacos, orders them, opens the starters and comes back, until someone touches it.

How it works

The table and the plates

The table is made of gradients (the grain, the light of the lamp, the darker edge); each plate is a button placed with --x and --y in percent, with its own tilt. Inside, the ceramic rim and the photo: the piece that lifts is a child, so GSAP moves it without touching its place.

Lift and dim

The chosen plate rises, grows and straightens on a spring; two CSS variables, --lift and --dim, widen its shadow and darken the others. So shadow and veil follow the same spring as the movement.

The words and the price

Part, name and ingredients sit in masks: the old text leaves upwards, the new one comes in from below. The price is two columns of digits that scroll; the tens fold away in width when the price has a single digit.

The flying plate

For ‘All starters’ the plate on the table and the big place on the page are measured, relative to the card; a copy of the plate leaves the first and lands on the second with position, size and rotation, while the table fades and the list comes in. The photo's rim is an inset inside the copy: a padding in percent would be measured on the card.

The order

A small round copy of the plate leaves the button and reaches the pill on an arc (x linear, y on another curve); as it lands the number rolls and the pill gives a small nod.

Values to change

NameFileDefaultWhat it changes
LIFTscript.js10Pixels the chosen plate rises from the table.
LIFT_SCALEscript.js1.07How much the chosen plate grows.
STRAIGHTENscript.js0.85How much the chosen plate straightens: 0 keeps its tilt, 1 dead straight.
DIMscript.js0.3How much the other plates darken (0 none).
SPRINGscript.js1.8The bounce of the plates as they rise and settle.
FLY_TIMEscript.js0.95Seconds the plate takes to fly into its part of the menu and back.
AUTOPLAYscript.jstrueLeft alone, it tries the plates, orders and opens the starters until someone touches it.

Try them in the Playground

When to use it

For the home or the first page of the menu of a restaurant, a taqueria, a bar or a takeaway: instead of a list, the favourite dishes on a table, to order straight away or to step into their part of the menu.

On phones

The same animation with adapted sizes: the table above and the words below, the plates sized on height too; a finger picks the plate, orders it and opens its part. On the part's page the photo sits on the left and the list beside it, without the ingredients.

With reduced motion

No flights and no springs: the chosen plate brightens and the others darken with a fade, the words change with a fade, the order count goes up without the flying copy and the part's page arrives with a fade, the photo already in its place.

Pitfalls

  • A padding in percent is worked out on the container's width, not the element's: on the plate copy, hung on the card, the rim became huge and the photo half size. The rim is a 5% inset of the photo, measured on the plate itself.
  • GSAP's inline transform wipes out the CSS rotate property: GSAP sets each plate's tilt itself, at the start.
  • The flight is measured against the card at the moment of the click: the demo's window changes height while you watch it.
  • Going quickly from one plate to another and back, a word swap still on its way out compared the old text and left the wrong dish name: each word now remembers where it is heading and the previous swap stops.
  • Esc or Favourites pressed while the plate was flying got lost and the page stayed open: now the way back starts as soon as the plate lands.
  • Hidden with the hidden attribute, the part's page changed the card's height: closing it, the table jumped once everything had stopped. It stays in the layout, only invisible and inert. And every hand-over between the flying plate and a real one is a very short cross-fade with matching corners and shadows: a hard cut shows the half pixel between them.
  • A fromTo inside a timeline renders at once: the new words hid the old ones before they could leave. With immediateRender: false they really leave, and the opacity comes in on its own, gentler ease.

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 16 KB; the libraries: GSAP 28 KB.

Testing

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