
The star rating
Ratings, SVG, Hover
The digital key button in a hotel app, made of smoked glass on a warm black, like a Dribbble shot: on the left a padlock inside a champagne metal well, then Unlock Room 412 with the hotel and the floor underneath, on the right the contactless sign. On hover a soft light follows the pointer and the sheen on the metal rim turns towards it. Tapped, a ring of light closes around the padlock while the phone talks to the door; then the shackle springs up and opens, an amber light spreads through the glass from the lock like the light of a door left ajar, and the ring drains as the seconds roll down until the door locks again with a click.
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>
<!--
"Digital room key button" 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 digital room key button that unlocks the door</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 digital key of a hotel app: a pill of smoked glass with a champagne metal lock on the left. Tapped, a ring
of light closes around the lock while the phone talks to the door, then the shackle springs open, a warm
light spreads through the glass from the lock like the light of a door left ajar, and the ring drains as the
seconds count down to the relock. At zero the shackle snaps shut and the light goes back into the lock -->
<div class="rk" data-wrap>
<span class="rk__spill" data-spill aria-hidden="true"></span>
<button class="rk__btn" type="button" data-btn data-autoclic aria-label="Unlock room 412">
<span class="rk__glass" data-glass>
<span class="rk__base" aria-hidden="true"></span>
<span class="rk__door" aria-hidden="true"><span class="rk__door-light" data-door></span><span class="rk__door-edge" data-edge></span></span>
<span class="rk__shine" data-shine aria-hidden="true"></span>
<span class="rk__frost" aria-hidden="true"></span>
<span class="rk__rim" data-rim aria-hidden="true"></span>
<span class="rk__row">
<span class="rk__well" aria-hidden="true">
<svg class="rk__ring" viewBox="0 0 58 58">
<defs>
<linearGradient id="rk-grad" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="var(--amber)"/>
<stop offset="1" stop-color="var(--brass)"/>
</linearGradient>
</defs>
<circle class="rk__ring-track" cx="29" cy="29" r="26.5"/>
<circle class="rk__ring-glow" data-ring-glow cx="29" cy="29" r="26.5" pathLength="1" transform="rotate(-90 29 29)"/>
<circle class="rk__ring-line" data-ring cx="29" cy="29" r="26.5" pathLength="1" transform="rotate(-90 29 29)"/>
</svg>
<span class="rk__metal" data-metal>
<span class="rk__face" data-face>
<svg class="rk__lock" viewBox="0 0 24 24">
<path class="rk__shackle" data-shackle d="M8.4 11.2V8.4a3.6 3.6 0 0 1 7.2 0v2.8"/>
<path class="rk__shackle rk__shackle--open" data-shackle-open d="M8.4 11.2V5.9a3.6 3.6 0 0 1 7.2 0"/>
<g data-body>
<rect class="rk__body" x="5.6" y="10.6" width="12.8" height="9.6" rx="2.4"/>
<rect class="rk__body-hi" x="6.4" y="11.3" width="11.2" height="1" rx="0.5"/>
<path class="rk__hole" d="M12 13.9a1.35 1.35 0 0 1 .7 2.5v1.5h-1.4v-1.5a1.35 1.35 0 0 1 .7-2.5z"/>
</g>
</svg>
</span>
</span>
</span>
<span class="rk__words">
<span class="rk__stack" aria-hidden="true">
<span class="rk__label" data-label>Unlock Room 412</span>
<span class="rk__label" data-label>Connecting</span>
<span class="rk__label rk__label--open" data-label>Door open</span>
</span>
<span class="rk__stack" aria-hidden="true">
<span class="rk__sub" data-sub>Aurelia Hotel · Floor 4</span>
<span class="rk__sub" data-sub>Hold near the lock</span>
<span class="rk__sub" data-sub>Relocks in <span class="rk__count" data-count><span class="rk__digit" data-digit>5</span></span>s</span>
</span>
</span>
<span class="rk__nfc" aria-hidden="true">
<svg viewBox="0 0 24 24">
<path class="rk__arc" data-arc d="M6.6 9.4a3.6 3.6 0 0 1 0 5.2"/>
<path class="rk__arc" data-arc d="M9.8 6.8a7.3 7.3 0 0 1 0 10.4"/>
<path class="rk__arc" data-arc d="M13 4.2a11 11 0 0 1 0 15.6"/>
</svg>
</span>
</span>
</span>
</button>
</div>
<p class="sr" aria-live="polite" data-live></p>
</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.
22 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 “Digital room key button” from Animorio and fit it into my siteThe button is a single box moved only by GSAP; inside, absolute layers with overflow hidden and the same radius: a warm dark base, the door light, the light under the pointer (a radial-gradient on two CSS variables moved by gsap.quickTo), a pane with a feTurbulence grain and three inner shadows for the one pixel edge, and on top an amber edge with a mask-image that makes it stronger near the lock.
The rim of the well is a conic-gradient with seven stops from shadow to highlight, starting from a --ang variable: on hover a quickTo turns it towards the pointer, while connecting a tween spins it 360 degrees in a loop, so it looks like a real metal ring catching the light.
Two SVG circles with pathLength 1 and stroke-dasharray 1, a thin one and a wider blurred one for the glow: strokeDashoffset from 1 to 0 fills it clockwise while the phone connects, from 0 to minus 1 drains it, still clockwise, during the countdown, tied to the same timeline as the seconds.
The shackle rises 3.4 units in 0.16 seconds and tilts by minus 16 degrees around its left leg (svgOrigin) with a back.out; the body gives by 0.9 and comes back on an elastic spring. On closing the opposite with power4.in, then the body takes the blow and the glass shivers by a pixel with elastic.out: that is the click.
The light is a layer with its transform-origin on the lock going from scaleX 0 to 1 with power3.out, while a brighter blurred line runs in x to the right edge and fades. The countdown is a linear tween of a number: when the whole number changes, the old digit leaves with yPercent minus 100 and a new one arrives from 100 with a back.out.
| Name | File | Default | What it changes |
|---|---|---|---|
ROOM | script.js | Room 412 | The room written on the button. |
PLACE | script.js | Aurelia Hotel · Floor 4 | The small line underneath. |
CONNECT | script.js | 1.4 | How many seconds the phone takes to talk to the door. |
RELOCK | script.js | 5 | How many seconds the door stays open before it locks again. |
WARMTH | script.js | 1 | How strong the warm light of the open door is. |
SPRING | script.js | 1 | How springy the press and the shackle are: 0.4 calm, 2 very bouncy. |
AUTO | script.js | true | The button goes round by itself until someone touches it. |
For the digital key in the app of a hotel, a vacation rental or a serviced apartment: the button that opens the room door from the phone, with the state of the connection and the time before it locks again told inside the button itself. It also works for a gate, a locker or a garage that opens from the app.
On the phone the button is at most 86% of the screen wide and the rest is the same; there is no hover, so the light under the finger turns on at the touch.
Nothing moves: the ring fills and drains without movement, the open and the closed shackle swap with a fade, the door light fades in and out, the words and the digits change in place.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.7 KB; the libraries: GSAP 28 KB.
Tested on 2 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.