
The elastic button
Buttons, Hover, Text
A project card in a team app, on very light grey: on top a List, Board and Calendar switcher, and over the chosen view a drop of glass that magnifies its label like a lens. Changing view, the drop slides and stretches, magnifying a little more as it runs, and the six tasks below lift, fly to their place in the new view (rows, To do, Doing and Done columns, days of the week) and settle on a spring.
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>
<!--
"Glass drop view switcher" 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 view switcher with a glass drop and tasks that rearrange</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 project card with a List / Board / Calendar switcher: the chosen view sits under a drop of glass that
magnifies its label, and the six tasks below really move to their place in the new view -->
<section class="card" data-card aria-label="Tallyroom sprint">
<header class="card__head">
<span class="brand">
<svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><rect x="3" y="3" width="14" height="14" rx="4"></rect><path d="M7 8h6M7 12h3.5"></path></svg>
<span class="brand__name">Tallyroom</span>
</span>
<span class="card__meta"><span data-count>6 tasks</span> in Launch week</span>
</header>
<div class="seg" role="radiogroup" aria-label="View" data-seg>
<span class="seg__drop" data-drop aria-hidden="true">
<span class="seg__lens" data-lens></span>
<span class="seg__shine"></span>
</span>
<button class="seg__opt" type="button" role="radio" aria-checked="true" tabindex="0" data-opt="0">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M5.5 4.5h7M5.5 8h7M5.5 11.5h7"></path><path d="M3 4.5h.01M3 8h.01M3 11.5h.01"></path></svg>
<span>List</span>
</button>
<button class="seg__opt" type="button" role="radio" aria-checked="false" tabindex="-1" data-opt="1">
<svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.5" y="3" width="3" height="10" rx="1"></rect><rect x="6.5" y="3" width="3" height="7" rx="1"></rect><rect x="10.5" y="3" width="3" height="5" rx="1"></rect></svg>
<span>Board</span>
</button>
<button class="seg__opt" type="button" role="radio" aria-checked="false" tabindex="-1" data-opt="2">
<svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.5" y="3.5" width="11" height="10" rx="2"></rect><path d="M2.5 6.5h11M5.5 2v3M10.5 2v3"></path></svg>
<span>Calendar</span>
</button>
</div>
<div class="view" data-view>
<div class="heads" data-heads aria-hidden="true"></div>
<div class="grid" data-grid aria-hidden="true"></div>
</div>
</section>
<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.
23 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 “Glass drop view switcher” from Animorio and fit it into my siteInside the drop sits a second row of the three options, the same as the first but in black and with the coloured icon. The drop has overflow hidden and moves; the copy inside moves the opposite way by the same amount, so it stays still against the track, and is magnified by LENS around the drop’s centre: what you see in the drop is the label beneath, bigger.
The drop has no position but two edges in an object animated by GSAP; the edge facing the new option leaves at once, the other a moment later (STRETCH), both arrive one pixel past and a half spring puts them back exactly. The same object also holds the magnification, which rises as it runs and comes back on an elastic spring.
For each view a function works out, from the box size, where every task goes: x, y, width and height. Changing view every task goes to its rectangle with back.out, staggered by STAGGER in the direction the drop runs; in the narrow views the is-small class drops the initials halfway through the flight.
While flying each task grows by three per cent and takes a wider shadow, then settles; the title inside arrives a little late, as if dragged. The columns and days behind appear from the top in a row, the old ones rise away.
With a mouse over the track the drop leans at most three pixels towards the pointer. Everything is recomputed on resize, even mid-change: the drop finishes its run and the tasks go straight to the new rectangles.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #2563eb | The colour of tasks in progress, of the icons under the drop and of the mark. |
LENS | script.js | 1.14 | How much the glass drop magnifies the label beneath it. |
STRETCH | script.js | 1 | How much the drop stretches as it slides. |
SLIDE_TIME | script.js | 0.46 | The seconds the drop takes to reach the new option. |
MOVE_TIME | script.js | 0.7 | The seconds each task takes to reach its place in the new view. |
STAGGER | script.js | 0.045 | The seconds between one task and the next. |
PAUSE | script.js | 2 | The seconds the autopilot stays on each view. |
For the List, Board and Calendar views of a project or task app, the List and Grid views of a catalogue or a file library, any short switcher that changes how the same items are shown.
The card takes the full width minus the margin and the task box is sized on the height, so the three views fit the box. In narrow columns and days the initials disappear and the title is cut with an ellipsis. Touch picks like a click; the magnet only works with a mouse.
The drop fades out and back in on the new option, the tasks fade out and back in already in place, the columns and days fade in.
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 28 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.