
Falling tools
Physics, Hover
The accent colour panel of a made-up design app, Tintwell: ten colours under glass keys, like a small mechanical keyboard. As the pointer passes, the key sinks on a real spring, its neighbours dip a little with it and a streak of light crosses the glass; meanwhile the preview above floods with that colour in a circle starting from the side of the key, and the button, the word in the headline and the chart bars take it on. The name rolls in, the hex code changes letter by letter, and a click applies the colour.
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>
<!--
"Colour keyboard" 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 colour keyboard with glass keys that press down on hover</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 accent panel of a made-up design app, Tintwell. Ten colours sit under glass keycaps: passing over a key
presses it down like a mechanical key, on a spring, and the preview above floods with that colour from the
side of the key. Clicking a key applies the colour; leaving the keyboard brings back the applied one -->
<section class="panel" data-panel aria-label="Tintwell accent colour">
<span class="panel__sheen" aria-hidden="true"></span>
<header class="head">
<span class="brand">
<svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true">
<circle cx="7.5" cy="8" r="4.6" />
<circle cx="12.5" cy="8" r="4.6" />
<circle cx="10" cy="12.4" r="4.6" />
</svg>
<span class="brand__name">Tintwell</span>
</span>
<span class="head__label">Accent colour</span>
<span class="applied" data-applied aria-live="polite">
<svg class="applied__tick" viewBox="0 0 16 16" aria-hidden="true"><path data-tick d="M3.6 8.4l2.8 2.8 6-6.2" pathLength="1" /></svg>
<span data-applied-text>Applied</span>
</span>
</header>
<div class="preview" data-preview aria-hidden="true">
<span class="preview__tint" data-tint></span>
<span class="preview__flood" data-flood></span>
<div class="mock">
<div class="mock__bar"><span></span><span></span><span></span><i></i></div>
<div class="mock__body">
<div class="mock__text">
<b class="mock__title">Ship the <em>spring</em> palette</b>
<span class="mock__line"></span>
<span class="mock__line mock__line--short"></span>
<span class="mock__button">Get started</span>
</div>
<div class="mock__chart">
<span style="--h: .42"></span><span style="--h: .68"></span><span style="--h: .5"></span><span style="--h: .86"></span><span style="--h: .62"></span>
</div>
</div>
</div>
</div>
<div class="readout">
<span class="readout__swatch" data-swatch></span>
<span class="readout__name"><span data-name>Coral</span></span>
<span class="readout__hex" data-hex>#FF6B4A</span>
<span class="readout__hint" data-hint>Hover a key to preview, click to apply</span>
</div>
<div class="keys" data-keys role="radiogroup" aria-label="Accent colours"></div>
</section>
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.5 18.5 12 12.4 13.6 9.4 19.6z" /></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.
24 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 “Colour keyboard” from Animorio and fit it into my siteEach key is a button with a still dark base, which shows the travel, and a glass cap on top: inside the cap a well with the colour in a radial gradient, a glass veil with a fixed highlight and a streak of light that slides when the key is pressed. Each key's colour is a CSS variable, --c.
Each key has a position and a velocity. Every frame, in three small steps, the acceleration is the stiffness times the distance to the target minus the damping times the velocity: the target is DEPTH under the pointer, a share of DEPTH for the neighbours in the row and the column, a third for the applied key. With little damping the key goes a hair too far and comes back.
Over the preview's tinted ground sits a second ground in the new colour, cut by a circular clip-path. The circle's centre is under the preview, level with the key; the radius goes from zero to the distance to the farthest corner. At the end the new colour becomes the ground and the circle closes unseen. Meanwhile GSAP takes the --accent variable to the new colour, and the button, the headline word and the bars follow it.
The name leaves upwards and the new one comes in from below with a small bounce (the other way round when you go back). The hex code is rebuilt letter by letter, and only the letters that change rise, one after the other.
A click applies the colour: the key gets a dark ring, receives an upward push that the spring brings back down, and the pill redraws its tick. Leaving the keyboard returns the preview to the applied colour. The arrow keys move the applied colour, and the keyboard is a radiogroup.
| Name | File | Default | What it changes |
|---|---|---|---|
DEPTH | script.js | 5 | How many pixels the key under the pointer sinks. |
NEIGHBOUR | script.js | 0.22 | How much the neighbouring keys sink, as a share of DEPTH. |
STIFFNESS | script.js | 520 | Stiffness of the key spring: higher, faster. |
BOUNCE | script.js | 0.32 | How far the key overshoots coming back: 0 none, 1 a lot. |
FLOOD | script.js | 0.55 | Seconds for the colour to flood the preview. |
ROLL | script.js | 0.32 | Seconds for the colour name to roll in. |
LOOP | script.js | true | Left alone, the drawn pointer plays it again. |
For the theme or brand colour panel of a design app, a site builder or an editor; to pick the colour of a product in a shop; anywhere a choice between a few colours deserves a physical gesture and a preview that answers straight away.
The same animation with adapted sizes: the panel takes almost the whole width, the preview gets shorter with the screen height and the hint line disappears. With a finger a tap presses the key and applies the colour.
The keys do not move and there is no streak of light: the preview colour arrives as a fade, the name and the code change without moving, and the self-running loop changes the applied colour at intervals.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.7 KB; the libraries: GSAP 28 KB.
Tested on 8 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.
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.