# Windshield head-up display

> Speed, limit and next turn projected on the car glass, with the faint double image of a real windshield.

- Category: [Liquid Glass](https://library.aimran.es/components/liquid-glass)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-lg-hud-windshield
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A driver’s view at dusk with a head-up display floating on the windshield. The road is an SVG drawn in perspective whose lane marks move with the speed, and the HUD glows in one color with a faint offset ghost, the double reflection you get from the two faces of laminated glass. Above the limit, the numbers turn amber.

Use the plus and minus buttons, or hold them, to change the speed. Recolor the projection and warning tones and type the next street in the text field. It suits car configurators, navigation apps and mobility landing pages.

## Code

### HTML

```html
<div class="uvq11-hud"><i class="sk" aria-hidden="true"></i><svg class="rd" viewBox="0 0 200 60" preserveAspectRatio="none" aria-hidden="true"><path class="as" d="M97 0H103L250 60H-50Z"/><path class="ln" d="M98 0L-28 60M102 0L228 60"/><path class="ds" d="M97.71 85.71L102.29 85.71L100.64 24.00L99.36 24.00ZM99.66 12.77L100.34 12.77L100.25 9.23L99.75 9.23ZM99.82 6.90L100.18 6.90L100.15 5.71L99.85 5.71ZM99.87 4.72L100.13 4.72L100.11 4.14L99.89 4.14ZM99.90 3.59L100.10 3.59L100.09 3.24L99.91 3.24ZM99.92 2.90L100.08 2.90L100.07 2.67L99.93 2.67ZM99.94 2.43L100.06 2.43L100.06 2.26L99.94 2.26ZM99.94 2.09L100.06 2.09L100.05 1.97L99.95 1.97ZM99.95 1.83L100.05 1.83L100.05 1.74L99.95 1.74ZM99.96 1.63L100.04 1.63L100.04 1.56L99.96 1.56Z"/></svg><div class="ws" aria-hidden="true"></div><div class="hud"><span class="lim"><b>90</b></span><span class="sp"><output>80</output><small>km/h</small></span><span class="nv"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 20v-7a4 4 0 0 1 4-4h8M15 5l4 4-4 4"/></svg><span><b class="dst">300 m</b><i>Main Street</i></span></span></div><i class="pil l" aria-hidden="true"></i><i class="pil r" aria-hidden="true"></i><div class="db"><button type="button" class="ch br" aria-label="Brake"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button><span class="lb">Speed</span><button type="button" class="ch ac" aria-label="Accelerate"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button></div></div>
```

### CSS

```css
.uvq11-hud {
  --c1: #5eead4;
  --c2: #ff9f43;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq11-hud {
  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: 20em;
  height: 14em;
  border-radius: 1.6em;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  background: linear-gradient(180deg,#232a5c 0%,#6b4a8a 22%,#e07a5f 40%,#f6bd60 46%,#1d1b26 46%);
}

.uvq11-hud .sk {
  position: absolute;
  left: 0;
  right: 0;
  top: 4.6em;
  height: 1.9em;
  background: radial-gradient(30% 60% at 62% 100%,rgba(255,220,150,.9),transparent 70%),radial-gradient(40% 90% at 18% 100%,#2c2440 98%,transparent),radial-gradient(45% 80% at 85% 100%,#352a4e 98%,transparent);
}

.uvq11-hud .rd {
  position: absolute;
  left: 0;
  top: 6.45em;
  width: 100%;
  height: 5.2em;
}

.uvq11-hud .as {
  fill: #2a2830;
}

.uvq11-hud .ln {
  fill: none;
  stroke: rgba(255,255,255,.7);
  stroke-width: .6;
  vector-effect: non-scaling-stroke;
}

.uvq11-hud .ds {
  fill: #f4e9c8;
}

.uvq11-hud .ws {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,rgba(30,50,90,.65) 0,rgba(30,50,90,.25) 1.6em,transparent 2.6em),linear-gradient(115deg,transparent 30%,rgba(255,255,255,.07) 38%,transparent 46%),linear-gradient(0deg,rgba(200,210,255,.08) 0 3.2em,transparent 4.4em);
}

.uvq11-hud .hud {
  position: absolute;
  left: 50%;
  top: 6.7em;
  display: flex;
  align-items: center;
  gap: .9em;
  color: var(--c1);
  transform: translateX(-50%) perspective(20em) rotateX(12deg);
  text-shadow: 0 0 .35em color-mix(in srgb,var(--c1) 70%,transparent),.1em -.16em 0 color-mix(in srgb,var(--c1) 24%,transparent);
  white-space: nowrap;
}

.uvq11-hud .lim {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  box-shadow: 0 0 0 .14em var(--c1),0 0 .4em color-mix(in srgb,var(--c1) 70%,transparent),.1em -.16em 0 .14em color-mix(in srgb,var(--c1) 20%,transparent);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .lim b {
  font-size: .8em;
  font-weight: 800;
}

.uvq11-hud .sp {
  display: flex;
  align-items: baseline;
  gap: .2em;
}

.uvq11-hud .sp output {
  font-size: 2.3em;
  font-weight: 300;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .sp small {
  font-size: .6em;
  font-weight: 700;
  opacity: .85;
}

.uvq11-hud .nv {
  display: flex;
  align-items: center;
  gap: .35em;
}

.uvq11-hud .nv svg {
  width: 1.4em;
  height: 1.4em;
  filter: drop-shadow(0 0 .2em var(--c1));
}

.uvq11-hud .nv span {
  display: grid;
  line-height: 1.15;
}

.uvq11-hud .nv b {
  font-size: .8em;
  font-variant-numeric: tabular-nums;
}

.uvq11-hud .nv i {
  font-size: .6em;
  font-style: normal;
  font-weight: 600;
  opacity: .85;
}

.uvq11-hud.ov .sp output {
  color: var(--c2);
  text-shadow: 0 0 .35em color-mix(in srgb,var(--c2) 70%,transparent),.1em -.16em 0 color-mix(in srgb,var(--c2) 24%,transparent);
}

.uvq11-hud.ov .lim {
  box-shadow: 0 0 0 .14em var(--c2),0 0 .6em var(--c2);
  color: var(--c2);
  animation: uvq11-hud calc(0.8s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq11-hud .pil {
  position: absolute;
  top: 0;
  bottom: 2em;
  width: 2.6em;
  background: linear-gradient(90deg,#0d0d12,#1c1c24);
}

.uvq11-hud .pil.l {
  left: 0;
  clip-path: polygon(0 0,40% 0,100% 100%,0 100%);
}

.uvq11-hud .pil.r {
  right: 0;
  clip-path: polygon(60% 0,100% 0,100% 100%,0 100%);
}

.uvq11-hud .db {
  position: absolute;
  left: -1em;
  right: -1em;
  bottom: 0;
  height: 2.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9em;
  border-radius: 50% 50% 0 0/1.4em 1.4em 0 0;
  background: linear-gradient(180deg,#24242c,#0e0e12 40%);
  box-shadow: inset 0 .1em 0 rgba(255,255,255,.12);
}

.uvq11-hud .db::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: .35em;
  border-top: 1px dashed rgba(255,255,255,.2);
}

.uvq11-hud .lb {
  font-size: .62em;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

.uvq11-hud .ch {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .55em 1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.7);
  backdrop-filter: blur(10px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),inset 0 -1px 0 rgba(255,255,255,.1),inset 0 0 0 1px rgba(255,255,255,.24),0 .5em 1.2em -.5em rgba(0,0,0,.45);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .ch:hover {
  background: rgba(255,255,255,.28);
}

.uvq11-hud .ch:active {
  transform: scale(.92);
}

.uvq11-hud .ch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.uvq11-hud .ch svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq11-hud .ch {
  padding: .5em .8em;
  background: rgba(255,255,255,.1);
}

@keyframes uvq11-hud {
  50% {
    transform: scale(1.12);
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq11-hud").forEach(el => {
  const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;const hud=el.querySelector(".hud"),out=el.querySelector(".sp output"),ds=el.querySelector(".ds"),dst=el.querySelector(".dst");let v=80,o=0,m=300,last=0,raf=0,iv=0,ht=0;
const road=o=>{let d="";for(let k=0;k<10;k++){const z1=.7+((k*4-o)%40+40)%40,z2=z1+1.8,a=1.6/z1,b=1.6/z2;d+="M"+(100-a).toFixed(2)+" "+(60/z1).toFixed(2)+"L"+(100+a).toFixed(2)+" "+(60/z1).toFixed(2)+"L"+(100+b).toFixed(2)+" "+(60/z2).toFixed(2)+"L"+(100-b).toFixed(2)+" "+(60/z2).toFixed(2)+"Z"}return d};
const set=n=>{v=Math.max(0,Math.min(160,n));out.textContent=String(v);el.classList.toggle("ov",v>90)};
const loop=t=>{const dt=Math.min(60,t-(last||t))/1000;last=t;o+=v/3.6*dt*.35;m-=v/3.6*dt*3;if(m<0)m=300+Math.round(Math.random()*4)*50;ds.setAttribute("d",road(o));dst.textContent=Math.round(m/10)*10+" m";raf=requestAnimationFrame(loop)};
if(!rm)raf=requestAnimationFrame(loop);
[[".br",-5],[".ac",5]].forEach(([s,d])=>{const b=el.querySelector(s);b.addEventListener("click",()=>set(v+d));const stop=()=>{clearTimeout(ht);clearInterval(iv)};b.addEventListener("pointerdown",()=>{stop();ht=setTimeout(()=>{iv=setInterval(()=>set(v+d/2.5),70)},380)});["pointerup","pointerleave","pointercancel"].forEach(n=>b.addEventListener(n,stop))});
return()=>{cancelAnimationFrame(raf);clearTimeout(ht);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 = `
.uvq11-hud {
  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: 20em;
  height: 14em;
  border-radius: 1.6em;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  background: linear-gradient(180deg,#232a5c 0%,#6b4a8a 22%,#e07a5f 40%,#f6bd60 46%,#1d1b26 46%);
}

.uvq11-hud .sk {
  position: absolute;
  left: 0;
  right: 0;
  top: 4.6em;
  height: 1.9em;
  background: radial-gradient(30% 60% at 62% 100%,rgba(255,220,150,.9),transparent 70%),radial-gradient(40% 90% at 18% 100%,#2c2440 98%,transparent),radial-gradient(45% 80% at 85% 100%,#352a4e 98%,transparent);
}

.uvq11-hud .rd {
  position: absolute;
  left: 0;
  top: 6.45em;
  width: 100%;
  height: 5.2em;
}

.uvq11-hud .as {
  fill: #2a2830;
}

.uvq11-hud .ln {
  fill: none;
  stroke: rgba(255,255,255,.7);
  stroke-width: .6;
  vector-effect: non-scaling-stroke;
}

.uvq11-hud .ds {
  fill: #f4e9c8;
}

.uvq11-hud .ws {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,rgba(30,50,90,.65) 0,rgba(30,50,90,.25) 1.6em,transparent 2.6em),linear-gradient(115deg,transparent 30%,rgba(255,255,255,.07) 38%,transparent 46%),linear-gradient(0deg,rgba(200,210,255,.08) 0 3.2em,transparent 4.4em);
}

.uvq11-hud .hud {
  position: absolute;
  left: 50%;
  top: 6.7em;
  display: flex;
  align-items: center;
  gap: .9em;
  color: var(--c1);
  transform: translateX(-50%) perspective(20em) rotateX(12deg);
  text-shadow: 0 0 .35em color-mix(in srgb,var(--c1) 70%,transparent),.1em -.16em 0 color-mix(in srgb,var(--c1) 24%,transparent);
  white-space: nowrap;
}

.uvq11-hud .lim {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  box-shadow: 0 0 0 .14em var(--c1),0 0 .4em color-mix(in srgb,var(--c1) 70%,transparent),.1em -.16em 0 .14em color-mix(in srgb,var(--c1) 20%,transparent);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .lim b {
  font-size: .8em;
  font-weight: 800;
}

.uvq11-hud .sp {
  display: flex;
  align-items: baseline;
  gap: .2em;
}

.uvq11-hud .sp output {
  font-size: 2.3em;
  font-weight: 300;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .sp small {
  font-size: .6em;
  font-weight: 700;
  opacity: .85;
}

.uvq11-hud .nv {
  display: flex;
  align-items: center;
  gap: .35em;
}

.uvq11-hud .nv svg {
  width: 1.4em;
  height: 1.4em;
  filter: drop-shadow(0 0 .2em var(--c1));
}

.uvq11-hud .nv span {
  display: grid;
  line-height: 1.15;
}

.uvq11-hud .nv b {
  font-size: .8em;
  font-variant-numeric: tabular-nums;
}

.uvq11-hud .nv i {
  font-size: .6em;
  font-style: normal;
  font-weight: 600;
  opacity: .85;
}

.uvq11-hud.ov .sp output {
  color: var(--c2);
  text-shadow: 0 0 .35em color-mix(in srgb,var(--c2) 70%,transparent),.1em -.16em 0 color-mix(in srgb,var(--c2) 24%,transparent);
}

.uvq11-hud.ov .lim {
  box-shadow: 0 0 0 .14em var(--c2),0 0 .6em var(--c2);
  color: var(--c2);
  animation: uvq11-hud calc(0.8s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq11-hud .pil {
  position: absolute;
  top: 0;
  bottom: 2em;
  width: 2.6em;
  background: linear-gradient(90deg,#0d0d12,#1c1c24);
}

.uvq11-hud .pil.l {
  left: 0;
  clip-path: polygon(0 0,40% 0,100% 100%,0 100%);
}

.uvq11-hud .pil.r {
  right: 0;
  clip-path: polygon(60% 0,100% 0,100% 100%,0 100%);
}

.uvq11-hud .db {
  position: absolute;
  left: -1em;
  right: -1em;
  bottom: 0;
  height: 2.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9em;
  border-radius: 50% 50% 0 0/1.4em 1.4em 0 0;
  background: linear-gradient(180deg,#24242c,#0e0e12 40%);
  box-shadow: inset 0 .1em 0 rgba(255,255,255,.12);
}

.uvq11-hud .db::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: .35em;
  border-top: 1px dashed rgba(255,255,255,.2);
}

.uvq11-hud .lb {
  font-size: .62em;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

.uvq11-hud .ch {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .55em 1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.7);
  backdrop-filter: blur(10px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),inset 0 -1px 0 rgba(255,255,255,.1),inset 0 0 0 1px rgba(255,255,255,.24),0 .5em 1.2em -.5em rgba(0,0,0,.45);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .ch:hover {
  background: rgba(255,255,255,.28);
}

.uvq11-hud .ch:active {
  transform: scale(.92);
}

.uvq11-hud .ch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.uvq11-hud .ch svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq11-hud .ch {
  padding: .5em .8em;
  background: rgba(255,255,255,.1);
}

@keyframes uvq11-hud {
  50% {
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq11-hud,.uvq11-hud *,.uvq11-hud *::before,.uvq11-hud *::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 rm=matchMedia("(prefers-reduced-motion: reduce)").matches;const hud=el.querySelector(".hud"),out=el.querySelector(".sp output"),ds=el.querySelector(".ds"),dst=el.querySelector(".dst");let v=80,o=0,m=300,last=0,raf=0,iv=0,ht=0;
const road=o=>{let d="";for(let k=0;k<10;k++){const z1=.7+((k*4-o)%40+40)%40,z2=z1+1.8,a=1.6/z1,b=1.6/z2;d+="M"+(100-a).toFixed(2)+" "+(60/z1).toFixed(2)+"L"+(100+a).toFixed(2)+" "+(60/z1).toFixed(2)+"L"+(100+b).toFixed(2)+" "+(60/z2).toFixed(2)+"L"+(100-b).toFixed(2)+" "+(60/z2).toFixed(2)+"Z"}return d};
const set=n=>{v=Math.max(0,Math.min(160,n));out.textContent=String(v);el.classList.toggle("ov",v>90)};
const loop=t=>{const dt=Math.min(60,t-(last||t))/1000;last=t;o+=v/3.6*dt*.35;m-=v/3.6*dt*3;if(m<0)m=300+Math.round(Math.random()*4)*50;ds.setAttribute("d",road(o));dst.textContent=Math.round(m/10)*10+" m";raf=requestAnimationFrame(loop)};
if(!rm)raf=requestAnimationFrame(loop);
[[".br",-5],[".ac",5]].forEach(([s,d])=>{const b=el.querySelector(s);b.addEventListener("click",()=>set(v+d));const stop=()=>{clearTimeout(ht);clearInterval(iv)};b.addEventListener("pointerdown",()=>{stop();ht=setTimeout(()=>{iv=setInterval(()=>set(v+d/2.5),70)},380)});["pointerup","pointerleave","pointercancel"].forEach(n=>b.addEventListener(n,stop))});
return()=>{cancelAnimationFrame(raf);clearTimeout(ht);clearInterval(iv)}
}

export default function LgHudWindshield() {
  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": "#5eead4",
          "--c2": "#ff9f43",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq11-hud"><i className="sk" aria-hidden="true"></i><svg className="rd" viewBox="0 0 200 60" preserveAspectRatio="none" aria-hidden="true"><path className="as" d="M97 0H103L250 60H-50Z" /><path className="ln" d="M98 0L-28 60M102 0L228 60" /><path className="ds" d="M97.71 85.71L102.29 85.71L100.64 24.00L99.36 24.00ZM99.66 12.77L100.34 12.77L100.25 9.23L99.75 9.23ZM99.82 6.90L100.18 6.90L100.15 5.71L99.85 5.71ZM99.87 4.72L100.13 4.72L100.11 4.14L99.89 4.14ZM99.90 3.59L100.10 3.59L100.09 3.24L99.91 3.24ZM99.92 2.90L100.08 2.90L100.07 2.67L99.93 2.67ZM99.94 2.43L100.06 2.43L100.06 2.26L99.94 2.26ZM99.94 2.09L100.06 2.09L100.05 1.97L99.95 1.97ZM99.95 1.83L100.05 1.83L100.05 1.74L99.95 1.74ZM99.96 1.63L100.04 1.63L100.04 1.56L99.96 1.56Z" /></svg><div className="ws" aria-hidden="true"></div><div className="hud"><span className="lim"><b>90</b></span><span className="sp"><output>80</output><small>km/h</small></span><span className="nv"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M7 20v-7a4 4 0 0 1 4-4h8M15 5l4 4-4 4" /></svg><span><b className="dst">300 m</b><i>Main Street</i></span></span></div><i className="pil l" aria-hidden="true"></i><i className="pil r" aria-hidden="true"></i><div className="db"><button type="button" className="ch br" aria-label="Brake"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12h14" /></svg></button><span className="lb">Speed</span><button type="button" className="ch ac" aria-label="Accelerate"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14" /></svg></button></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 “Windshield head-up display” block (Liquid Glass) from AIMRAN Library to my project.

## What it is
Speed, limit and next turn projected on the car glass, with the faint double image of a real windshield.

## Chosen settings
- Main color: #5eead4
- Secondary color: #ff9f43
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Calle Mayor"

## 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 = `
.uvq11-hud {
  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: 20em;
  height: 14em;
  border-radius: 1.6em;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  background: linear-gradient(180deg,#232a5c 0%,#6b4a8a 22%,#e07a5f 40%,#f6bd60 46%,#1d1b26 46%);
}

.uvq11-hud .sk {
  position: absolute;
  left: 0;
  right: 0;
  top: 4.6em;
  height: 1.9em;
  background: radial-gradient(30% 60% at 62% 100%,rgba(255,220,150,.9),transparent 70%),radial-gradient(40% 90% at 18% 100%,#2c2440 98%,transparent),radial-gradient(45% 80% at 85% 100%,#352a4e 98%,transparent);
}

.uvq11-hud .rd {
  position: absolute;
  left: 0;
  top: 6.45em;
  width: 100%;
  height: 5.2em;
}

.uvq11-hud .as {
  fill: #2a2830;
}

.uvq11-hud .ln {
  fill: none;
  stroke: rgba(255,255,255,.7);
  stroke-width: .6;
  vector-effect: non-scaling-stroke;
}

.uvq11-hud .ds {
  fill: #f4e9c8;
}

.uvq11-hud .ws {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,rgba(30,50,90,.65) 0,rgba(30,50,90,.25) 1.6em,transparent 2.6em),linear-gradient(115deg,transparent 30%,rgba(255,255,255,.07) 38%,transparent 46%),linear-gradient(0deg,rgba(200,210,255,.08) 0 3.2em,transparent 4.4em);
}

.uvq11-hud .hud {
  position: absolute;
  left: 50%;
  top: 6.7em;
  display: flex;
  align-items: center;
  gap: .9em;
  color: var(--c1);
  transform: translateX(-50%) perspective(20em) rotateX(12deg);
  text-shadow: 0 0 .35em color-mix(in srgb,var(--c1) 70%,transparent),.1em -.16em 0 color-mix(in srgb,var(--c1) 24%,transparent);
  white-space: nowrap;
}

.uvq11-hud .lim {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  box-shadow: 0 0 0 .14em var(--c1),0 0 .4em color-mix(in srgb,var(--c1) 70%,transparent),.1em -.16em 0 .14em color-mix(in srgb,var(--c1) 20%,transparent);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .lim b {
  font-size: .8em;
  font-weight: 800;
}

.uvq11-hud .sp {
  display: flex;
  align-items: baseline;
  gap: .2em;
}

.uvq11-hud .sp output {
  font-size: 2.3em;
  font-weight: 300;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .sp small {
  font-size: .6em;
  font-weight: 700;
  opacity: .85;
}

.uvq11-hud .nv {
  display: flex;
  align-items: center;
  gap: .35em;
}

.uvq11-hud .nv svg {
  width: 1.4em;
  height: 1.4em;
  filter: drop-shadow(0 0 .2em var(--c1));
}

.uvq11-hud .nv span {
  display: grid;
  line-height: 1.15;
}

.uvq11-hud .nv b {
  font-size: .8em;
  font-variant-numeric: tabular-nums;
}

.uvq11-hud .nv i {
  font-size: .6em;
  font-style: normal;
  font-weight: 600;
  opacity: .85;
}

.uvq11-hud.ov .sp output {
  color: var(--c2);
  text-shadow: 0 0 .35em color-mix(in srgb,var(--c2) 70%,transparent),.1em -.16em 0 color-mix(in srgb,var(--c2) 24%,transparent);
}

.uvq11-hud.ov .lim {
  box-shadow: 0 0 0 .14em var(--c2),0 0 .6em var(--c2);
  color: var(--c2);
  animation: uvq11-hud calc(0.8s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq11-hud .pil {
  position: absolute;
  top: 0;
  bottom: 2em;
  width: 2.6em;
  background: linear-gradient(90deg,#0d0d12,#1c1c24);
}

.uvq11-hud .pil.l {
  left: 0;
  clip-path: polygon(0 0,40% 0,100% 100%,0 100%);
}

.uvq11-hud .pil.r {
  right: 0;
  clip-path: polygon(60% 0,100% 0,100% 100%,0 100%);
}

.uvq11-hud .db {
  position: absolute;
  left: -1em;
  right: -1em;
  bottom: 0;
  height: 2.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9em;
  border-radius: 50% 50% 0 0/1.4em 1.4em 0 0;
  background: linear-gradient(180deg,#24242c,#0e0e12 40%);
  box-shadow: inset 0 .1em 0 rgba(255,255,255,.12);
}

.uvq11-hud .db::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: .35em;
  border-top: 1px dashed rgba(255,255,255,.2);
}

.uvq11-hud .lb {
  font-size: .62em;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

.uvq11-hud .ch {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .55em 1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.7);
  backdrop-filter: blur(10px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),inset 0 -1px 0 rgba(255,255,255,.1),inset 0 0 0 1px rgba(255,255,255,.24),0 .5em 1.2em -.5em rgba(0,0,0,.45);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-hud .ch:hover {
  background: rgba(255,255,255,.28);
}

.uvq11-hud .ch:active {
  transform: scale(.92);
}

.uvq11-hud .ch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.uvq11-hud .ch svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq11-hud .ch {
  padding: .5em .8em;
  background: rgba(255,255,255,.1);
}

@keyframes uvq11-hud {
  50% {
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq11-hud,.uvq11-hud *,.uvq11-hud *::before,.uvq11-hud *::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 rm=matchMedia("(prefers-reduced-motion: reduce)").matches;const hud=el.querySelector(".hud"),out=el.querySelector(".sp output"),ds=el.querySelector(".ds"),dst=el.querySelector(".dst");let v=80,o=0,m=300,last=0,raf=0,iv=0,ht=0;
const road=o=>{let d="";for(let k=0;k<10;k++){const z1=.7+((k*4-o)%40+40)%40,z2=z1+1.8,a=1.6/z1,b=1.6/z2;d+="M"+(100-a).toFixed(2)+" "+(60/z1).toFixed(2)+"L"+(100+a).toFixed(2)+" "+(60/z1).toFixed(2)+"L"+(100+b).toFixed(2)+" "+(60/z2).toFixed(2)+"L"+(100-b).toFixed(2)+" "+(60/z2).toFixed(2)+"Z"}return d};
const set=n=>{v=Math.max(0,Math.min(160,n));out.textContent=String(v);el.classList.toggle("ov",v>90)};
const loop=t=>{const dt=Math.min(60,t-(last||t))/1000;last=t;o+=v/3.6*dt*.35;m-=v/3.6*dt*3;if(m<0)m=300+Math.round(Math.random()*4)*50;ds.setAttribute("d",road(o));dst.textContent=Math.round(m/10)*10+" m";raf=requestAnimationFrame(loop)};
if(!rm)raf=requestAnimationFrame(loop);
[[".br",-5],[".ac",5]].forEach(([s,d])=>{const b=el.querySelector(s);b.addEventListener("click",()=>set(v+d));const stop=()=>{clearTimeout(ht);clearInterval(iv)};b.addEventListener("pointerdown",()=>{stop();ht=setTimeout(()=>{iv=setInterval(()=>set(v+d/2.5),70)},380)});["pointerup","pointerleave","pointercancel"].forEach(n=>b.addEventListener(n,stop))});
return()=>{cancelAnimationFrame(raf);clearTimeout(ht);clearInterval(iv)}
}

export default function LgHudWindshield() {
  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": "#5eead4",
          "--c2": "#ff9f43",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq11-hud"><i className="sk" aria-hidden="true"></i><svg className="rd" viewBox="0 0 200 60" preserveAspectRatio="none" aria-hidden="true"><path className="as" d="M97 0H103L250 60H-50Z" /><path className="ln" d="M98 0L-28 60M102 0L228 60" /><path className="ds" d="M97.71 85.71L102.29 85.71L100.64 24.00L99.36 24.00ZM99.66 12.77L100.34 12.77L100.25 9.23L99.75 9.23ZM99.82 6.90L100.18 6.90L100.15 5.71L99.85 5.71ZM99.87 4.72L100.13 4.72L100.11 4.14L99.89 4.14ZM99.90 3.59L100.10 3.59L100.09 3.24L99.91 3.24ZM99.92 2.90L100.08 2.90L100.07 2.67L99.93 2.67ZM99.94 2.43L100.06 2.43L100.06 2.26L99.94 2.26ZM99.94 2.09L100.06 2.09L100.05 1.97L99.95 1.97ZM99.95 1.83L100.05 1.83L100.05 1.74L99.95 1.74ZM99.96 1.63L100.04 1.63L100.04 1.56L99.96 1.56Z" /></svg><div className="ws" aria-hidden="true"></div><div className="hud"><span className="lim"><b>90</b></span><span className="sp"><output>80</output><small>km/h</small></span><span className="nv"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M7 20v-7a4 4 0 0 1 4-4h8M15 5l4 4-4 4" /></svg><span><b className="dst">300 m</b><i>Main Street</i></span></span></div><i className="pil l" aria-hidden="true"></i><i className="pil r" aria-hidden="true"></i><div className="db"><button type="button" className="ch br" aria-label="Brake"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12h14" /></svg></button><span className="lb">Speed</span><button type="button" className="ch ac" aria-label="Accelerate"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14" /></svg></button></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.
````
