
Speeding marquee
Scroll, Text, Hover
The self check-in card of a holiday flat: the code of the key box is hidden behind four bars. Pressing “Reveal the code”, each digit spins like the wheel of a combination lock and stops one after the other, then a line runs out and the code hides by itself.
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>
<!--
"Key box check-in code" 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>Self check-in code with the digits of the key box that spin like reels</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 self check-in card of a holiday flat: the code of the key box is hidden behind four bars; revealed, each
digit spins like the wheel of a combination lock and lands, then the code hides itself again after a while -->
<section class="kb" data-kb aria-label="Self check-in">
<header class="kb__head">
<span class="kb__place">Vicolo Nove, flat 2</span>
<span class="kb__when">Check-in from 3 pm</span>
</header>
<p class="kb__label" id="kb-label">Key box code</p>
<div class="kb__code" data-code role="img" aria-labelledby="kb-label" aria-live="polite"></div>
<div class="kb__timer" aria-hidden="true"><span data-timer></span></div>
<button class="kb__go" type="button" data-go aria-pressed="false"><span class="kb__go-text"><span data-gotext>Reveal the code</span></span></button>
<p class="kb__foot">The box is by the green door, on the left.</p>
</section>
<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.
18 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 “Key box check-in code” from Animorio and fit it into my siteAt each reveal the script builds for each window a strip of digits ending on the code’s number (the ones before count up to it), and moves it up by yPercent with power4.out: fast at first, a very long braking. Each reel has four digits and 0.28 seconds more than the previous one.
At 72% of the run the digit is practically still: there the window drops two pixels and comes back with back.out(4), and the digit’s font-weight goes from HEAVY to 640.
Once the spin is over a line in scaleX runs out in SHOWN seconds and calls the function that hides. Screen readers also get the code only when it is revealed (aria-label kept up to date).
| Name | File | Default | What it changes |
|---|---|---|---|
CODE | script.js | "4071" | The key box code (made up). |
SPIN | script.js | 1.1 | How many seconds the first reel spins (each later reel spins a little longer). |
TURNS | script.js | 9 | How many digits go by before the first reel stops. |
SHOWN | script.js | 4 | After how many seconds the code hides by itself. |
HEAVY | script.js | 800 | The font weight of the digit just as it stops. |
ACCENT | script.js | #2f7d5b | The colour of the revealed code. |
LOOP | script.js | true | Left alone, a pointer reveals the code. |
On the stay page of a holiday home or a short let, in the guest app of a hotel with no front desk, wherever a code is shown that should not stay on screen (lockers, gates, pickup codes).
The same card, as wide as the screen; the windows never exceed 19% of the height and the digits scale with them.
No reels: the digits appear already still in place of the bars and disappear the same way; the time line still runs out.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 4.6 KB; the libraries: GSAP 28 KB.
Tested on 16 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.