
The liquid grid
Hover, Transitions
Swapping a shift with a colleague in a rota app: pick who with, their shift drops into the place on the right, and “Ask to swap” sends the request. While it waits the two shifts lift a little off their places; on approval they cross, one over and one under, and land swapped while the week’s hours roll. “Undo swap” brings them back.
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>
<!--
"Shift swap" 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>Shift swap</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">
<!-- swapping a shift with a colleague in a rota app: pick who, ask, and when they approve the two
shifts cross and land in each other's place while the week's hours roll -->
<section class="sw" data-sw aria-labelledby="sw-title">
<header class="sw__head">
<h1 id="sw-title">Swap a shift</h1>
<p class="sw__hours"><span>Your week</span><b data-hours>38 h</b></p>
</header>
<div class="sw__pair">
<div class="sw__slot is-you" data-slot-a>
<p class="sw__who"><i class="sw__face" aria-hidden="true">Y</i><span>You</span></p>
<div class="sw__frame">
<article class="tk" data-ticket-a>
<div class="tk__in">
<i class="tk__bar" aria-hidden="true"></i>
<b class="tk__day">Sat 28</b>
<span class="tk__time">07:00 – 15:00</span>
<em class="tk__tag">Morning · 8 h</em>
</div>
</article>
</div>
</div>
<span class="sw__turn" data-turn aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M4.500 7.500h10.500l-3-3M15.500 12.500H5l3 3"></path></svg></span>
<div class="sw__slot" data-slot-b>
<p class="sw__who"><i class="sw__face" aria-hidden="true" data-face>N</i><span class="sw__roll"><span data-name>Nora</span></span></p>
<div class="sw__frame">
<article class="tk" data-ticket-b>
<div class="tk__in" data-in-b>
<i class="tk__bar" aria-hidden="true"></i>
<b class="tk__day" data-day>Sun 29</b>
<span class="tk__time" data-time>15:00 – 21:00</span>
<em class="tk__tag" data-tag>Evening · 6 h</em>
</div>
</article>
</div>
</div>
</div>
<div class="sw__with" role="radiogroup" aria-label="Swap with" data-with>
<i class="sw__pick" data-pick aria-hidden="true"></i>
<button class="sw__chip" type="button" role="radio" aria-checked="true" data-chip>Nora</button>
<button class="sw__chip" type="button" role="radio" aria-checked="false" tabindex="-1" data-chip>Idris</button>
<button class="sw__chip" type="button" role="radio" aria-checked="false" tabindex="-1" data-chip>Mei</button>
</div>
<p class="sw__say" aria-live="polite"><span data-say>You’d work Sun 29, 15:00 – 21:00</span></p>
<button class="sw__go" type="button" data-go>
<i class="sw__bar" data-bar aria-hidden="true"></i>
<span class="sw__gotext"><span data-golabel>Ask Nora to swap</span></span>
</button>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.
32 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Shift swap” from Animorio and fit it into my sitek goes from 0 (each in its place) to 1 (swapped). One function works out the pose of both shifts from it: x is the distance between the places times k, y and tilt follow the sine of k, so half way they are at their most and on arrival at zero.
Your shift rises LIFT pixels and grows 5%, the other drops and shrinks: with a fixed z-index it really seems to pass underneath.
The request takes k to 0.1 (the shifts lift a little) and runs a line along the bottom of the button for WAIT seconds; then a single tween takes k to 1 with an ease that takes a run-up and goes slightly past the arrival.
The week’s hours sit in the same object and the same tween: on undo they come back together with the shifts.
Three buttons in a radiogroup with the keyboard arrows; the pill moves in percent, so there is nothing to measure again, and the content of the shift on the right leaves and comes back.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #8b7bff | The colour of your place, of the request and of the finished swap. |
WAIT | script.js | 1.4 | The seconds of waiting before the colleague approves. |
CROSS | script.js | 0.9 | How long the two shifts take to cross. |
LIFT | script.js | 26 | How many pixels the shifts rise and drop while crossing. |
TILT | script.js | 6 | How many degrees they lean half way. |
HOURS | script.js | 38 | Your hours for the week before the swap. |
LOOP | script.js | true | Left alone, the demo’s pointer picks a colleague, asks for the swap and then undoes it. |
In the rota app of a bar, a shop, a hospital or a warehouse, and in workforce tools: when someone cannot work a shift and offers it to a colleague, with approval before it really changes.
The same card, as wide as the screen minus the margins: the two places stay side by side (the distance is measured again on every width change), under 340 pixels day and time tighten a little, and names and button are 28 and 44 pixels tall.
The shifts do not fly: they fade out and back in already swapped; the colleague’s pill and the words change in one step and the hours go straight to the new number. The demo does not move by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.8 KB; the libraries: GSAP 28 KB.
Tested on 24 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.
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.