# Rotary contact file

> A Rolodex of index cards that flip over its rod with the mouse wheel, the arrow keys, a swipe or the buttons.

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

## Where to use it

The desk Rolodex is a great metaphor for browsing people one at a time. Each ruled index card has a colored tab, the cards behind fan back in perspective, and the front one flips forward over the steel rod when you move on. Wheel, keyboard, touch swipe and buttons all work. Use it for team directories, CRM widgets, supplier lists or author pages.

The main and second colors alternate on the tabs and the ruled header line. Replace the six contacts with your own, keeping one line for the role and one for the phone.

## Code

### HTML

```html
<section class="uvq07-rdx" aria-label="Contacts"><p class="ti">Contacts</p><div class="dr" tabindex="0" aria-roledescription="card file" aria-label="Use the arrow keys to flip cards"><article style="--i:0;--d:0;z-index:20"><span class="tb" aria-hidden="true">A</span><h3>Ana Beltrán</h3><p>Architect</p><p class="ph">+34 611 204 310</p></article><article style="--i:1;--d:1;z-index:19" aria-hidden="true"><span class="tb" aria-hidden="true">B</span><h3>Bruno Cano</h3><p>Photographer</p><p class="ph">+34 622 870 115</p></article><article style="--i:2;--d:2;z-index:18" aria-hidden="true"><span class="tb" aria-hidden="true">C</span><h3>Carla Díaz</h3><p>Editor</p><p class="ph">+34 633 512 908</p></article><article style="--i:3;--d:3;z-index:17" aria-hidden="true"><span class="tb" aria-hidden="true">D</span><h3>David Esteve</h3><p>Carpenter</p><p class="ph">+34 644 391 276</p></article><article style="--i:4;--d:4;z-index:16" class="far" aria-hidden="true"><span class="tb" aria-hidden="true">E</span><h3>Elena Ferrer</h3><p>Lawyer</p><p class="ph">+34 655 128 734</p></article><article style="--i:5;--d:0;z-index:30" class="pa" aria-hidden="true"><span class="tb" aria-hidden="true">F</span><h3>Fran Gómez</h3><p>Cook</p><p class="ph">+34 666 047 652</p></article><i class="rod"></i></div><div class="ct"><button type="button" class="pv" aria-label="Previous card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 15l6-6 6 6"/></svg></button><span class="ix" aria-live="polite">1 / 6</span><button type="button" class="nx" aria-label="Next card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button></div></section>
```

### CSS

```css
.uvq07-rdx {
  --c1: #c8402b;
  --c2: #e9b949;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq07-rdx {
  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: 16em;
}

.uvq07-rdx .ti {
  margin: 0 0 .3em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq07-rdx .dr {
  position: relative;
  height: 12.5em;
  outline: 0;
  border-radius: .8em;
  touch-action: none;
  cursor: ns-resize;
}

.uvq07-rdx .dr:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-rdx article {
  position: absolute;
  left: .6em;
  right: .6em;
  bottom: 1.6em;
  height: 8.4em;
  box-sizing: border-box;
  padding: 1em 1em .8em;
  border-radius: .35em;
  color: #26221c;
  background: linear-gradient(180deg,transparent 2.3em,color-mix(in srgb,var(--c1) 70%,transparent) 2.3em 2.38em,transparent 2.38em),repeating-linear-gradient(180deg,transparent 0 1.3em,#c5d8ea 1.3em 1.36em) 0 2.4em/100% calc(100% - 2.4em) no-repeat,#fffdf6;
  box-shadow: 0 -.1em .3em rgba(0,0,0,.08),0 .6em 1.2em -.6em rgba(0,0,0,.35);
  transform-origin: 50% 130%;
  transform: perspective(40em) translateY(calc(var(--d,0) * -.85em)) rotateX(calc(var(--d,0) * 4deg)) scale(calc(1 - var(--d,0) * .035));
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-rdx article.pa {
  transform: perspective(40em) translateY(1em) rotateX(-95deg);
  opacity: 0;
}

.uvq07-rdx article.far {
  opacity: 0;
}

.uvq07-rdx .tb {
  position: absolute;
  top: -1.15em;
  left: calc(.5em + var(--i) * 2.05em);
  width: 2em;
  height: 1.2em;
  display: grid;
  place-items: center;
  border-radius: .35em .35em 0 0;
  font-size: .85em;
  font-weight: 800;
  color: #fff;
  background: var(--c1);
}

.uvq07-rdx article:nth-child(even) .tb {
  color: #26221c;
  background: var(--c2);
}

.uvq07-rdx h3 {
  margin: 0;
  font: 700 1.05em/1.2 "American Typewriter","Courier New",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-rdx article p {
  margin: .6em 0 0;
  font: 400 .78em/1.2 "American Typewriter","Courier New",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-rdx .ph {
  font-variant-numeric: tabular-nums;
  opacity: .8;
}

.uvq07-rdx .rod {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: .9em;
  height: .7em;
  border-radius: 1em;
  background: linear-gradient(180deg,#e9eaec,#9da1a8 55%,#6b6f76);
  box-shadow: 0 .3em .6em -.2em rgba(0,0,0,.4);
}

.uvq07-rdx .rod::before,.uvq07-rdx .rod::after {
  content: "";
  position: absolute;
  top: -.5em;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#f2f2f2,#8a8e95 60%,#55585e);
}

.uvq07-rdx .rod::before {
  left: -.3em;
}

.uvq07-rdx .rod::after {
  right: -.3em;
}

.uvq07-rdx .ct {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  margin-top: .4em;
}

.uvq07-rdx .ct button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  width: 2.3em;
  height: 2.3em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-rdx .ct button:hover {
  background: color-mix(in srgb,var(--fg) 12%,transparent);
}

.uvq07-rdx .ct button:active {
  transform: scale(.9);
}

.uvq07-rdx .ct button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-rdx .ct svg {
  width: 1.1em;
  height: 1.1em;
}

.uvq07-rdx .ix {
  min-width: 3.5em;
  text-align: center;
  font-size: .8em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

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

### JavaScript

```js
document.querySelectorAll(".uvq07-rdx").forEach(el => {
  const cs=[...el.querySelectorAll("article")],ix=el.querySelector(".ix"),dr=el.querySelector(".dr"),N=cs.length;let k=0,wl=0,y0=null;
const go=n=>{k=(n+N)%N;cs.forEach((c,i)=>{let d=(i-k+N)%N;if(d===N-1)d=-1;c.style.setProperty("--d",String(Math.max(d,0)));c.style.zIndex=String(d<0?30:20-d);c.classList.toggle("pa",d<0);c.classList.toggle("far",d>3);c.setAttribute("aria-hidden",String(d!==0))});ix.textContent=(k+1)+" / "+N};
el.querySelector(".pv").addEventListener("click",()=>go(k-1));el.querySelector(".nx").addEventListener("click",()=>go(k+1));
dr.addEventListener("keydown",e=>{if(e.key==="ArrowDown"||e.key==="ArrowRight"){e.preventDefault();go(k+1)}if(e.key==="ArrowUp"||e.key==="ArrowLeft"){e.preventDefault();go(k-1)}});
dr.addEventListener("wheel",e=>{e.preventDefault();const t=Date.now();if(t-wl<220)return;wl=t;go(k+(e.deltaY>0?1:-1))},{passive:false});
dr.addEventListener("pointerdown",e=>{y0=e.clientY});dr.addEventListener("pointerup",e=>{if(y0!==null&&Math.abs(e.clientY-y0)>24)go(k+(e.clientY<y0?1:-1));y0=null});
go(0)
});
```

### 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 = `
.uvq07-rdx {
  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: 16em;
}

.uvq07-rdx .ti {
  margin: 0 0 .3em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq07-rdx .dr {
  position: relative;
  height: 12.5em;
  outline: 0;
  border-radius: .8em;
  touch-action: none;
  cursor: ns-resize;
}

.uvq07-rdx .dr:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-rdx article {
  position: absolute;
  left: .6em;
  right: .6em;
  bottom: 1.6em;
  height: 8.4em;
  box-sizing: border-box;
  padding: 1em 1em .8em;
  border-radius: .35em;
  color: #26221c;
  background: linear-gradient(180deg,transparent 2.3em,color-mix(in srgb,var(--c1) 70%,transparent) 2.3em 2.38em,transparent 2.38em),repeating-linear-gradient(180deg,transparent 0 1.3em,#c5d8ea 1.3em 1.36em) 0 2.4em/100% calc(100% - 2.4em) no-repeat,#fffdf6;
  box-shadow: 0 -.1em .3em rgba(0,0,0,.08),0 .6em 1.2em -.6em rgba(0,0,0,.35);
  transform-origin: 50% 130%;
  transform: perspective(40em) translateY(calc(var(--d,0) * -.85em)) rotateX(calc(var(--d,0) * 4deg)) scale(calc(1 - var(--d,0) * .035));
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-rdx article.pa {
  transform: perspective(40em) translateY(1em) rotateX(-95deg);
  opacity: 0;
}

.uvq07-rdx article.far {
  opacity: 0;
}

.uvq07-rdx .tb {
  position: absolute;
  top: -1.15em;
  left: calc(.5em + var(--i) * 2.05em);
  width: 2em;
  height: 1.2em;
  display: grid;
  place-items: center;
  border-radius: .35em .35em 0 0;
  font-size: .85em;
  font-weight: 800;
  color: #fff;
  background: var(--c1);
}

.uvq07-rdx article:nth-child(even) .tb {
  color: #26221c;
  background: var(--c2);
}

.uvq07-rdx h3 {
  margin: 0;
  font: 700 1.05em/1.2 "American Typewriter","Courier New",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-rdx article p {
  margin: .6em 0 0;
  font: 400 .78em/1.2 "American Typewriter","Courier New",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-rdx .ph {
  font-variant-numeric: tabular-nums;
  opacity: .8;
}

.uvq07-rdx .rod {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: .9em;
  height: .7em;
  border-radius: 1em;
  background: linear-gradient(180deg,#e9eaec,#9da1a8 55%,#6b6f76);
  box-shadow: 0 .3em .6em -.2em rgba(0,0,0,.4);
}

.uvq07-rdx .rod::before,.uvq07-rdx .rod::after {
  content: "";
  position: absolute;
  top: -.5em;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#f2f2f2,#8a8e95 60%,#55585e);
}

.uvq07-rdx .rod::before {
  left: -.3em;
}

.uvq07-rdx .rod::after {
  right: -.3em;
}

.uvq07-rdx .ct {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  margin-top: .4em;
}

.uvq07-rdx .ct button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  width: 2.3em;
  height: 2.3em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-rdx .ct button:hover {
  background: color-mix(in srgb,var(--fg) 12%,transparent);
}

.uvq07-rdx .ct button:active {
  transform: scale(.9);
}

.uvq07-rdx .ct button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-rdx .ct svg {
  width: 1.1em;
  height: 1.1em;
}

.uvq07-rdx .ix {
  min-width: 3.5em;
  text-align: center;
  font-size: .8em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-rdx,.uvq07-rdx *,.uvq07-rdx *::before,.uvq07-rdx *::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 cs=[...el.querySelectorAll("article")],ix=el.querySelector(".ix"),dr=el.querySelector(".dr"),N=cs.length;let k=0,wl=0,y0=null;
const go=n=>{k=(n+N)%N;cs.forEach((c,i)=>{let d=(i-k+N)%N;if(d===N-1)d=-1;c.style.setProperty("--d",String(Math.max(d,0)));c.style.zIndex=String(d<0?30:20-d);c.classList.toggle("pa",d<0);c.classList.toggle("far",d>3);c.setAttribute("aria-hidden",String(d!==0))});ix.textContent=(k+1)+" / "+N};
el.querySelector(".pv").addEventListener("click",()=>go(k-1));el.querySelector(".nx").addEventListener("click",()=>go(k+1));
dr.addEventListener("keydown",e=>{if(e.key==="ArrowDown"||e.key==="ArrowRight"){e.preventDefault();go(k+1)}if(e.key==="ArrowUp"||e.key==="ArrowLeft"){e.preventDefault();go(k-1)}});
dr.addEventListener("wheel",e=>{e.preventDefault();const t=Date.now();if(t-wl<220)return;wl=t;go(k+(e.deltaY>0?1:-1))},{passive:false});
dr.addEventListener("pointerdown",e=>{y0=e.clientY});dr.addEventListener("pointerup",e=>{if(y0!==null&&Math.abs(e.clientY-y0)>24)go(k+(e.clientY<y0?1:-1));y0=null});
go(0)
}

export default function CardRolodex() {
  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": "#c8402b",
          "--c2": "#e9b949",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <section className="uvq07-rdx" aria-label="Contacts"><p className="ti">Contacts</p><div className="dr" tabIndex={0} aria-roledescription="card file" aria-label="Use the arrow keys to flip cards"><article style={{ "--i": "0", "--d": "0", zIndex: "20" } as CSSProperties}><span className="tb" aria-hidden="true">A</span><h3>Ana Beltrán</h3><p>Architect</p><p className="ph">+34 611 204 310</p></article><article style={{ "--i": "1", "--d": "1", zIndex: "19" } as CSSProperties} aria-hidden="true"><span className="tb" aria-hidden="true">B</span><h3>Bruno Cano</h3><p>Photographer</p><p className="ph">+34 622 870 115</p></article><article style={{ "--i": "2", "--d": "2", zIndex: "18" } as CSSProperties} aria-hidden="true"><span className="tb" aria-hidden="true">C</span><h3>Carla Díaz</h3><p>Editor</p><p className="ph">+34 633 512 908</p></article><article style={{ "--i": "3", "--d": "3", zIndex: "17" } as CSSProperties} aria-hidden="true"><span className="tb" aria-hidden="true">D</span><h3>David Esteve</h3><p>Carpenter</p><p className="ph">+34 644 391 276</p></article><article style={{ "--i": "4", "--d": "4", zIndex: "16" } as CSSProperties} className="far" aria-hidden="true"><span className="tb" aria-hidden="true">E</span><h3>Elena Ferrer</h3><p>Lawyer</p><p className="ph">+34 655 128 734</p></article><article style={{ "--i": "5", "--d": "0", zIndex: "30" } as CSSProperties} className="pa" aria-hidden="true"><span className="tb" aria-hidden="true">F</span><h3>Fran Gómez</h3><p>Cook</p><p className="ph">+34 666 047 652</p></article><i className="rod"></i></div><div className="ct"><button type="button" className="pv" aria-label="Previous card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 15l6-6 6 6" /></svg></button><span className="ix" aria-live="polite">1 / 6</span><button type="button" className="nx" aria-label="Next card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6" /></svg></button></div></section>
      </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 “Rotary contact file” block (Cards) from AIMRAN Library to my project.

## What it is
A Rolodex of index cards that flip over its rod with the mouse wheel, the arrow keys, a swipe or the buttons.

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

## 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 = `
.uvq07-rdx {
  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: 16em;
}

.uvq07-rdx .ti {
  margin: 0 0 .3em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq07-rdx .dr {
  position: relative;
  height: 12.5em;
  outline: 0;
  border-radius: .8em;
  touch-action: none;
  cursor: ns-resize;
}

.uvq07-rdx .dr:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-rdx article {
  position: absolute;
  left: .6em;
  right: .6em;
  bottom: 1.6em;
  height: 8.4em;
  box-sizing: border-box;
  padding: 1em 1em .8em;
  border-radius: .35em;
  color: #26221c;
  background: linear-gradient(180deg,transparent 2.3em,color-mix(in srgb,var(--c1) 70%,transparent) 2.3em 2.38em,transparent 2.38em),repeating-linear-gradient(180deg,transparent 0 1.3em,#c5d8ea 1.3em 1.36em) 0 2.4em/100% calc(100% - 2.4em) no-repeat,#fffdf6;
  box-shadow: 0 -.1em .3em rgba(0,0,0,.08),0 .6em 1.2em -.6em rgba(0,0,0,.35);
  transform-origin: 50% 130%;
  transform: perspective(40em) translateY(calc(var(--d,0) * -.85em)) rotateX(calc(var(--d,0) * 4deg)) scale(calc(1 - var(--d,0) * .035));
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-rdx article.pa {
  transform: perspective(40em) translateY(1em) rotateX(-95deg);
  opacity: 0;
}

.uvq07-rdx article.far {
  opacity: 0;
}

.uvq07-rdx .tb {
  position: absolute;
  top: -1.15em;
  left: calc(.5em + var(--i) * 2.05em);
  width: 2em;
  height: 1.2em;
  display: grid;
  place-items: center;
  border-radius: .35em .35em 0 0;
  font-size: .85em;
  font-weight: 800;
  color: #fff;
  background: var(--c1);
}

.uvq07-rdx article:nth-child(even) .tb {
  color: #26221c;
  background: var(--c2);
}

.uvq07-rdx h3 {
  margin: 0;
  font: 700 1.05em/1.2 "American Typewriter","Courier New",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-rdx article p {
  margin: .6em 0 0;
  font: 400 .78em/1.2 "American Typewriter","Courier New",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq07-rdx .ph {
  font-variant-numeric: tabular-nums;
  opacity: .8;
}

.uvq07-rdx .rod {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: .9em;
  height: .7em;
  border-radius: 1em;
  background: linear-gradient(180deg,#e9eaec,#9da1a8 55%,#6b6f76);
  box-shadow: 0 .3em .6em -.2em rgba(0,0,0,.4);
}

.uvq07-rdx .rod::before,.uvq07-rdx .rod::after {
  content: "";
  position: absolute;
  top: -.5em;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#f2f2f2,#8a8e95 60%,#55585e);
}

.uvq07-rdx .rod::before {
  left: -.3em;
}

.uvq07-rdx .rod::after {
  right: -.3em;
}

.uvq07-rdx .ct {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  margin-top: .4em;
}

.uvq07-rdx .ct button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  width: 2.3em;
  height: 2.3em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-rdx .ct button:hover {
  background: color-mix(in srgb,var(--fg) 12%,transparent);
}

.uvq07-rdx .ct button:active {
  transform: scale(.9);
}

.uvq07-rdx .ct button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-rdx .ct svg {
  width: 1.1em;
  height: 1.1em;
}

.uvq07-rdx .ix {
  min-width: 3.5em;
  text-align: center;
  font-size: .8em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-rdx,.uvq07-rdx *,.uvq07-rdx *::before,.uvq07-rdx *::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 cs=[...el.querySelectorAll("article")],ix=el.querySelector(".ix"),dr=el.querySelector(".dr"),N=cs.length;let k=0,wl=0,y0=null;
const go=n=>{k=(n+N)%N;cs.forEach((c,i)=>{let d=(i-k+N)%N;if(d===N-1)d=-1;c.style.setProperty("--d",String(Math.max(d,0)));c.style.zIndex=String(d<0?30:20-d);c.classList.toggle("pa",d<0);c.classList.toggle("far",d>3);c.setAttribute("aria-hidden",String(d!==0))});ix.textContent=(k+1)+" / "+N};
el.querySelector(".pv").addEventListener("click",()=>go(k-1));el.querySelector(".nx").addEventListener("click",()=>go(k+1));
dr.addEventListener("keydown",e=>{if(e.key==="ArrowDown"||e.key==="ArrowRight"){e.preventDefault();go(k+1)}if(e.key==="ArrowUp"||e.key==="ArrowLeft"){e.preventDefault();go(k-1)}});
dr.addEventListener("wheel",e=>{e.preventDefault();const t=Date.now();if(t-wl<220)return;wl=t;go(k+(e.deltaY>0?1:-1))},{passive:false});
dr.addEventListener("pointerdown",e=>{y0=e.clientY});dr.addEventListener("pointerup",e=>{if(y0!==null&&Math.abs(e.clientY-y0)>24)go(k+(e.clientY<y0?1:-1));y0=null});
go(0)
}

export default function CardRolodex() {
  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": "#c8402b",
          "--c2": "#e9b949",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <section className="uvq07-rdx" aria-label="Contacts"><p className="ti">Contacts</p><div className="dr" tabIndex={0} aria-roledescription="card file" aria-label="Use the arrow keys to flip cards"><article style={{ "--i": "0", "--d": "0", zIndex: "20" } as CSSProperties}><span className="tb" aria-hidden="true">A</span><h3>Ana Beltrán</h3><p>Architect</p><p className="ph">+34 611 204 310</p></article><article style={{ "--i": "1", "--d": "1", zIndex: "19" } as CSSProperties} aria-hidden="true"><span className="tb" aria-hidden="true">B</span><h3>Bruno Cano</h3><p>Photographer</p><p className="ph">+34 622 870 115</p></article><article style={{ "--i": "2", "--d": "2", zIndex: "18" } as CSSProperties} aria-hidden="true"><span className="tb" aria-hidden="true">C</span><h3>Carla Díaz</h3><p>Editor</p><p className="ph">+34 633 512 908</p></article><article style={{ "--i": "3", "--d": "3", zIndex: "17" } as CSSProperties} aria-hidden="true"><span className="tb" aria-hidden="true">D</span><h3>David Esteve</h3><p>Carpenter</p><p className="ph">+34 644 391 276</p></article><article style={{ "--i": "4", "--d": "4", zIndex: "16" } as CSSProperties} className="far" aria-hidden="true"><span className="tb" aria-hidden="true">E</span><h3>Elena Ferrer</h3><p>Lawyer</p><p className="ph">+34 655 128 734</p></article><article style={{ "--i": "5", "--d": "0", zIndex: "30" } as CSSProperties} className="pa" aria-hidden="true"><span className="tb" aria-hidden="true">F</span><h3>Fran Gómez</h3><p>Cook</p><p className="ph">+34 666 047 652</p></article><i className="rod"></i></div><div className="ct"><button type="button" className="pv" aria-label="Previous card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 15l6-6 6 6" /></svg></button><span className="ix" aria-live="polite">1 / 6</span><button type="button" className="nx" aria-label="Next card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6" /></svg></button></div></section>
      </div>
    </>
  );
}
```

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