# Elevator floor navigation

> Each section is a floor: press its button and the lift counts floors on an LED display until it arrives with a flash.

- Category: [Navigation](https://library.aimran.es/components/navigation)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-nav-elevator
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Site sections presented as the floors of a building, on a brushed steel elevator panel. Pressing a button lights its ring, the dot matrix display counts floor by floor with an arrow showing the direction, and a soft flash marks the arrival. Number keys call floors too. It is a playful way to present company sites, hotels, venues and multi-level guides.

The main color lights the display and the rings, the secondary color sets the steel. Rename floors in the data, and the travel time follows the speed slider so you can make the ride quicker.

## Code

### HTML

```html
<nav class="uvq12-el" aria-label="Floors"><div class="ds" aria-live="polite"><span class="dr" aria-hidden="true"></span><b class="fn">0</b><span class="lb"><small>Floor</small><span class="nm">Reception</span></span></div><ul><li><button type="button" data-f="4"><span class="bt">4</span><span class="tx">Contact</span></button></li><li><button type="button" data-f="3"><span class="bt">3</span><span class="tx">Team</span></button></li><li><button type="button" data-f="2"><span class="bt">2</span><span class="tx">Blog</span></button></li><li><button type="button" data-f="1"><span class="bt">1</span><span class="tx">Shop</span></button></li><li><button type="button" data-f="0" aria-current="true"><span class="bt">0</span><span class="tx">Reception</span></button></li></ul></nav>
```

### CSS

```css
.uvq12-el {
  --c1: #f59e0b;
  --c2: #d4d4d8;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq12-el {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 13em;
  padding: 1em;
  border-radius: .9em;
  color: #27272a;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.1) 0 1px,transparent 1px 3px),linear-gradient(90deg,color-mix(in srgb,var(--c2) 80%,#71717a),color-mix(in srgb,var(--c2) 85%,#fff) 35%,var(--c2) 60%,color-mix(in srgb,var(--c2) 85%,#52525b));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4),0 1.2em 2.4em -1.2em rgba(0,0,0,.55);
}

.uvq12-el .ds {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6em;
  height: 3.6em;
  padding: 0 .8em;
  margin-bottom: .9em;
  border-radius: .5em;
  background: #0a0a0a;
  box-shadow: inset 0 .2em .5em rgba(0,0,0,.8),0 1px 0 rgba(255,255,255,.5);
  overflow: hidden;
}

.uvq12-el .ds::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle,transparent 50%,rgba(10,10,10,.55) 75%) 0 0/.16em .16em;
  pointer-events: none;
}

.uvq12-el .dr {
  width: 1em;
  font-size: 1.2em;
  color: var(--c1);
  text-shadow: 0 0 .4em var(--c1);
}

.uvq12-el .dr.u::before {
  content: "▲";
  display: block;
  animation: uvq12-el-u calc(0.6s / var(--k)) linear infinite;
}

.uvq12-el .dr.d::before {
  content: "▼";
  display: block;
  animation: uvq12-el-d calc(0.6s / var(--k)) linear infinite;
}

.uvq12-el .fn {
  min-width: 1em;
  font: 800 2.2em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: var(--c1);
  text-shadow: 0 0 .35em var(--c1);
}

.uvq12-el .lb {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--c1);
  font-size: .72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.uvq12-el .lb small {
  font-size: .75em;
  opacity: .6;
}

.uvq12-el .nm {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uvq12-el.ding .ds {
  animation: uvq12-el calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-el ul {
  display: flex;
  flex-direction: column;
  gap: .45em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.uvq12-el li button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: .8em;
  width: 100%;
  padding: .2em;
  border-radius: 2em;
}

.uvq12-el .bt {
  display: grid;
  place-items: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  font-weight: 800;
  color: #3f3f46;
  background: radial-gradient(circle at 40% 35%,#fafafa,#a1a1aa 70%,#71717a);
  box-shadow: 0 0 0 .2em #52525b,0 0 0 .26em rgba(255,255,255,.5),0 .25em .4em rgba(0,0,0,.4);
  transition: box-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-el .tx {
  font-size: .85em;
  font-weight: 700;
  letter-spacing: .02em;
  color: #3f3f46;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

.uvq12-el li button:hover .bt {
  transform: scale(1.04);
}

.uvq12-el li button:active .bt {
  transform: scale(.94);
  box-shadow: 0 0 0 .2em #52525b,0 0 0 .26em rgba(255,255,255,.5),0 .05em .1em rgba(0,0,0,.4);
}

.uvq12-el li button.on .bt {
  color: color-mix(in srgb,var(--c1) 70%,#000);
  box-shadow: 0 0 0 .2em var(--c1),0 0 0 .26em rgba(255,255,255,.5),0 0 1em var(--c1),0 .25em .4em rgba(0,0,0,.4);
}

.uvq12-el li button[aria-current] .tx {
  color: #000;
  text-decoration: underline;
  text-decoration-color: var(--c1);
  text-decoration-thickness: .15em;
  text-underline-offset: .25em;
}

.uvq12-el li button:focus-visible {
  outline: 2px solid #18181b;
  outline-offset: 2px;
}

@keyframes uvq12-el {
  30% {
    box-shadow: inset 0 .2em .5em rgba(0,0,0,.8),0 0 1.4em var(--c1);
  }
}

@keyframes uvq12-el-u {
  from {
    transform: translateY(.5em);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  to {
    transform: translateY(-.5em);
    opacity: 0;
  }
}

@keyframes uvq12-el-d {
  from {
    transform: translateY(-.5em);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  to {
    transform: translateY(.5em);
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq12-el,.uvq12-el *,.uvq12-el *::before,.uvq12-el *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq12-el").forEach(el => {
  const bs=[...el.querySelectorAll("li button")],fn=el.querySelector(".fn"),dr=el.querySelector(".dr"),nm=el.querySelector(".nm");let cur=0,to=0,tm=0;
const K=()=>parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;const btn=f=>bs.find(b=>+b.dataset.f===f);
const arrive=()=>{dr.className="dr";const b=btn(cur);b.classList.remove("on");bs.forEach(x=>{if(x===b)x.setAttribute("aria-current","true");else x.removeAttribute("aria-current")});nm.textContent=b.querySelector(".tx").textContent;el.classList.remove("ding");void el.offsetWidth;el.classList.add("ding")};
const step=()=>{if(cur===to){arrive();tm=0;return}cur+=to>cur?1:-1;fn.textContent=cur;tm=setTimeout(step,(cur===to?300:650)/K())};
const call=f=>{if(f===to&&tm)return;bs.forEach(b=>b.classList.toggle("on",+b.dataset.f===f&&f!==cur));to=f;if(f===cur&&!tm)return;dr.className="dr "+(f>cur?"u":"d");if(!tm)tm=setTimeout(step,400/K())};
bs.forEach((b,i)=>{b.addEventListener("click",()=>call(+b.dataset.f));b.addEventListener("keydown",e=>{const n=e.key==="ArrowDown"?i+1:e.key==="ArrowUp"?i-1:-1;if(n>=0&&n<bs.length){e.preventDefault();bs[n].focus()}})});
el.addEventListener("keydown",e=>{if(/^[0-4]$/.test(e.key)){e.preventDefault();const b=btn(+e.key);b.focus();call(+e.key)}});return()=>clearTimeout(tm)
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq12-el {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 13em;
  padding: 1em;
  border-radius: .9em;
  color: #27272a;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.1) 0 1px,transparent 1px 3px),linear-gradient(90deg,color-mix(in srgb,var(--c2) 80%,#71717a),color-mix(in srgb,var(--c2) 85%,#fff) 35%,var(--c2) 60%,color-mix(in srgb,var(--c2) 85%,#52525b));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4),0 1.2em 2.4em -1.2em rgba(0,0,0,.55);
}

.uvq12-el .ds {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6em;
  height: 3.6em;
  padding: 0 .8em;
  margin-bottom: .9em;
  border-radius: .5em;
  background: #0a0a0a;
  box-shadow: inset 0 .2em .5em rgba(0,0,0,.8),0 1px 0 rgba(255,255,255,.5);
  overflow: hidden;
}

.uvq12-el .ds::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle,transparent 50%,rgba(10,10,10,.55) 75%) 0 0/.16em .16em;
  pointer-events: none;
}

.uvq12-el .dr {
  width: 1em;
  font-size: 1.2em;
  color: var(--c1);
  text-shadow: 0 0 .4em var(--c1);
}

.uvq12-el .dr.u::before {
  content: "▲";
  display: block;
  animation: uvq12-el-u calc(0.6s / var(--k)) linear infinite;
}

.uvq12-el .dr.d::before {
  content: "▼";
  display: block;
  animation: uvq12-el-d calc(0.6s / var(--k)) linear infinite;
}

.uvq12-el .fn {
  min-width: 1em;
  font: 800 2.2em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: var(--c1);
  text-shadow: 0 0 .35em var(--c1);
}

.uvq12-el .lb {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--c1);
  font-size: .72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.uvq12-el .lb small {
  font-size: .75em;
  opacity: .6;
}

.uvq12-el .nm {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uvq12-el.ding .ds {
  animation: uvq12-el calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-el ul {
  display: flex;
  flex-direction: column;
  gap: .45em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.uvq12-el li button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: .8em;
  width: 100%;
  padding: .2em;
  border-radius: 2em;
}

.uvq12-el .bt {
  display: grid;
  place-items: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  font-weight: 800;
  color: #3f3f46;
  background: radial-gradient(circle at 40% 35%,#fafafa,#a1a1aa 70%,#71717a);
  box-shadow: 0 0 0 .2em #52525b,0 0 0 .26em rgba(255,255,255,.5),0 .25em .4em rgba(0,0,0,.4);
  transition: box-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-el .tx {
  font-size: .85em;
  font-weight: 700;
  letter-spacing: .02em;
  color: #3f3f46;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

.uvq12-el li button:hover .bt {
  transform: scale(1.04);
}

.uvq12-el li button:active .bt {
  transform: scale(.94);
  box-shadow: 0 0 0 .2em #52525b,0 0 0 .26em rgba(255,255,255,.5),0 .05em .1em rgba(0,0,0,.4);
}

.uvq12-el li button.on .bt {
  color: color-mix(in srgb,var(--c1) 70%,#000);
  box-shadow: 0 0 0 .2em var(--c1),0 0 0 .26em rgba(255,255,255,.5),0 0 1em var(--c1),0 .25em .4em rgba(0,0,0,.4);
}

.uvq12-el li button[aria-current] .tx {
  color: #000;
  text-decoration: underline;
  text-decoration-color: var(--c1);
  text-decoration-thickness: .15em;
  text-underline-offset: .25em;
}

.uvq12-el li button:focus-visible {
  outline: 2px solid #18181b;
  outline-offset: 2px;
}

@keyframes uvq12-el {
  30% {
    box-shadow: inset 0 .2em .5em rgba(0,0,0,.8),0 0 1.4em var(--c1);
  }
}

@keyframes uvq12-el-u {
  from {
    transform: translateY(.5em);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  to {
    transform: translateY(-.5em);
    opacity: 0;
  }
}

@keyframes uvq12-el-d {
  from {
    transform: translateY(-.5em);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  to {
    transform: translateY(.5em);
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq12-el,.uvq12-el *,.uvq12-el *::before,.uvq12-el *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const bs=[...el.querySelectorAll("li button")],fn=el.querySelector(".fn"),dr=el.querySelector(".dr"),nm=el.querySelector(".nm");let cur=0,to=0,tm=0;
const K=()=>parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;const btn=f=>bs.find(b=>+b.dataset.f===f);
const arrive=()=>{dr.className="dr";const b=btn(cur);b.classList.remove("on");bs.forEach(x=>{if(x===b)x.setAttribute("aria-current","true");else x.removeAttribute("aria-current")});nm.textContent=b.querySelector(".tx").textContent;el.classList.remove("ding");void el.offsetWidth;el.classList.add("ding")};
const step=()=>{if(cur===to){arrive();tm=0;return}cur+=to>cur?1:-1;fn.textContent=cur;tm=setTimeout(step,(cur===to?300:650)/K())};
const call=f=>{if(f===to&&tm)return;bs.forEach(b=>b.classList.toggle("on",+b.dataset.f===f&&f!==cur));to=f;if(f===cur&&!tm)return;dr.className="dr "+(f>cur?"u":"d");if(!tm)tm=setTimeout(step,400/K())};
bs.forEach((b,i)=>{b.addEventListener("click",()=>call(+b.dataset.f));b.addEventListener("keydown",e=>{const n=e.key==="ArrowDown"?i+1:e.key==="ArrowUp"?i-1:-1;if(n>=0&&n<bs.length){e.preventDefault();bs[n].focus()}})});
el.addEventListener("keydown",e=>{if(/^[0-4]$/.test(e.key)){e.preventDefault();const b=btn(+e.key);b.focus();call(+e.key)}});return()=>clearTimeout(tm)
}

export default function NavElevator() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#f59e0b",
          "--c2": "#d4d4d8",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <nav className="uvq12-el" aria-label="Floors"><div className="ds" aria-live="polite"><span className="dr" aria-hidden="true"></span><b className="fn">0</b><span className="lb"><small>Floor</small><span className="nm">Reception</span></span></div><ul><li><button type="button" data-f="4"><span className="bt">4</span><span className="tx">Contact</span></button></li><li><button type="button" data-f="3"><span className="bt">3</span><span className="tx">Team</span></button></li><li><button type="button" data-f="2"><span className="bt">2</span><span className="tx">Blog</span></button></li><li><button type="button" data-f="1"><span className="bt">1</span><span className="tx">Shop</span></button></li><li><button type="button" data-f="0" aria-current="true"><span className="bt">0</span><span className="tx">Reception</span></button></li></ul></nav>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Elevator floor navigation” block (Navigation) from AIMRAN Library to my project.

## What it is
Each section is a floor: press its button and the lift counts floors on an LED display until it arrives with a flash.

## Chosen settings
- Main color: #f59e0b
- Secondary color: #d4d4d8
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Planta"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq12-el {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 13em;
  padding: 1em;
  border-radius: .9em;
  color: #27272a;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.1) 0 1px,transparent 1px 3px),linear-gradient(90deg,color-mix(in srgb,var(--c2) 80%,#71717a),color-mix(in srgb,var(--c2) 85%,#fff) 35%,var(--c2) 60%,color-mix(in srgb,var(--c2) 85%,#52525b));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4),0 1.2em 2.4em -1.2em rgba(0,0,0,.55);
}

.uvq12-el .ds {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6em;
  height: 3.6em;
  padding: 0 .8em;
  margin-bottom: .9em;
  border-radius: .5em;
  background: #0a0a0a;
  box-shadow: inset 0 .2em .5em rgba(0,0,0,.8),0 1px 0 rgba(255,255,255,.5);
  overflow: hidden;
}

.uvq12-el .ds::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle,transparent 50%,rgba(10,10,10,.55) 75%) 0 0/.16em .16em;
  pointer-events: none;
}

.uvq12-el .dr {
  width: 1em;
  font-size: 1.2em;
  color: var(--c1);
  text-shadow: 0 0 .4em var(--c1);
}

.uvq12-el .dr.u::before {
  content: "▲";
  display: block;
  animation: uvq12-el-u calc(0.6s / var(--k)) linear infinite;
}

.uvq12-el .dr.d::before {
  content: "▼";
  display: block;
  animation: uvq12-el-d calc(0.6s / var(--k)) linear infinite;
}

.uvq12-el .fn {
  min-width: 1em;
  font: 800 2.2em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: var(--c1);
  text-shadow: 0 0 .35em var(--c1);
}

.uvq12-el .lb {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--c1);
  font-size: .72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.uvq12-el .lb small {
  font-size: .75em;
  opacity: .6;
}

.uvq12-el .nm {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uvq12-el.ding .ds {
  animation: uvq12-el calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-el ul {
  display: flex;
  flex-direction: column;
  gap: .45em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.uvq12-el li button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: .8em;
  width: 100%;
  padding: .2em;
  border-radius: 2em;
}

.uvq12-el .bt {
  display: grid;
  place-items: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  font-weight: 800;
  color: #3f3f46;
  background: radial-gradient(circle at 40% 35%,#fafafa,#a1a1aa 70%,#71717a);
  box-shadow: 0 0 0 .2em #52525b,0 0 0 .26em rgba(255,255,255,.5),0 .25em .4em rgba(0,0,0,.4);
  transition: box-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-el .tx {
  font-size: .85em;
  font-weight: 700;
  letter-spacing: .02em;
  color: #3f3f46;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

.uvq12-el li button:hover .bt {
  transform: scale(1.04);
}

.uvq12-el li button:active .bt {
  transform: scale(.94);
  box-shadow: 0 0 0 .2em #52525b,0 0 0 .26em rgba(255,255,255,.5),0 .05em .1em rgba(0,0,0,.4);
}

.uvq12-el li button.on .bt {
  color: color-mix(in srgb,var(--c1) 70%,#000);
  box-shadow: 0 0 0 .2em var(--c1),0 0 0 .26em rgba(255,255,255,.5),0 0 1em var(--c1),0 .25em .4em rgba(0,0,0,.4);
}

.uvq12-el li button[aria-current] .tx {
  color: #000;
  text-decoration: underline;
  text-decoration-color: var(--c1);
  text-decoration-thickness: .15em;
  text-underline-offset: .25em;
}

.uvq12-el li button:focus-visible {
  outline: 2px solid #18181b;
  outline-offset: 2px;
}

@keyframes uvq12-el {
  30% {
    box-shadow: inset 0 .2em .5em rgba(0,0,0,.8),0 0 1.4em var(--c1);
  }
}

@keyframes uvq12-el-u {
  from {
    transform: translateY(.5em);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  to {
    transform: translateY(-.5em);
    opacity: 0;
  }
}

@keyframes uvq12-el-d {
  from {
    transform: translateY(-.5em);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  to {
    transform: translateY(.5em);
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq12-el,.uvq12-el *,.uvq12-el *::before,.uvq12-el *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const bs=[...el.querySelectorAll("li button")],fn=el.querySelector(".fn"),dr=el.querySelector(".dr"),nm=el.querySelector(".nm");let cur=0,to=0,tm=0;
const K=()=>parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;const btn=f=>bs.find(b=>+b.dataset.f===f);
const arrive=()=>{dr.className="dr";const b=btn(cur);b.classList.remove("on");bs.forEach(x=>{if(x===b)x.setAttribute("aria-current","true");else x.removeAttribute("aria-current")});nm.textContent=b.querySelector(".tx").textContent;el.classList.remove("ding");void el.offsetWidth;el.classList.add("ding")};
const step=()=>{if(cur===to){arrive();tm=0;return}cur+=to>cur?1:-1;fn.textContent=cur;tm=setTimeout(step,(cur===to?300:650)/K())};
const call=f=>{if(f===to&&tm)return;bs.forEach(b=>b.classList.toggle("on",+b.dataset.f===f&&f!==cur));to=f;if(f===cur&&!tm)return;dr.className="dr "+(f>cur?"u":"d");if(!tm)tm=setTimeout(step,400/K())};
bs.forEach((b,i)=>{b.addEventListener("click",()=>call(+b.dataset.f));b.addEventListener("keydown",e=>{const n=e.key==="ArrowDown"?i+1:e.key==="ArrowUp"?i-1:-1;if(n>=0&&n<bs.length){e.preventDefault();bs[n].focus()}})});
el.addEventListener("keydown",e=>{if(/^[0-4]$/.test(e.key)){e.preventDefault();const b=btn(+e.key);b.focus();call(+e.key)}});return()=>clearTimeout(tm)
}

export default function NavElevator() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#f59e0b",
          "--c2": "#d4d4d8",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <nav className="uvq12-el" aria-label="Floors"><div className="ds" aria-live="polite"><span className="dr" aria-hidden="true"></span><b className="fn">0</b><span className="lb"><small>Floor</small><span className="nm">Reception</span></span></div><ul><li><button type="button" data-f="4"><span className="bt">4</span><span className="tx">Contact</span></button></li><li><button type="button" data-f="3"><span className="bt">3</span><span className="tx">Team</span></button></li><li><button type="button" data-f="2"><span className="bt">2</span><span className="tx">Blog</span></button></li><li><button type="button" data-f="1"><span className="bt">1</span><span className="tx">Shop</span></button></li><li><button type="button" data-f="0" aria-current="true"><span className="bt">0</span><span className="tx">Reception</span></button></li></ul></nav>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
