
The layered button
Buttons, Hover, Physics
The kitchen timer of a made-up recipe app, Ortica, on black: like an old wind-up kitchen timer you turn the whole brushed metal bezel under a fixed index, and the minute ticks click past one by one with a small bounce while the big figure in the middle rolls. Let go, the bezel slowly turns back as the time runs down and the arc of time left shortens; in the last ten seconds the accent warms from amber to red, and at zero the bezel buzzes twice and says Pasta’s ready. Below, three presets: Eggs 7, Pasta 10, Rice 18.
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>
<!--
"Dial kitchen timer" 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 kitchen timer with the dial you wind that turns back on its own</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 kitchen timer of a made-up recipe app: wind the brushed bezel round under the index like an old spring timer,
let go and it turns back slowly as the time runs down; the arc of time left shortens, the accent warms up in the
last seconds and at zero the dial buzzes and says the dish is ready -->
<div class="timer" data-timer>
<div class="dial" data-dial role="slider" tabindex="0" aria-label="Kitchen timer, minutes" aria-valuemin="0" aria-valuemax="60" aria-valuenow="0" aria-valuetext="0 minutes">
<div class="dial__shake" data-shake>
<span class="dial__glow" aria-hidden="true"></span>
<div class="dial__press" data-press>
<span class="dial__housing" aria-hidden="true"></span>
<svg class="dial__track" viewBox="-150 -150 300 300" aria-hidden="true">
<circle class="track" r="140" />
<circle class="arc" data-arc r="140" pathLength="360" transform="rotate(-90)" />
<circle class="flash" data-flash r="140" />
</svg>
<span class="dial__drop" aria-hidden="true"></span>
<span class="dial__bezel" data-bezel aria-hidden="true"></span>
<div class="dial__turn" data-turn aria-hidden="true">
<span class="dial__knurl"></span>
<svg class="dial__ticks" data-ticks viewBox="-129 -129 258 258"></svg>
</div>
<svg class="dial__index" viewBox="-150 -150 300 300" aria-hidden="true">
<g data-needle>
<line class="needle__shadow" x1="0" y1="-132" x2="0" y2="-111" />
<line class="needle" x1="0" y1="-132" x2="0" y2="-111" />
</g>
</svg>
<button class="face" type="button" data-face aria-label="Pause">
<span class="face__brand">Ortica</span>
<span class="face__time" data-time aria-hidden="true"></span>
<span class="face__label">
<svg class="glyph" viewBox="0 0 12 12" aria-hidden="true">
<g class="glyph__pause" data-gpause><rect x="2.6" y="2" width="2.2" height="8" rx="0.9" /><rect x="7.2" y="2" width="2.2" height="8" rx="0.9" /></g>
<path class="glyph__play" data-gplay d="M3.4 2.4v7.2a.6.6 0 0 0 .9.5l5.6-3.6a.6.6 0 0 0 0-1L4.3 1.9a.6.6 0 0 0-.9.5Z" />
</svg>
<span class="face__words" data-label><span class="w" data-w>Turn to set</span><span class="w" data-w></span></span>
</span>
</button>
</div>
</div>
</div>
<div class="presets" data-presets role="group" aria-label="Recipes"></div>
<p class="sr" data-live aria-live="polite"></p>
</div>
<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 “Dial kitchen timer” from Animorio and fit it into my siteThe bezel is two layers: underneath a ring with the conic-gradient of the highlights and the fine circles of the brushing (repeating-radial-gradient), which does not turn; on top a transparent layer with the knurling (repeating-conic-gradient in a ring mask) and the SVG ticks, which turns. So the highlights stay with the light as on real metal. Minute m is engraved at -m steps: turning clockwise brings it under the index.
On every pointermove the pointer’s angle round the centre is measured with atan2 and the difference (wrapped between -180 and 180) is added up, so you can go round more than once and the finger can be anywhere on the ring. The target is the nearest tick plus part of the rest (DETENT): between two ticks the bezel holds back, then jumps. Past zero and past the full turn it only follows by a quarter, like a rubber band.
A requestAnimationFrame loop integrates a spring (STIFF, BOUNCE) in four steps per frame, with the step capped at 1/30 of a second: it follows the finger, bounces after each tick and while running chases the time left, worth one degree every ten seconds. Every click also gives the velocity a small kick. When nothing moves the loop stops.
Each figure is a column 9,0…9,0 in a window with a faded mask, moved with yPercent: the two extra cells turn 0 into 9 and 9 into 0 the right way round, then the column jumps back into place. When the time runs faster than the frames the seconds are set without animation.
In the last HOT_FROM seconds the --acc colour is mixed between ACCENT and HOT in JavaScript and written on :root, together with --heat, which raises the glow. At zero a GSAP timeline shakes the disc with rotation keyframes, flashes a red ring and swings the index round its tip, twice.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #f3b664 | The accent of the arc, the index, the lit ticks and the presets’ figures. |
HOT | script.js | #ff5b3a | The warm colour the accent turns to in the last seconds. |
HOT_FROM | script.js | 10 | How many seconds before the end the accent starts warming. |
MAX_MIN | script.js | 60 | The minutes of a whole turn of the bezel. |
DETENT | script.js | 0.7 | How much the bezel stops on the ticks as you turn it, from 0 smooth to 1 notched. |
STIFF | script.js | 260 | The bezel’s spring: the higher, the quicker it follows the finger. |
BOUNCE | script.js | 0.5 | How much the bezel bounces on the tick, from 0 to 0.9. |
PILOT_SPEED | script.js | 150 | How many times faster the time runs when the demo is left alone. |
PRESETS | script.js | [["Eggs", 7], ["Pasta", 10], ["Rice", 18]] | The three presets: the dish and the minutes. |
DONE_HOLD | script.js | 2.6 | How many seconds the dish-ready line stays. |
On a recipe page, in the cooking mode of a recipe app or a kitchen appliance, on the site of a restaurant or a pasta maker that gives away cooking times, in a home or café app: wherever you need a countdown set with a single gesture and readable from across the room.
The disc is sized on the shorter side (min(300px, 72vw, 54vh)) and the pills narrow a little under 380 pixels, so everything fits the phone box. The finger turns the bezel like the mouse, with touch-action none so the page does not scroll; without hover the highlights stay still.
No spring, bounces, index nods or shaking: the bezel goes straight where it should, the figures change without rolling, the words fade and at zero the red ring fades out slowly. The pilot presses Pasta 10 without a pointer.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 13 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.