
Title rising from a line
Transitions, Text, Images
The work page of a made-up studio, in the style of product components: a row of pill filters and a mosaic of twelve projects. Changing the filter, the black pill slides under the chosen item, the projects that don’t belong shrink and fade, the ones that stay slide to their new place with short staggered springs, the new ones grow in, the grid changes height with a small bounce and the project count 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>
<!--
"Filter gallery" 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>The gallery that rearranges when you change the filter</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>
<!-- the work page of a made-up studio, Kettleby: a row of filter pills and a mosaic of twelve projects.
Changing the filter, the projects that stay slide to their new place, the others shrink away or grow in -->
<section class="work" data-work>
<header class="top">
<div class="top__head">
<span class="top__brand">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 4v16M5 12l9-8M5 12l10 8"/></svg>
<span data-brand>Kettleby</span>
</span>
<h1 class="top__title">Selected work</h1>
</div>
<p class="count" aria-live="polite"><span class="count__num" data-count></span> <span data-count-word>projects</span></p>
</header>
<nav class="filters" data-filters aria-label="Filter projects">
<span class="filters__pill" data-pill aria-hidden="true"></span>
<button class="filter is-on" type="button" data-filter="all" aria-pressed="true"><span>All</span></button>
<button class="filter" type="button" data-filter="brand" aria-pressed="false"><span>Brand</span></button>
<button class="filter" type="button" data-filter="product" aria-pressed="false"><span>Product</span></button>
<button class="filter" type="button" data-filter="motion" aria-pressed="false"><span>Motion</span></button>
</nav>
<div class="grid" data-grid></div>
</section>
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3l14 8-6 1.6L10 19z"/></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.
20 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 “Filter gallery” from Animorio and fit it into my siteThe grid has four columns and grid-auto-flow: dense, so every filter fills its gaps by itself. The large project spans two columns and two rows, the wide one two columns. The row height comes from misura(): the smaller of three quarters of a column and a quarter of the space left below the filters, so the whole mosaic always fits the window.
Before the change the rectangles of the visible projects and the grid height are read. The projects that leave become absolute where they are, so they don’t push the others; the new ones are switched on. Then everything is read again: every project that stays starts with x and y equal to the gap between old and new place and returns to zero with back.out, staggered by STAGGER.
Leaving projects go down to 0.86 and fade in 0.32 seconds, new ones grow from 0.82 with the same spring, and the grid goes from the old height to the new one with a fromTo on height. At the end the leaving projects are hidden again and lose their inline styles.
The black pill is an element under the buttons: it moves with x and width to the chosen button with back.out. The project count is made of columns of digits, one per position, that rise by as many rows as the digit.
Every cover is a 640 by 480 canvas painted once: a gradient in the category’s three colours, a glow, a shape (sun, object, waves, stripes, circles or horizon) and grain from a fixed seed generator, then a JPEG dataURL as the card background.
| Name | File | Default | What it changes |
|---|---|---|---|
STUDIO | script.js | 'Kettleby' | The name of the made-up studio, at the top left. |
MOVE | script.js | 0.75 | The seconds the projects that stay take to slide to their new place. |
STAGGER | script.js | 0.035 | The stagger between one project and the next, in seconds. |
BOUNCE | script.js | 1.25 | How far the spring goes past its place before settling. |
GRAIN | script.js | 16 | How much grain the painted covers have, from 0 to 40. |
HOLD | script.js | 2.4 | The seconds the autopilot keeps a filter before changing it. |
For the work page of a studio, a photographer or an agency, or for a shop catalogue: visitors pick a category and watch the mosaic put itself back in order, without losing track of where the projects went.
The same animation with adapted sizes: the title goes above the count, the grid keeps four columns and the row height is computed on the box height, so the whole mosaic fits. A tap on a filter selects it.
No sliding: the grid fades out, changes and fades back in; the pill and the count jump straight to their place.
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.
Tested on 26 October 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.