
Speeding marquee
Scroll, Text, Hover
A restaurant’s online menu with four chips to say what you cannot eat: gluten, dairy, nuts, shellfish. Switching one on, the dishes that contain it lose colour, their tag lights up red and they slide to the bottom of the list on a spring, while the suitable ones move up; at the top the number of dishes left rolls.
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>
<!--
"Allergen filter 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>Restaurant menu with allergen filters and dishes that reorder</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">
<!-- a restaurant's online menu: four chips say what you cannot eat; switching one on, the dishes that contain it
lose colour, their allergen tag lights up and they slide to the bottom of the list on a spring while the safe
ones move up; the line at the top counts how many dishes are left for you -->
<section class="menu" data-menu aria-label="Dinner menu">
<header class="head">
<div>
<p class="head__brand">Fig & Fennel</p>
<h1 class="head__title">Dinner menu</h1>
</div>
<p class="head__fit"><span class="head__n"><span data-fit>6</span></span><span class="head__l" data-fit-label>dishes for you</span></p>
</header>
<div class="chips" role="group" aria-label="Leave out">
<button class="chip" type="button" data-chip="gluten" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"></path></svg><span>Gluten</span></button>
<button class="chip" type="button" data-chip="dairy" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"></path></svg><span>Dairy</span></button>
<button class="chip" type="button" data-chip="nuts" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"></path></svg><span>Nuts</span></button>
<button class="chip" type="button" data-chip="shellfish" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"></path></svg><span>Shellfish</span></button>
</div>
<ul class="dishes" data-dishes>
<li class="dish" data-has="dairy"><div class="dish__in"><p class="dish__name">Burrata, tomato, basil oil</p><p class="dish__tags"><span data-tag="dairy">dairy</span></p><p class="dish__price">14</p></div></li>
<li class="dish" data-has="nuts"><div class="dish__in"><p class="dish__name">Charred leeks, hazelnut</p><p class="dish__tags"><span data-tag="nuts">nuts</span></p><p class="dish__price">12</p></div></li>
<li class="dish" data-has="gluten"><div class="dish__in"><p class="dish__name">Tagliatelle, slow beef ragù</p><p class="dish__tags"><span data-tag="gluten">gluten</span></p><p class="dish__price">18</p></div></li>
<li class="dish" data-has="shellfish dairy"><div class="dish__in"><p class="dish__name">Prawn risotto, lemon</p><p class="dish__tags"><span data-tag="shellfish">shellfish</span><span data-tag="dairy">dairy</span></p><p class="dish__price">22</p></div></li>
<li class="dish" data-has=""><div class="dish__in"><p class="dish__name">Grilled sea bass, fennel</p><p class="dish__tags"><span class="dish__free">free of all four</span></p><p class="dish__price">26</p></div></li>
<li class="dish" data-has="nuts gluten dairy"><div class="dish__in"><p class="dish__name">Pistachio cake, cream</p><p class="dish__tags"><span data-tag="nuts">nuts</span><span data-tag="gluten">gluten</span><span data-tag="dairy">dairy</span></p><p class="dish__price">9</p></div></li>
</ul>
</section>
<p class="sr" data-live aria-live="polite"></p>
<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>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.
40 values to change
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 “Allergen filter menu” from Animorio and fit it into my siteEach row has data-has with its allergens; the chips that are on live in a Set. A dish is ‘out’ if one of its allergens is in the Set: it takes the is-out class and the tags hit take is-hit.
Before reordering, the position of each row is measured; then the rows are put back in the DOM (suitable ones first, then the others, each in the menu’s order), measured again, and each row starts from the difference and returns to zero with a heavily damped elastic.out.
A row that moves by more than 4 pixels goes above the others with z-index, and its content shifts LIFT pixels sideways and back: it looks like it is making its way.
It rolls up when the dishes go down in number and down when they come back; next to it the word goes from ‘dishes’ to ‘dish’ when one is left.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #d6482a | The colour of the allergen found in a dish. |
SPRING | script.js | 0.75 | How long the spring of the dishes changing place lasts, in seconds. |
STAGGER | script.js | 0.035 | The delay between one dish and the next, in seconds. |
LIFT | script.js | 6 | By how many pixels a dish shifts while it overtakes the others. |
PACE | script.js | 1.4 | By itself: the pause after each filter, in seconds. |
LOOP | script.js | true | Left alone, a pointer switches the filters on and off. |
For the online menu of a restaurant, a bar, a pastry shop or a delivery service: someone with an allergy sees at once what they can order, without the dishes disappearing. The same reordering suits any list to filter while keeping visible what is left out.
The same card, as wide as the screen: the four chips share the row, long names are cut with an ellipsis and, on narrow screens, the words next to the number disappear. On a short screen the rows tighten by a few pixels.
No sliding: the dishes change place at once and change colour with a fade; the number changes with a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.4 KB; the libraries: GSAP 28 KB.
Tested on 14 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.