Skip to content
animorio
IT
All components

Dish of the day card

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

The dish-of-the-day card of a food delivery app, with a real photo: over the photo a glass label with the minutes left to order and a ring running down; below, the portions to choose with the total counting and the photo leaning in slightly, and the button that fills with green when the dish joins the order.

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>
<!--
  "Dish of the day card" 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>Dish of the day card</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">
    <!-- the dish of the day of a food delivery app: the minutes left to order run down on a ring,
         the portions change the total, and the button adds it to the order -->
    <article class="dd" data-dd aria-label="Dish of the day">
      <div class="dd__photo" data-photo>
        <img src="linguine.webp" alt="A plate of creamy linguine with ham and chopped parsley" width="1024" height="683" data-img>
        <span class="dd__chip">Dish of the day</span>
        <span class="dd__left" aria-live="off">
          <svg viewBox="0 0 20 20" aria-hidden="true"><circle class="left__bed" cx="10" cy="10" r="7.500"></circle><circle class="left__arc" data-arc pathLength="1" cx="10" cy="10" r="7.500"></circle></svg>
          <span class="dd__mins"><span data-mins></span></span>
        </span>
      </div>

      <div class="dd__info">
        <h2 class="dd__name">Creamy ham linguine</h2>
        <p class="dd__from">Trattoria Colomba, ready in 25 min</p>
      </div>

      <div class="dd__buy">
        <div class="dd__qty" role="group" aria-label="Portions">
          <button type="button" data-less aria-label="One portion less"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.500 8h9"></path></svg></button>
          <span class="dd__n" aria-live="polite"><span data-n>1</span></span>
          <button type="button" data-more aria-label="One portion more"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.500 8h9M8 3.500v9"></path></svg></button>
        </div>
        <button class="dd__add" type="button" data-add>
          <span class="dd__fill" data-fill aria-hidden="true"></span>
          <span class="dd__label"><span data-label>Add to order</span></span>
          <span class="dd__price" data-price></span>
          <svg class="dd__tick" viewBox="0 0 20 20" aria-hidden="true"><path data-tick pathLength="1" d="M4.500 10.500 8.500 14.500 15.500 6"></path></svg>
        </button>
      </div>
    </article>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></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 “Dish of the day card” 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 white, a card: at the top the photo of a plate of creamy linguine with ham, with two glass labels, “Dish of the day” on the left and on the right the minutes left with an orange ring; below, the dish’s name and the trattoria; at the bottom the portions stepper and the dark “Add to order” button with the price. On opening the photo slowly pulls back to its size. Now and then a minute passes: the number rolls and the ring gets shorter. Pressing plus, the portions figure rolls upwards, the total counts to the new price with a small beat of scale and the photo leans in for a moment; minus does the opposite. Moving over the photo, the dish shifts a few pixels towards the pointer. Pressing the button, a green fills it from the left, the price gives way to a tick and the label says “3 in your order”; then everything is ready again, at one portion.

How it works

A real photo, still in its frame

The photo is an img with object-fit cover inside a frame with hidden overflow: GSAP only moves its scale and position by a few percentage points, so the edges are never uncovered.

The total without a spring

The price counts with power2.out and never overshoots; the bounce is in the figure’s scale, not in the number. The portions roll in the direction of the change.

The green that fills

Inside the button sits a green layer with scaleX from 0 to 1 and its origin on the left: label, price and tick sit above it. A delayed call takes everything back.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#e8590cThe colour of the time ring.
PRICEscript.js12.5The price of one portion.
CURRENCYscript.js€The currency symbol.
MINUTESscript.js18How many minutes are left to order.
TICKscript.js2.5In the demo: how many seconds a minute takes.
MAXscript.js6The maximum number of portions.
HOLDscript.js2How many seconds it stays on “added” before going back to ready.
LOOPscript.jstrueLeft alone, a pointer picks three portions and adds them.

Try them in the Playground

When to use it

On the home of a food delivery app, on a restaurant’s site with its lunch special, in a company canteen; and wherever an offer has a photo, a quantity and a deadline: the cake of the week, a veg box, a limited menu.

On phones

The same card: the photo gets shorter with the window’s height, the portion keys are 36 pixels wide and the button is 46 tall; a long name is cut with an ellipsis.

With reduced motion

No rolls, leaning in or filling: portions, total, minutes and the button’s state change at once, and the photo stays still.

Pitfalls

  • In the demo a minute passes every few seconds and then the count restarts: in a real app the deadline comes from the server and, when time is up, the button goes off.
  • The labels over the photo use backdrop-filter: where it is missing they stay readable because the ground is nearly solid white. The photo has alt text saying what is shown.
  • Dish, trattoria, price and times are made up. The photo is real and in the public domain: if you change it, you need one with a licence that allows its use.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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