
The elastic button
Buttons, Hover, Text
The layers panel of a design app, in a card on white: at the top the artboard with three overlapping shapes, below it their list, from the top layer to the bottom one. Picking a row gives the shape its selection frame with four handles; “Bring forward” and “Send back” swap two rows on a spring, and the shape lifts, goes over or under and settles. The eye hides a layer: the shape withdraws and the eye gets its slash.
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>
<!--
"Layers panel" 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>Layers panel</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 layers panel of a design app: three overlapping shapes and their list. The eye hides a layer, picking
a row frames its shape, and Bring forward swaps two rows and the order of the shapes -->
<section class="lp" data-lp aria-label="Layers">
<div class="lp__view" aria-hidden="true">
<div class="lp__art" data-art>
<div class="lp__shape lp__shape--circle" data-shape="circle"><i></i></div>
<div class="lp__shape lp__shape--square" data-shape="square"><i></i></div>
<div class="lp__shape lp__shape--pill" data-shape="pill"><i></i></div>
<span class="lp__sel" data-sel><i></i><i></i><i></i><i></i></span>
</div>
</div>
<header class="lp__head"><strong>Layers</strong><span class="lp__clip"><span data-outinfo>Pick a layer to move it</span></span></header>
<div class="lp__list" data-list role="listbox" aria-label="Layers, top first"></div>
<div class="lp__acts">
<button type="button" class="lp__btn" data-move="-1"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 12.500v-9M4.200 7.300 8 3.500l3.800 3.800"></path></svg>Bring forward</button>
<button type="button" class="lp__btn" data-move="1"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.500v9M4.200 8.700 8 12.500l3.800-3.800"></path></svg>Send back</button>
</div>
</section>
<span class="live" aria-live="polite" data-live></span>
<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.
15 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 “Layers panel” from Animorio and fit it into my siteThe order is an array of three names: the first is the top layer. The rows’ positions and the shapes’ z-index both come from it.
Every row is put in place with a translation: swapping two names in the array is enough to make them slide into each other’s place on a spring.
The shape grows for a moment, the z-index changes while it is lifted and then it comes back down: the overtaking never snaps in view.
The selection frame is a single element taking the position and size of the picked shape, and it hides if the layer is hidden.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #2f6bff | The colour of the selection frame. |
LIFT | script.js | 1.07 | How much the shape grows while changing place in the stack. |
SPRING | script.js | 1 | How much the rows and shapes bounce. |
LOOP | script.js | true | Left alone, the demo’s pointer picks a layer, brings it to the top and hides another. |
In the sidebar of a design app, an image, slide or map editor, and in a page builder where sections stack. The same list with swapping rows carries the order of tracks in a mixer or of rules in a filter.
The card is at most 348 pixels wide and about 350 tall; the artboard gets shorter on short screens and the shapes keep their size. Eyes and rows are 40 pixels tall, the two buttons 44.
No animated swaps and no lifting shapes: rows, order, frame and eyes change in one step. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.6 KB; the libraries: GSAP 28 KB.
Tested on 1 December 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.