# Gear lever tabs

> Car console sections chosen by sliding a chrome knob along a gate, with an amber screen that flickers on every change.

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

## Where to use it

These tabs borrow the gear selector of an automatic car: a chrome knob slides along a dark slot and lands under the letter you pick, while a small amber screen flickers and shows the section. It is plain HTML and CSS with a short script for dragging, and it fits car apps, smart home panels and dashboards with a hardware feel.

Change the main color to switch the glow from amber to ice blue or red, and the secondary color to tint the console. Keep the letters to one character and put the full names inside the screen.

## Code

### HTML

```html
<div class="uvq12-gg"><div class="sc"><div class="pn" role="tabpanel" id="uvq12-gg-p0" aria-labelledby="uvq12-gg-t0"><b>Map</b><span>North Station · 12 min</span></div><div class="pn" role="tabpanel" id="uvq12-gg-p1" aria-labelledby="uvq12-gg-t1" hidden><b>Audio</b><span>Radio 3 · Jazz</span></div><div class="pn" role="tabpanel" id="uvq12-gg-p2" aria-labelledby="uvq12-gg-t2" hidden><b>Climate</b><span>21.5 °C · 2 zones</span></div><div class="pn" role="tabpanel" id="uvq12-gg-p3" aria-labelledby="uvq12-gg-t3" hidden><b>Vehicle</b><span>Range 412 km</span></div></div><div class="gt" role="tablist" aria-label="Console"><span class="sl" aria-hidden="true"></span><span class="kn" aria-hidden="true"></span><button type="button" role="tab" id="uvq12-gg-t0" aria-selected="true" aria-controls="uvq12-gg-p0" tabindex="0" aria-label="Map"><b aria-hidden="true">M</b></button><button type="button" role="tab" id="uvq12-gg-t1" aria-selected="false" aria-controls="uvq12-gg-p1" tabindex="-1" aria-label="Audio"><b aria-hidden="true">A</b></button><button type="button" role="tab" id="uvq12-gg-t2" aria-selected="false" aria-controls="uvq12-gg-p2" tabindex="-1" aria-label="Climate"><b aria-hidden="true">C</b></button><button type="button" role="tab" id="uvq12-gg-t3" aria-selected="false" aria-controls="uvq12-gg-p3" tabindex="-1" aria-label="Vehicle"><b aria-hidden="true">V</b></button></div><small>Console</small></div>
```

### CSS

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

.uvq12-gg {
  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: 19em;
  padding: .9em .9em .7em;
  border-radius: 1.4em;
  color: #e7e5e4;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 80%,#fff 8%),var(--c2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
  --i: 0;
}

.uvq12-gg .sc {
  position: relative;
  height: 3.7em;
  margin-bottom: .6em;
  border-radius: .7em;
  overflow: hidden;
  background: #0c0a09;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07),inset 0 .4em 1em rgba(0,0,0,.8);
}

.uvq12-gg .sc::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.035) 0 1px,transparent 1px 3px);
  pointer-events: none;
}

.uvq12-gg .pn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .2em;
  padding: 0 1em;
  animation: uvq12-gg calc(0.45s / var(--k)) steps(1,end);
}

.uvq12-gg .pn[hidden] {
  display: none;
}

.uvq12-gg .pn b {
  font-size: 1.15em;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c1);
  text-shadow: 0 0 .7em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq12-gg .pn span {
  font-size: .74em;
  color: color-mix(in srgb,var(--c1) 55%,#a8a29e);
}

.uvq12-gg .gt {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  height: 4.3em;
  touch-action: pan-y;
}

.uvq12-gg .sl {
  position: absolute;
  left: calc(12.5% - .4em);
  right: calc(12.5% - .4em);
  top: 2.55em;
  height: .75em;
  border-radius: 1em;
  background: #050505;
  box-shadow: inset 0 .15em .3em rgba(0,0,0,.9),0 1px 0 rgba(255,255,255,.1);
}

.uvq12-gg .kn {
  position: absolute;
  z-index: 2;
  top: 2.92em;
  left: calc(12.5% + var(--i) * 25%);
  width: 2.2em;
  height: 2.2em;
  margin: -1.1em 0 0 -1.1em;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 30%,#fafafa,#a1a1aa 45%,#3f3f46 80%);
  box-shadow: 0 .45em .7em rgba(0,0,0,.6),0 0 0 .16em #111,0 0 0 .3em color-mix(in srgb,var(--c1) 70%,transparent),0 0 1.1em color-mix(in srgb,var(--c1) 45%,transparent);
  transition: left calc(0.55s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq12-gg [role="tab"] {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  height: 100%;
  padding-top: .25em;
  border-radius: .6em;
}

.uvq12-gg [role="tab"] b {
  font-size: 1.05em;
  font-weight: 800;
  color: #57534e;
  transition: color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),text-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-gg [role="tab"]:hover b {
  color: #a8a29e;
}

.uvq12-gg [role="tab"][aria-selected="true"] b {
  color: var(--c1);
  text-shadow: 0 0 .55em var(--c1);
}

.uvq12-gg [role="tab"]:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: -2px;
}

.uvq12-gg [role="tab"]:active b {
  transform: translateY(1px);
}

.uvq12-gg>small {
  display: block;
  margin-top: .35em;
  text-align: center;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: #78716c;
}

@keyframes uvq12-gg {
  0% {
    opacity: 0;
  }
  25% {
    opacity: .8;
  }
  45% {
    opacity: .25;
  }
  70% {
    opacity: 1;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq12-gg").forEach(el => {
  const ps=[...el.querySelectorAll('[role="tabpanel"]')];const tb=[...el.querySelectorAll('[role="tab"]')];const sel=(t,f)=>{const i=tb.indexOf(t);tb.forEach((x,j)=>{x.setAttribute("aria-selected",String(j===i));x.tabIndex=j===i?0:-1});ps.forEach((p,j)=>{p.hidden=j!==i});el.style.setProperty("--i",i);if(f)t.focus()};tb.forEach(t=>t.addEventListener("click",()=>sel(t)));el.addEventListener("keydown",e=>{const i=tb.indexOf(document.activeElement);if(i<0)return;const n={ArrowRight:i+1,ArrowDown:i+1,ArrowLeft:i-1,ArrowUp:i-1,Home:0,End:tb.length-1}[e.key];if(n===undefined)return;e.preventDefault();sel(tb[(n+tb.length)%tb.length],1)});
const gt=el.querySelector(".gt");let dn=false;const at=e=>{const r=gt.getBoundingClientRect();const k=Math.max(0,Math.min(tb.length-1,Math.floor((e.clientX-r.left)/r.width*tb.length)));if(tb[k].getAttribute("aria-selected")!=="true")sel(tb[k])};
gt.addEventListener("pointerdown",e=>{dn=true;at(e)});gt.addEventListener("pointermove",e=>{if(dn)at(e)});const up=()=>{dn=false};gt.addEventListener("pointerup",up);gt.addEventListener("pointerleave",up);gt.addEventListener("pointercancel",up)
});
```

### 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-gg {
  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: 19em;
  padding: .9em .9em .7em;
  border-radius: 1.4em;
  color: #e7e5e4;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 80%,#fff 8%),var(--c2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
  --i: 0;
}

.uvq12-gg .sc {
  position: relative;
  height: 3.7em;
  margin-bottom: .6em;
  border-radius: .7em;
  overflow: hidden;
  background: #0c0a09;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07),inset 0 .4em 1em rgba(0,0,0,.8);
}

.uvq12-gg .sc::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.035) 0 1px,transparent 1px 3px);
  pointer-events: none;
}

.uvq12-gg .pn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .2em;
  padding: 0 1em;
  animation: uvq12-gg calc(0.45s / var(--k)) steps(1,end);
}

.uvq12-gg .pn[hidden] {
  display: none;
}

.uvq12-gg .pn b {
  font-size: 1.15em;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c1);
  text-shadow: 0 0 .7em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq12-gg .pn span {
  font-size: .74em;
  color: color-mix(in srgb,var(--c1) 55%,#a8a29e);
}

.uvq12-gg .gt {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  height: 4.3em;
  touch-action: pan-y;
}

.uvq12-gg .sl {
  position: absolute;
  left: calc(12.5% - .4em);
  right: calc(12.5% - .4em);
  top: 2.55em;
  height: .75em;
  border-radius: 1em;
  background: #050505;
  box-shadow: inset 0 .15em .3em rgba(0,0,0,.9),0 1px 0 rgba(255,255,255,.1);
}

.uvq12-gg .kn {
  position: absolute;
  z-index: 2;
  top: 2.92em;
  left: calc(12.5% + var(--i) * 25%);
  width: 2.2em;
  height: 2.2em;
  margin: -1.1em 0 0 -1.1em;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 30%,#fafafa,#a1a1aa 45%,#3f3f46 80%);
  box-shadow: 0 .45em .7em rgba(0,0,0,.6),0 0 0 .16em #111,0 0 0 .3em color-mix(in srgb,var(--c1) 70%,transparent),0 0 1.1em color-mix(in srgb,var(--c1) 45%,transparent);
  transition: left calc(0.55s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq12-gg [role="tab"] {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  height: 100%;
  padding-top: .25em;
  border-radius: .6em;
}

.uvq12-gg [role="tab"] b {
  font-size: 1.05em;
  font-weight: 800;
  color: #57534e;
  transition: color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),text-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-gg [role="tab"]:hover b {
  color: #a8a29e;
}

.uvq12-gg [role="tab"][aria-selected="true"] b {
  color: var(--c1);
  text-shadow: 0 0 .55em var(--c1);
}

.uvq12-gg [role="tab"]:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: -2px;
}

.uvq12-gg [role="tab"]:active b {
  transform: translateY(1px);
}

.uvq12-gg>small {
  display: block;
  margin-top: .35em;
  text-align: center;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: #78716c;
}

@keyframes uvq12-gg {
  0% {
    opacity: 0;
  }
  25% {
    opacity: .8;
  }
  45% {
    opacity: .25;
  }
  70% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq12-gg,.uvq12-gg *,.uvq12-gg *::before,.uvq12-gg *::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 ps=[...el.querySelectorAll('[role="tabpanel"]')];const tb=[...el.querySelectorAll('[role="tab"]')];const sel=(t,f)=>{const i=tb.indexOf(t);tb.forEach((x,j)=>{x.setAttribute("aria-selected",String(j===i));x.tabIndex=j===i?0:-1});ps.forEach((p,j)=>{p.hidden=j!==i});el.style.setProperty("--i",i);if(f)t.focus()};tb.forEach(t=>t.addEventListener("click",()=>sel(t)));el.addEventListener("keydown",e=>{const i=tb.indexOf(document.activeElement);if(i<0)return;const n={ArrowRight:i+1,ArrowDown:i+1,ArrowLeft:i-1,ArrowUp:i-1,Home:0,End:tb.length-1}[e.key];if(n===undefined)return;e.preventDefault();sel(tb[(n+tb.length)%tb.length],1)});
const gt=el.querySelector(".gt");let dn=false;const at=e=>{const r=gt.getBoundingClientRect();const k=Math.max(0,Math.min(tb.length-1,Math.floor((e.clientX-r.left)/r.width*tb.length)));if(tb[k].getAttribute("aria-selected")!=="true")sel(tb[k])};
gt.addEventListener("pointerdown",e=>{dn=true;at(e)});gt.addEventListener("pointermove",e=>{if(dn)at(e)});const up=()=>{dn=false};gt.addEventListener("pointerup",up);gt.addEventListener("pointerleave",up);gt.addEventListener("pointercancel",up)
}

export default function NavGearGate() {
  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": "#1c1917",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq12-gg"><div className="sc"><div className="pn" role="tabpanel" id="uvq12-gg-p0" aria-labelledby="uvq12-gg-t0"><b>Map</b><span>North Station · 12 min</span></div><div className="pn" role="tabpanel" id="uvq12-gg-p1" aria-labelledby="uvq12-gg-t1" hidden={true}><b>Audio</b><span>Radio 3 · Jazz</span></div><div className="pn" role="tabpanel" id="uvq12-gg-p2" aria-labelledby="uvq12-gg-t2" hidden={true}><b>Climate</b><span>21.5 °C · 2 zones</span></div><div className="pn" role="tabpanel" id="uvq12-gg-p3" aria-labelledby="uvq12-gg-t3" hidden={true}><b>Vehicle</b><span>Range 412 km</span></div></div><div className="gt" role="tablist" aria-label="Console"><span className="sl" aria-hidden="true"></span><span className="kn" aria-hidden="true"></span><button type="button" role="tab" id="uvq12-gg-t0" aria-selected="true" aria-controls="uvq12-gg-p0" tabIndex={0} aria-label="Map"><b aria-hidden="true">M</b></button><button type="button" role="tab" id="uvq12-gg-t1" aria-selected="false" aria-controls="uvq12-gg-p1" tabIndex={-1} aria-label="Audio"><b aria-hidden="true">A</b></button><button type="button" role="tab" id="uvq12-gg-t2" aria-selected="false" aria-controls="uvq12-gg-p2" tabIndex={-1} aria-label="Climate"><b aria-hidden="true">C</b></button><button type="button" role="tab" id="uvq12-gg-t3" aria-selected="false" aria-controls="uvq12-gg-p3" tabIndex={-1} aria-label="Vehicle"><b aria-hidden="true">V</b></button></div><small>Console</small></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 “Gear lever tabs” block (Navigation) from AIMRAN Library to my project.

## What it is
Car console sections chosen by sliding a chrome knob along a gate, with an amber screen that flickers on every change.

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

## 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-gg {
  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: 19em;
  padding: .9em .9em .7em;
  border-radius: 1.4em;
  color: #e7e5e4;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 80%,#fff 8%),var(--c2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
  --i: 0;
}

.uvq12-gg .sc {
  position: relative;
  height: 3.7em;
  margin-bottom: .6em;
  border-radius: .7em;
  overflow: hidden;
  background: #0c0a09;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07),inset 0 .4em 1em rgba(0,0,0,.8);
}

.uvq12-gg .sc::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.035) 0 1px,transparent 1px 3px);
  pointer-events: none;
}

.uvq12-gg .pn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .2em;
  padding: 0 1em;
  animation: uvq12-gg calc(0.45s / var(--k)) steps(1,end);
}

.uvq12-gg .pn[hidden] {
  display: none;
}

.uvq12-gg .pn b {
  font-size: 1.15em;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c1);
  text-shadow: 0 0 .7em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq12-gg .pn span {
  font-size: .74em;
  color: color-mix(in srgb,var(--c1) 55%,#a8a29e);
}

.uvq12-gg .gt {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  height: 4.3em;
  touch-action: pan-y;
}

.uvq12-gg .sl {
  position: absolute;
  left: calc(12.5% - .4em);
  right: calc(12.5% - .4em);
  top: 2.55em;
  height: .75em;
  border-radius: 1em;
  background: #050505;
  box-shadow: inset 0 .15em .3em rgba(0,0,0,.9),0 1px 0 rgba(255,255,255,.1);
}

.uvq12-gg .kn {
  position: absolute;
  z-index: 2;
  top: 2.92em;
  left: calc(12.5% + var(--i) * 25%);
  width: 2.2em;
  height: 2.2em;
  margin: -1.1em 0 0 -1.1em;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 30%,#fafafa,#a1a1aa 45%,#3f3f46 80%);
  box-shadow: 0 .45em .7em rgba(0,0,0,.6),0 0 0 .16em #111,0 0 0 .3em color-mix(in srgb,var(--c1) 70%,transparent),0 0 1.1em color-mix(in srgb,var(--c1) 45%,transparent);
  transition: left calc(0.55s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq12-gg [role="tab"] {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  height: 100%;
  padding-top: .25em;
  border-radius: .6em;
}

.uvq12-gg [role="tab"] b {
  font-size: 1.05em;
  font-weight: 800;
  color: #57534e;
  transition: color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),text-shadow calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-gg [role="tab"]:hover b {
  color: #a8a29e;
}

.uvq12-gg [role="tab"][aria-selected="true"] b {
  color: var(--c1);
  text-shadow: 0 0 .55em var(--c1);
}

.uvq12-gg [role="tab"]:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: -2px;
}

.uvq12-gg [role="tab"]:active b {
  transform: translateY(1px);
}

.uvq12-gg>small {
  display: block;
  margin-top: .35em;
  text-align: center;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: #78716c;
}

@keyframes uvq12-gg {
  0% {
    opacity: 0;
  }
  25% {
    opacity: .8;
  }
  45% {
    opacity: .25;
  }
  70% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq12-gg,.uvq12-gg *,.uvq12-gg *::before,.uvq12-gg *::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 ps=[...el.querySelectorAll('[role="tabpanel"]')];const tb=[...el.querySelectorAll('[role="tab"]')];const sel=(t,f)=>{const i=tb.indexOf(t);tb.forEach((x,j)=>{x.setAttribute("aria-selected",String(j===i));x.tabIndex=j===i?0:-1});ps.forEach((p,j)=>{p.hidden=j!==i});el.style.setProperty("--i",i);if(f)t.focus()};tb.forEach(t=>t.addEventListener("click",()=>sel(t)));el.addEventListener("keydown",e=>{const i=tb.indexOf(document.activeElement);if(i<0)return;const n={ArrowRight:i+1,ArrowDown:i+1,ArrowLeft:i-1,ArrowUp:i-1,Home:0,End:tb.length-1}[e.key];if(n===undefined)return;e.preventDefault();sel(tb[(n+tb.length)%tb.length],1)});
const gt=el.querySelector(".gt");let dn=false;const at=e=>{const r=gt.getBoundingClientRect();const k=Math.max(0,Math.min(tb.length-1,Math.floor((e.clientX-r.left)/r.width*tb.length)));if(tb[k].getAttribute("aria-selected")!=="true")sel(tb[k])};
gt.addEventListener("pointerdown",e=>{dn=true;at(e)});gt.addEventListener("pointermove",e=>{if(dn)at(e)});const up=()=>{dn=false};gt.addEventListener("pointerup",up);gt.addEventListener("pointerleave",up);gt.addEventListener("pointercancel",up)
}

export default function NavGearGate() {
  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": "#1c1917",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq12-gg"><div className="sc"><div className="pn" role="tabpanel" id="uvq12-gg-p0" aria-labelledby="uvq12-gg-t0"><b>Map</b><span>North Station · 12 min</span></div><div className="pn" role="tabpanel" id="uvq12-gg-p1" aria-labelledby="uvq12-gg-t1" hidden={true}><b>Audio</b><span>Radio 3 · Jazz</span></div><div className="pn" role="tabpanel" id="uvq12-gg-p2" aria-labelledby="uvq12-gg-t2" hidden={true}><b>Climate</b><span>21.5 °C · 2 zones</span></div><div className="pn" role="tabpanel" id="uvq12-gg-p3" aria-labelledby="uvq12-gg-t3" hidden={true}><b>Vehicle</b><span>Range 412 km</span></div></div><div className="gt" role="tablist" aria-label="Console"><span className="sl" aria-hidden="true"></span><span className="kn" aria-hidden="true"></span><button type="button" role="tab" id="uvq12-gg-t0" aria-selected="true" aria-controls="uvq12-gg-p0" tabIndex={0} aria-label="Map"><b aria-hidden="true">M</b></button><button type="button" role="tab" id="uvq12-gg-t1" aria-selected="false" aria-controls="uvq12-gg-p1" tabIndex={-1} aria-label="Audio"><b aria-hidden="true">A</b></button><button type="button" role="tab" id="uvq12-gg-t2" aria-selected="false" aria-controls="uvq12-gg-p2" tabIndex={-1} aria-label="Climate"><b aria-hidden="true">C</b></button><button type="button" role="tab" id="uvq12-gg-t3" aria-selected="false" aria-controls="uvq12-gg-p3" tabIndex={-1} aria-label="Vehicle"><b aria-hidden="true">V</b></button></div><small>Console</small></div>
      </div>
    </>
  );
}
```

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