
The elastic button
Buttons, Hover, Text
A box-shadow editor in a card on white: a white tile on a grey floor and a light to drag all around it. The shadow stretches away on the opposite side and catches up with the light on a spring, and the edge of the tile facing the light brightens. Below, softness on a slider, one to three layers and the CSS rewriting itself at every move, ready to copy with a tap.
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>
<!--
"Shadow editor" 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>Shadow editor</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 box-shadow editor: a light to drag around a tile, the shadow stretching away from it in layers,
softness and layer count to set, and the CSS rewriting itself underneath -->
<section class="se" data-se aria-label="Shadow editor">
<header class="se__head">
<strong>Shadow</strong>
<button type="button" class="se__copy" data-copy>
<svg viewBox="0 0 16 16" aria-hidden="true"><rect class="se__sheet" x="5.500" y="5.500" width="8" height="8" rx="2"></rect><path class="se__sheet" d="M10.500 3.200V3a1 1 0 0 0-1-1H3.500a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h.200"></path><path class="se__tick" pathLength="1" d="M3.400 8.400 6.600 11.500 12.700 4.800"></path></svg>
<span class="se__copyclip"><span data-outcopy>Copy CSS</span></span>
</button>
</header>
<div class="se__view" data-view>
<svg class="se__ray" data-ray aria-hidden="true"><line data-rayline x1="0" y1="0" x2="0" y2="0"></line></svg>
<div class="se__lift" data-lift><div class="se__tile" data-tile></div></div>
<button type="button" class="se__sun" data-sun aria-label="Light position. Arrow keys move the light."><span class="se__knob"><svg viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="3.400"></circle><path d="M10 2.200v2.300M10 15.500v2.300M2.200 10h2.300M15.500 10h2.300M4.500 4.500l1.600 1.600M13.900 13.900l1.600 1.600M4.500 15.500l1.600-1.600M13.900 6.100l1.600-1.600"></path></svg></span></button>
</div>
<label class="se__row">
<span class="se__name">Softness</span>
<input type="range" class="se__range" min="0" max="100" step="1" value="60" data-soft>
<output class="se__val" data-outsoft>60</output>
</label>
<div class="se__row">
<span class="se__name" id="se-layers">Layers</span>
<div class="se__seg" role="radiogroup" aria-labelledby="se-layers" data-layers>
<i class="se__thumb" data-thumb aria-hidden="true"></i>
<button type="button" role="radio" aria-checked="false" data-n="1">1</button>
<button type="button" role="radio" aria-checked="false" data-n="2">2</button>
<button type="button" role="radio" aria-checked="true" data-n="3">3</button>
</div>
</div>
<pre class="se__code" aria-label="CSS"><span class="se__prop">box-shadow:</span><span class="se__line" data-outline></span><span class="se__line" data-outline></span><span class="se__line" data-outline></span></pre>
</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.
19 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 “Shadow editor” from Animorio and fit it into my siteThe light’s position runs from minus one to one on both axes, with the tile in the middle: it holds at any size of the floor.
A second point, the shadow’s, catches up with the light on a spring: the lag and the settling come from there.
Each layer is further, wider and fainter than the one before, on a squared curve: three light shadows make one truly soft shadow.
The string written onto the tile is the one shown in the box and the one copied: they cannot differ.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #f0a01e | The colour of the light. |
REACH | script.js | 26 | How many pixels the shadow stretches when the light is at the edge. |
DARK | script.js | 0.22 | How dark the shadow is. |
LAG | script.js | 0.9 | How many seconds the shadow takes to catch up with the light and settle. |
LOOP | script.js | true | Left alone, the demo’s pointer drags the light, changes softness and layers and copies the CSS. |
In the panel of a design app or a site builder, where a card’s shadow is chosen; in a design system’s documentation, on the elevation page; and in a developer tool that generates CSS. The same draggable light carries the angle of a gradient or the direction of an emboss.
The card is at most 348 pixels wide and about 350 tall; the floor gets shorter on short screens. The light has a 44-pixel hit area and drags under the finger without scrolling the page; the code stays on one line per layer.
No springs or entrances: the shadow is at once where the light sends it, the layers thumb and the texts 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 8.2 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.