# Virtual waiting room queue

> A ticket queue with your place shown in rolling digits, a line of people moving forward and the notice when it is your turn.

- Category: [Overlays](https://library.aimran.es/components/overlays)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-ov-queue-room
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Big ticket sales put buyers in a queue, and this overlay makes the wait readable. Your position rolls down in large digits, a row of dots walks toward the door, the estimated time updates and a switch offers to notify you. It fits concerts, launches, sales and booking peaks.

The main color paints the page, your dot and the buttons, the second one the success badge. Connect the counter to your real queue position instead of the timer, and keep the leave button so people can step out with Escape too.

## Code

### HTML

```html
<div class="uvq13-que"><div class="pgx" aria-hidden="true"><p class="bd">Tour 2027</p><i></i><i></i><i class="s"></i></div><button type="button" class="fire" aria-haspopup="dialog">Back to the queue</button><div class="scr"></div><div class="dl" role="dialog" aria-modal="true" aria-labelledby="uvq13-que-t" aria-describedby="uvq13-que-d"><p class="kk">Waiting room</p><div class="w1"><p class="ti" id="uvq13-que-t">You are in the queue</p><div class="nb" aria-hidden="true"><span class="dg"><span><b>0</b><b>1</b><b>2</b><b>3</b><b>4</b><b>5</b><b>6</b><b>7</b><b>8</b><b>9</b></span></span><span class="dg"><span><b>0</b><b>1</b><b>2</b><b>3</b><b>4</b><b>5</b><b>6</b><b>7</b><b>8</b><b>9</b></span></span></div><p class="lb" id="uvq13-que-d">people ahead of you</p><div class="tr" aria-hidden="true"><i class="door"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 21V4.5A1.5 1.5 0 0 1 7.5 3h9A1.5 1.5 0 0 1 18 4.5V21M3 21h18M14.5 12.5v.01"/></svg></i><i class="pp"></i><i class="pp"></i><i class="pp"></i><i class="pp"></i><i class="pp"></i><i class="pp"></i><i class="pp"></i><i class="pp"></i><i class="pp"></i><i class="pp"></i><i class="me"></i></div><p class="et"><span>Estimated time</span> <b><span class="eta">4</span> min</b></p><label class="nt"><input type="checkbox" class="sw"><span>Let me know when it is my turn</span></label><button type="button" class="lv">Leave the queue</button></div><div class="w2"><span class="ok"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span><p class="ti">It is your turn</p><p class="lb">You have 10 minutes to choose your tickets.</p><button type="button" class="en">Go to checkout</button></div><p class="sr" aria-live="polite"></p></div></div>
```

### CSS

```css
.uvq13-que {
  --c1: #7c3aed;
  --c2: #22c55e;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq13-que {
  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;
  position: relative;
  width: 22em;
  height: 19em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-que .pgx {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: .55em;
  padding: 1.2em;
  color: #fff;
  background: radial-gradient(80% 60% at 70% 20%,color-mix(in srgb,var(--c1) 70%,#f472b6),transparent),linear-gradient(160deg,var(--c1),#0b0618);
}

.uvq13-que .pgx .bd {
  margin: 0 0 .2em;
  font-size: 2.6em;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: .9;
  text-transform: uppercase;
}

.uvq13-que .pgx i {
  height: .6em;
  border-radius: 1em;
  background: rgba(255,255,255,.2);
}

.uvq13-que .pgx .s {
  width: 60%;
}

.uvq13-que .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: 1em;
  top: 1em;
  padding: .55em .95em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--c1);
  background: #fff;
}

.uvq13-que .scr {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(6,4,14,.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que.open .scr {
  opacity: 1;
  pointer-events: auto;
}

.uvq13-que .dl {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  box-sizing: border-box;
  transform: translate(-50%,-46%) scale(.95);
  opacity: 0;
  pointer-events: none;
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que.open .dl {
  transform: translate(-50%,-50%);
  opacity: 1;
  pointer-events: auto;
}

.uvq13-que .dl {
  width: 14.6em;
  padding: 1.1em 1.2em 1.2em;
  border-radius: 1.3em;
  text-align: center;
  background: color-mix(in srgb,var(--fg) 2%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 1.6em 3.2em -1.2em rgba(0,0,0,.5);
  background: var(--bg);
}

.uvq13-que .kk {
  margin: 0;
  font-size: .6em;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c1);
}

.uvq13-que .ti {
  margin: .3em 0 .2em;
  font-size: 1.05em;
  font-weight: 800;
}

.uvq13-que .nb {
  display: flex;
  justify-content: center;
  font-size: 3.4em;
  font-weight: 850;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.uvq13-que .dg {
  display: block;
  height: 1em;
  overflow: hidden;
}

.uvq13-que .dg>span {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--n,0) * -1em));
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-que .dg b {
  display: block;
  height: 1em;
}

.uvq13-que .lb {
  margin: .2em 0 .7em;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-que .tr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .28em;
  height: 1.6em;
  margin-bottom: .6em;
}

.uvq13-que .door {
  display: grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: .2em;
  color: var(--c1);
}

.uvq13-que .door svg {
  width: 100%;
  height: 100%;
}

.uvq13-que .pp {
  width: .55em;
  height: .55em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--fg) 25%,transparent);
  transition: width calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),margin calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que .pp.gone {
  width: 0;
  margin: 0 -.14em;
  opacity: 0;
}

.uvq13-que .me {
  width: .8em;
  height: .8em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 0 .25em color-mix(in srgb,var(--c1) 25%,transparent);
  animation: uvq13-que-p calc(1.2s / var(--k)) ease-in-out infinite;
}

.uvq13-que .et {
  margin: 0 0 .7em;
  font-size: .74em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-que .et b {
  color: var(--fg);
}

.uvq13-que .nt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-size: .72em;
  cursor: pointer;
}

.uvq13-que .sw {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 2.2em;
  height: 1.25em;
  margin: 0;
  border-radius: 1em;
  background: color-mix(in srgb,var(--fg) 18%,transparent);
  cursor: pointer;
  transition: background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que .sw::before {
  content: "";
  position: absolute;
  left: .15em;
  top: .15em;
  width: .95em;
  height: .95em;
  border-radius: 50%;
  background: #fff;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-que .sw:checked {
  background: var(--c1);
}

.uvq13-que .sw:checked::before {
  transform: translateX(.95em);
}

.uvq13-que .lv {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-top: .8em;
  font-size: .72em;
  font-weight: 700;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.uvq13-que .w2 {
  display: none;
}

.uvq13-que .turn .w1 {
  display: none;
}

.uvq13-que .turn .w2 {
  display: block;
  animation: uvq13-que-i calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-que .ok {
  display: grid;
  place-items: center;
  width: 3em;
  height: 3em;
  margin: .7em auto .2em;
  border-radius: 50%;
  color: #fff;
  background: var(--c2);
  box-shadow: 0 0 0 .4em color-mix(in srgb,var(--c2) 22%,transparent);
}

.uvq13-que .ok svg {
  width: 1.5em;
  height: 1.5em;
}

.uvq13-que .en {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  padding: .75em;
  border-radius: .8em;
  font-weight: 700;
  font-size: .85em;
  color: #fff;
  background: var(--c1);
  animation: uvq13-que-g calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq13-que .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.uvq13-que button:focus-visible,.uvq13-que .sw:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq13-que-p {
  50% {
    box-shadow: 0 0 0 .45em color-mix(in srgb,var(--c1) 10%,transparent);
  }
}

@keyframes uvq13-que-i {
  from {
    opacity: 0;
    transform: scale(.92);
  }
}

@keyframes uvq13-que-g {
  50% {
    box-shadow: 0 0 0 .35em color-mix(in srgb,var(--c1) 25%,transparent);
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq13-que").forEach(el => {
  const fire=el.querySelector(".fire"),scr=el.querySelector(".scr"),pnl=el.querySelector(".dl");let tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const foc=(t,ms)=>later(()=>{const n=typeof t==="string"?el.querySelector(t):t;n&&n.focus({preventScroll:true})},ms||0);
const isOpen=()=>el.classList.contains("open");
const open=u=>{if(isOpen())return;el.classList.add("open");pnl.inert=false;fire&&fire.setAttribute("aria-expanded","true");start(u)};
const close=()=>{if(!isOpen())return;el.classList.remove("open");pnl.inert=true;fire&&fire.setAttribute("aria-expanded","false");clearInterval(iv);fire&&fire.focus({preventScroll:true})};
fire&&fire.addEventListener("click",()=>isOpen()?close():open(true));scr&&scr.addEventListener("click",()=>close());
el.addEventListener("keydown",e=>{if(!isOpen())return;if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close()}else if(e.key==="Tab"){const f=[...pnl.querySelectorAll('button:not([disabled]),input:not([disabled]),textarea,a[href],[tabindex="0"]')].filter(x=>x.getClientRects().length);if(!f.length){e.preventDefault();return}const a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!pnl.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!pnl.contains(ac))){e.preventDefault();a.focus()}}});
pnl.inert=true;later(()=>open(false),400);const dl=el.querySelector(".dl"),dgs=[...el.querySelectorAll(".dg>span")],pp=[...el.querySelectorAll(".pp")],eta=el.querySelector(".eta"),sr=el.querySelector(".sr"),lb=el.querySelector(".w1 .lb");let n=0,iv=0;
const paint=()=>{const v=Math.max(0,n);dgs[0].style.setProperty("--n",String(Math.floor(v/10)%10));dgs[1].style.setProperty("--n",String(v%10));pp.forEach((p,i)=>p.classList.toggle("gone",i>=Math.min(10,v)));eta.textContent=String(Math.max(1,Math.ceil(v/10)))};
const start=u=>{clearInterval(iv);n=37;dl.classList.remove("turn");paint();u&&foc(".lv",350);iv=setInterval(()=>{n-=Math.random()<.35?2:1;paint();if(n>0&&n%10===0)sr.textContent=n+" "+lb.textContent;if(n<=0){clearInterval(iv);dl.classList.add("turn");sr.textContent=dl.querySelector(".w2 .ti").textContent;if(el.contains(document.activeElement))foc(".en",60)}},520)};
el.querySelector(".lv").addEventListener("click",close);el.querySelector(".en").addEventListener("click",close);return()=>{tms.forEach(clearTimeout);clearInterval(iv)}
});
```

### 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 = `
.uvq13-que {
  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;
  position: relative;
  width: 22em;
  height: 19em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-que .pgx {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: .55em;
  padding: 1.2em;
  color: #fff;
  background: radial-gradient(80% 60% at 70% 20%,color-mix(in srgb,var(--c1) 70%,#f472b6),transparent),linear-gradient(160deg,var(--c1),#0b0618);
}

.uvq13-que .pgx .bd {
  margin: 0 0 .2em;
  font-size: 2.6em;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: .9;
  text-transform: uppercase;
}

.uvq13-que .pgx i {
  height: .6em;
  border-radius: 1em;
  background: rgba(255,255,255,.2);
}

.uvq13-que .pgx .s {
  width: 60%;
}

.uvq13-que .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: 1em;
  top: 1em;
  padding: .55em .95em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--c1);
  background: #fff;
}

.uvq13-que .scr {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(6,4,14,.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que.open .scr {
  opacity: 1;
  pointer-events: auto;
}

.uvq13-que .dl {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  box-sizing: border-box;
  transform: translate(-50%,-46%) scale(.95);
  opacity: 0;
  pointer-events: none;
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que.open .dl {
  transform: translate(-50%,-50%);
  opacity: 1;
  pointer-events: auto;
}

.uvq13-que .dl {
  width: 14.6em;
  padding: 1.1em 1.2em 1.2em;
  border-radius: 1.3em;
  text-align: center;
  background: color-mix(in srgb,var(--fg) 2%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 1.6em 3.2em -1.2em rgba(0,0,0,.5);
  background: var(--bg);
}

.uvq13-que .kk {
  margin: 0;
  font-size: .6em;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c1);
}

.uvq13-que .ti {
  margin: .3em 0 .2em;
  font-size: 1.05em;
  font-weight: 800;
}

.uvq13-que .nb {
  display: flex;
  justify-content: center;
  font-size: 3.4em;
  font-weight: 850;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.uvq13-que .dg {
  display: block;
  height: 1em;
  overflow: hidden;
}

.uvq13-que .dg>span {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--n,0) * -1em));
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-que .dg b {
  display: block;
  height: 1em;
}

.uvq13-que .lb {
  margin: .2em 0 .7em;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-que .tr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .28em;
  height: 1.6em;
  margin-bottom: .6em;
}

.uvq13-que .door {
  display: grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: .2em;
  color: var(--c1);
}

.uvq13-que .door svg {
  width: 100%;
  height: 100%;
}

.uvq13-que .pp {
  width: .55em;
  height: .55em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--fg) 25%,transparent);
  transition: width calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),margin calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que .pp.gone {
  width: 0;
  margin: 0 -.14em;
  opacity: 0;
}

.uvq13-que .me {
  width: .8em;
  height: .8em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 0 .25em color-mix(in srgb,var(--c1) 25%,transparent);
  animation: uvq13-que-p calc(1.2s / var(--k)) ease-in-out infinite;
}

.uvq13-que .et {
  margin: 0 0 .7em;
  font-size: .74em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-que .et b {
  color: var(--fg);
}

.uvq13-que .nt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-size: .72em;
  cursor: pointer;
}

.uvq13-que .sw {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 2.2em;
  height: 1.25em;
  margin: 0;
  border-radius: 1em;
  background: color-mix(in srgb,var(--fg) 18%,transparent);
  cursor: pointer;
  transition: background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que .sw::before {
  content: "";
  position: absolute;
  left: .15em;
  top: .15em;
  width: .95em;
  height: .95em;
  border-radius: 50%;
  background: #fff;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-que .sw:checked {
  background: var(--c1);
}

.uvq13-que .sw:checked::before {
  transform: translateX(.95em);
}

.uvq13-que .lv {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-top: .8em;
  font-size: .72em;
  font-weight: 700;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.uvq13-que .w2 {
  display: none;
}

.uvq13-que .turn .w1 {
  display: none;
}

.uvq13-que .turn .w2 {
  display: block;
  animation: uvq13-que-i calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-que .ok {
  display: grid;
  place-items: center;
  width: 3em;
  height: 3em;
  margin: .7em auto .2em;
  border-radius: 50%;
  color: #fff;
  background: var(--c2);
  box-shadow: 0 0 0 .4em color-mix(in srgb,var(--c2) 22%,transparent);
}

.uvq13-que .ok svg {
  width: 1.5em;
  height: 1.5em;
}

.uvq13-que .en {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  padding: .75em;
  border-radius: .8em;
  font-weight: 700;
  font-size: .85em;
  color: #fff;
  background: var(--c1);
  animation: uvq13-que-g calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq13-que .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.uvq13-que button:focus-visible,.uvq13-que .sw:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq13-que-p {
  50% {
    box-shadow: 0 0 0 .45em color-mix(in srgb,var(--c1) 10%,transparent);
  }
}

@keyframes uvq13-que-i {
  from {
    opacity: 0;
    transform: scale(.92);
  }
}

@keyframes uvq13-que-g {
  50% {
    box-shadow: 0 0 0 .35em color-mix(in srgb,var(--c1) 25%,transparent);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq13-que,.uvq13-que *,.uvq13-que *::before,.uvq13-que *::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 fire=el.querySelector(".fire"),scr=el.querySelector(".scr"),pnl=el.querySelector(".dl");let tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const foc=(t,ms)=>later(()=>{const n=typeof t==="string"?el.querySelector(t):t;n&&n.focus({preventScroll:true})},ms||0);
const isOpen=()=>el.classList.contains("open");
const open=u=>{if(isOpen())return;el.classList.add("open");pnl.inert=false;fire&&fire.setAttribute("aria-expanded","true");start(u)};
const close=()=>{if(!isOpen())return;el.classList.remove("open");pnl.inert=true;fire&&fire.setAttribute("aria-expanded","false");clearInterval(iv);fire&&fire.focus({preventScroll:true})};
fire&&fire.addEventListener("click",()=>isOpen()?close():open(true));scr&&scr.addEventListener("click",()=>close());
el.addEventListener("keydown",e=>{if(!isOpen())return;if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close()}else if(e.key==="Tab"){const f=[...pnl.querySelectorAll('button:not([disabled]),input:not([disabled]),textarea,a[href],[tabindex="0"]')].filter(x=>x.getClientRects().length);if(!f.length){e.preventDefault();return}const a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!pnl.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!pnl.contains(ac))){e.preventDefault();a.focus()}}});
pnl.inert=true;later(()=>open(false),400);const dl=el.querySelector(".dl"),dgs=[...el.querySelectorAll(".dg>span")],pp=[...el.querySelectorAll(".pp")],eta=el.querySelector(".eta"),sr=el.querySelector(".sr"),lb=el.querySelector(".w1 .lb");let n=0,iv=0;
const paint=()=>{const v=Math.max(0,n);dgs[0].style.setProperty("--n",String(Math.floor(v/10)%10));dgs[1].style.setProperty("--n",String(v%10));pp.forEach((p,i)=>p.classList.toggle("gone",i>=Math.min(10,v)));eta.textContent=String(Math.max(1,Math.ceil(v/10)))};
const start=u=>{clearInterval(iv);n=37;dl.classList.remove("turn");paint();u&&foc(".lv",350);iv=setInterval(()=>{n-=Math.random()<.35?2:1;paint();if(n>0&&n%10===0)sr.textContent=n+" "+lb.textContent;if(n<=0){clearInterval(iv);dl.classList.add("turn");sr.textContent=dl.querySelector(".w2 .ti").textContent;if(el.contains(document.activeElement))foc(".en",60)}},520)};
el.querySelector(".lv").addEventListener("click",close);el.querySelector(".en").addEventListener("click",close);return()=>{tms.forEach(clearTimeout);clearInterval(iv)}
}

export default function OvQueueRoom() {
  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": "#7c3aed",
          "--c2": "#22c55e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq13-que"><div className="pgx" aria-hidden="true"><p className="bd">Tour 2027</p><i></i><i></i><i className="s"></i></div><button type="button" className="fire" aria-haspopup="dialog">Back to the queue</button><div className="scr"></div><div className="dl" role="dialog" aria-modal="true" aria-labelledby="uvq13-que-t" aria-describedby="uvq13-que-d"><p className="kk">Waiting room</p><div className="w1"><p className="ti" id="uvq13-que-t">You are in the queue</p><div className="nb" aria-hidden="true"><span className="dg"><span><b>0</b><b>1</b><b>2</b><b>3</b><b>4</b><b>5</b><b>6</b><b>7</b><b>8</b><b>9</b></span></span><span className="dg"><span><b>0</b><b>1</b><b>2</b><b>3</b><b>4</b><b>5</b><b>6</b><b>7</b><b>8</b><b>9</b></span></span></div><p className="lb" id="uvq13-que-d">people ahead of you</p><div className="tr" aria-hidden="true"><i className="door"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 21V4.5A1.5 1.5 0 0 1 7.5 3h9A1.5 1.5 0 0 1 18 4.5V21M3 21h18M14.5 12.5v.01" /></svg></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="me"></i></div><p className="et"><span>Estimated time</span> <b><span className="eta">4</span> min</b></p><label className="nt"><input type="checkbox" className="sw" /><span>Let me know when it is my turn</span></label><button type="button" className="lv">Leave the queue</button></div><div className="w2"><span className="ok"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" /></svg></span><p className="ti">It is your turn</p><p className="lb">You have 10 minutes to choose your tickets.</p><button type="button" className="en">Go to checkout</button></div><p className="sr" aria-live="polite"></p></div></div>
      </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 “Virtual waiting room queue” block (Overlays) from AIMRAN Library to my project.

## What it is
A ticket queue with your place shown in rolling digits, a line of people moving forward and the notice when it is your turn.

## Chosen settings
- Main color: #7c3aed
- Secondary color: #22c55e
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Estás en la cola"

## 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 = `
.uvq13-que {
  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;
  position: relative;
  width: 22em;
  height: 19em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-que .pgx {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: .55em;
  padding: 1.2em;
  color: #fff;
  background: radial-gradient(80% 60% at 70% 20%,color-mix(in srgb,var(--c1) 70%,#f472b6),transparent),linear-gradient(160deg,var(--c1),#0b0618);
}

.uvq13-que .pgx .bd {
  margin: 0 0 .2em;
  font-size: 2.6em;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: .9;
  text-transform: uppercase;
}

.uvq13-que .pgx i {
  height: .6em;
  border-radius: 1em;
  background: rgba(255,255,255,.2);
}

.uvq13-que .pgx .s {
  width: 60%;
}

.uvq13-que .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: 1em;
  top: 1em;
  padding: .55em .95em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--c1);
  background: #fff;
}

.uvq13-que .scr {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(6,4,14,.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que.open .scr {
  opacity: 1;
  pointer-events: auto;
}

.uvq13-que .dl {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  box-sizing: border-box;
  transform: translate(-50%,-46%) scale(.95);
  opacity: 0;
  pointer-events: none;
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que.open .dl {
  transform: translate(-50%,-50%);
  opacity: 1;
  pointer-events: auto;
}

.uvq13-que .dl {
  width: 14.6em;
  padding: 1.1em 1.2em 1.2em;
  border-radius: 1.3em;
  text-align: center;
  background: color-mix(in srgb,var(--fg) 2%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 1.6em 3.2em -1.2em rgba(0,0,0,.5);
  background: var(--bg);
}

.uvq13-que .kk {
  margin: 0;
  font-size: .6em;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c1);
}

.uvq13-que .ti {
  margin: .3em 0 .2em;
  font-size: 1.05em;
  font-weight: 800;
}

.uvq13-que .nb {
  display: flex;
  justify-content: center;
  font-size: 3.4em;
  font-weight: 850;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.uvq13-que .dg {
  display: block;
  height: 1em;
  overflow: hidden;
}

.uvq13-que .dg>span {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--n,0) * -1em));
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-que .dg b {
  display: block;
  height: 1em;
}

.uvq13-que .lb {
  margin: .2em 0 .7em;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-que .tr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .28em;
  height: 1.6em;
  margin-bottom: .6em;
}

.uvq13-que .door {
  display: grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: .2em;
  color: var(--c1);
}

.uvq13-que .door svg {
  width: 100%;
  height: 100%;
}

.uvq13-que .pp {
  width: .55em;
  height: .55em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--fg) 25%,transparent);
  transition: width calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),margin calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que .pp.gone {
  width: 0;
  margin: 0 -.14em;
  opacity: 0;
}

.uvq13-que .me {
  width: .8em;
  height: .8em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 0 .25em color-mix(in srgb,var(--c1) 25%,transparent);
  animation: uvq13-que-p calc(1.2s / var(--k)) ease-in-out infinite;
}

.uvq13-que .et {
  margin: 0 0 .7em;
  font-size: .74em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-que .et b {
  color: var(--fg);
}

.uvq13-que .nt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-size: .72em;
  cursor: pointer;
}

.uvq13-que .sw {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 2.2em;
  height: 1.25em;
  margin: 0;
  border-radius: 1em;
  background: color-mix(in srgb,var(--fg) 18%,transparent);
  cursor: pointer;
  transition: background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-que .sw::before {
  content: "";
  position: absolute;
  left: .15em;
  top: .15em;
  width: .95em;
  height: .95em;
  border-radius: 50%;
  background: #fff;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-que .sw:checked {
  background: var(--c1);
}

.uvq13-que .sw:checked::before {
  transform: translateX(.95em);
}

.uvq13-que .lv {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-top: .8em;
  font-size: .72em;
  font-weight: 700;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.uvq13-que .w2 {
  display: none;
}

.uvq13-que .turn .w1 {
  display: none;
}

.uvq13-que .turn .w2 {
  display: block;
  animation: uvq13-que-i calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq13-que .ok {
  display: grid;
  place-items: center;
  width: 3em;
  height: 3em;
  margin: .7em auto .2em;
  border-radius: 50%;
  color: #fff;
  background: var(--c2);
  box-shadow: 0 0 0 .4em color-mix(in srgb,var(--c2) 22%,transparent);
}

.uvq13-que .ok svg {
  width: 1.5em;
  height: 1.5em;
}

.uvq13-que .en {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  padding: .75em;
  border-radius: .8em;
  font-weight: 700;
  font-size: .85em;
  color: #fff;
  background: var(--c1);
  animation: uvq13-que-g calc(1.6s / var(--k)) ease-in-out infinite;
}

.uvq13-que .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.uvq13-que button:focus-visible,.uvq13-que .sw:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq13-que-p {
  50% {
    box-shadow: 0 0 0 .45em color-mix(in srgb,var(--c1) 10%,transparent);
  }
}

@keyframes uvq13-que-i {
  from {
    opacity: 0;
    transform: scale(.92);
  }
}

@keyframes uvq13-que-g {
  50% {
    box-shadow: 0 0 0 .35em color-mix(in srgb,var(--c1) 25%,transparent);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq13-que,.uvq13-que *,.uvq13-que *::before,.uvq13-que *::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 fire=el.querySelector(".fire"),scr=el.querySelector(".scr"),pnl=el.querySelector(".dl");let tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const foc=(t,ms)=>later(()=>{const n=typeof t==="string"?el.querySelector(t):t;n&&n.focus({preventScroll:true})},ms||0);
const isOpen=()=>el.classList.contains("open");
const open=u=>{if(isOpen())return;el.classList.add("open");pnl.inert=false;fire&&fire.setAttribute("aria-expanded","true");start(u)};
const close=()=>{if(!isOpen())return;el.classList.remove("open");pnl.inert=true;fire&&fire.setAttribute("aria-expanded","false");clearInterval(iv);fire&&fire.focus({preventScroll:true})};
fire&&fire.addEventListener("click",()=>isOpen()?close():open(true));scr&&scr.addEventListener("click",()=>close());
el.addEventListener("keydown",e=>{if(!isOpen())return;if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close()}else if(e.key==="Tab"){const f=[...pnl.querySelectorAll('button:not([disabled]),input:not([disabled]),textarea,a[href],[tabindex="0"]')].filter(x=>x.getClientRects().length);if(!f.length){e.preventDefault();return}const a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!pnl.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!pnl.contains(ac))){e.preventDefault();a.focus()}}});
pnl.inert=true;later(()=>open(false),400);const dl=el.querySelector(".dl"),dgs=[...el.querySelectorAll(".dg>span")],pp=[...el.querySelectorAll(".pp")],eta=el.querySelector(".eta"),sr=el.querySelector(".sr"),lb=el.querySelector(".w1 .lb");let n=0,iv=0;
const paint=()=>{const v=Math.max(0,n);dgs[0].style.setProperty("--n",String(Math.floor(v/10)%10));dgs[1].style.setProperty("--n",String(v%10));pp.forEach((p,i)=>p.classList.toggle("gone",i>=Math.min(10,v)));eta.textContent=String(Math.max(1,Math.ceil(v/10)))};
const start=u=>{clearInterval(iv);n=37;dl.classList.remove("turn");paint();u&&foc(".lv",350);iv=setInterval(()=>{n-=Math.random()<.35?2:1;paint();if(n>0&&n%10===0)sr.textContent=n+" "+lb.textContent;if(n<=0){clearInterval(iv);dl.classList.add("turn");sr.textContent=dl.querySelector(".w2 .ti").textContent;if(el.contains(document.activeElement))foc(".en",60)}},520)};
el.querySelector(".lv").addEventListener("click",close);el.querySelector(".en").addEventListener("click",close);return()=>{tms.forEach(clearTimeout);clearInterval(iv)}
}

export default function OvQueueRoom() {
  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": "#7c3aed",
          "--c2": "#22c55e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq13-que"><div className="pgx" aria-hidden="true"><p className="bd">Tour 2027</p><i></i><i></i><i className="s"></i></div><button type="button" className="fire" aria-haspopup="dialog">Back to the queue</button><div className="scr"></div><div className="dl" role="dialog" aria-modal="true" aria-labelledby="uvq13-que-t" aria-describedby="uvq13-que-d"><p className="kk">Waiting room</p><div className="w1"><p className="ti" id="uvq13-que-t">You are in the queue</p><div className="nb" aria-hidden="true"><span className="dg"><span><b>0</b><b>1</b><b>2</b><b>3</b><b>4</b><b>5</b><b>6</b><b>7</b><b>8</b><b>9</b></span></span><span className="dg"><span><b>0</b><b>1</b><b>2</b><b>3</b><b>4</b><b>5</b><b>6</b><b>7</b><b>8</b><b>9</b></span></span></div><p className="lb" id="uvq13-que-d">people ahead of you</p><div className="tr" aria-hidden="true"><i className="door"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 21V4.5A1.5 1.5 0 0 1 7.5 3h9A1.5 1.5 0 0 1 18 4.5V21M3 21h18M14.5 12.5v.01" /></svg></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="pp"></i><i className="me"></i></div><p className="et"><span>Estimated time</span> <b><span className="eta">4</span> min</b></p><label className="nt"><input type="checkbox" className="sw" /><span>Let me know when it is my turn</span></label><button type="button" className="lv">Leave the queue</button></div><div className="w2"><span className="ok"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" /></svg></span><p className="ti">It is your turn</p><p className="lb">You have 10 minutes to choose your tickets.</p><button type="button" className="en">Go to checkout</button></div><p className="sr" aria-live="polite"></p></div></div>
      </div>
    </>
  );
}
```

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