# Stained glass rose window

> A leaded glass rose window: the sun follows the cursor and the petal you choose casts its color on the stone floor.

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

## Where to use it

A Gothic rose window drawn in SVG with six petals of mottled glass, lead lines and small amber roundels. A noise filter gives the panes their antique texture, a soft sun moves behind them with the pointer, and a blurred copy of the window is projected onto the floor together with a beam in the selected color.

The two main colors fill the cobalt and ruby panes, and the rest keep their jewel tones. Petals behave as a radio group with arrow keys, so it can double as a theme or category picker for cultural sites, churches or games.

## Code

### HTML

```html
<div class="uvq11-rose" style="--sel:var(--c1)"><i class="bm" aria-hidden="true"></i><svg class="rw" viewBox="-50 -50 100 100"><defs><filter id="uvq11-rose-f" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence type="fractalNoise" baseFrequency=".16" numOctaves="2" seed="4" result="n"/><feColorMatrix in="n" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -.9 .72" result="w"/><feComposite in="w" in2="SourceGraphic" operator="in" result="m"/><feBlend in="m" in2="SourceGraphic" mode="screen"/></filter><radialGradient id="uvq11-rose-s"><stop offset="0" stop-color="#fffbe8"/><stop offset=".4" stop-color="#fff3c4" stop-opacity=".7"/><stop offset="1" stop-color="#fff3c4" stop-opacity="0"/></radialGradient></defs><circle r="48" fill="#141826"/><circle class="sun" cx="0" cy="-28" r="30" fill="url(#uvq11-rose-s)"/><g id="uvq11-rose-g" filter="url(#uvq11-rose-f)"><circle cx="16.5" cy="-28.6" r="5" fill="#e9b949" fill-opacity=".8"/><circle cx="33.0" cy="0.0" r="5" fill="#e9b949" fill-opacity=".8"/><circle cx="16.5" cy="28.6" r="5" fill="#e9b949" fill-opacity=".8"/><circle cx="-16.5" cy="28.6" r="5" fill="#e9b949" fill-opacity=".8"/><circle cx="-33.0" cy="0.0" r="5" fill="#e9b949" fill-opacity=".8"/><circle cx="-16.5" cy="-28.6" r="5" fill="#e9b949" fill-opacity=".8"/><g role="radiogroup" aria-label="Stained glass color"><path class="pt" role="radio" tabindex="0" aria-checked="true" aria-label="Cobalt" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(0)" style="fill:var(--c1)"/><path class="pt" role="radio" tabindex="-1" aria-checked="false" aria-label="Ruby" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(60)" style="fill:var(--c2)"/><path class="pt" role="radio" tabindex="-1" aria-checked="false" aria-label="Amber" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(120)" style="fill:#f59e0b"/><path class="pt" role="radio" tabindex="-1" aria-checked="false" aria-label="Emerald" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(180)" style="fill:#059669"/><path class="pt" role="radio" tabindex="-1" aria-checked="false" aria-label="Amethyst" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(240)" style="fill:#7c3aed"/><path class="pt" role="radio" tabindex="-1" aria-checked="false" aria-label="Turquoise" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(300)" style="fill:#06b6d4"/></g><circle r="8.5" fill="#e9b949"/></g><g class="ld"><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(0)"/><path d="M0 -12V-44" transform="rotate(0)"/><circle cx="16.5" cy="-28.6" r="5"/><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(60)"/><path d="M0 -12V-44" transform="rotate(60)"/><circle cx="33.0" cy="0.0" r="5"/><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(120)"/><path d="M0 -12V-44" transform="rotate(120)"/><circle cx="16.5" cy="28.6" r="5"/><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(180)"/><path d="M0 -12V-44" transform="rotate(180)"/><circle cx="-16.5" cy="28.6" r="5"/><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(240)"/><path d="M0 -12V-44" transform="rotate(240)"/><circle cx="-33.0" cy="0.0" r="5"/><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(300)"/><path d="M0 -12V-44" transform="rotate(300)"/><circle cx="-16.5" cy="-28.6" r="5"/><circle r="8.5"/><circle r="47.5" stroke-width="3"/></g></svg><div class="fl" aria-hidden="true"><svg class="pj" viewBox="-50 -50 100 100"><use href="#uvq11-rose-g"/></svg></div><p class="nm" aria-live="polite">Cobalt</p></div>
```

### CSS

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

.uvq11-rose {
  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;
  --sx: 0;
  background: radial-gradient(40% 50% at 50% 35%,rgba(255,225,170,.16),transparent 70%),repeating-linear-gradient(0deg,transparent 0 2.2em,rgba(0,0,0,.28) 2.2em 2.3em),repeating-linear-gradient(90deg,transparent 0 3.4em,rgba(0,0,0,.18) 3.4em 3.5em),linear-gradient(#4b4640,#2d2925);
}

.uvq11-rose .rw {
  position: absolute;
  left: 50%;
  top: .55em;
  width: 9.4em;
  height: 9.4em;
  margin-left: -4.7em;
  filter: drop-shadow(0 0 .25em rgba(0,0,0,.6));
}

.uvq11-rose .pt {
  fill-opacity: .62;
  cursor: pointer;
  outline: 0;
  transition: fill-opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-rose .pt:hover {
  fill-opacity: .8;
}

.uvq11-rose .pt[aria-checked=true] {
  fill-opacity: .97;
}

.uvq11-rose .ld {
  fill: none;
  stroke: #17130f;
  stroke-width: 1.8;
  stroke-linejoin: round;
  pointer-events: none;
}

.uvq11-rose .pt:focus-visible {
  stroke: #fff;
  stroke-width: 2.2;
}

.uvq11-rose .fl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.6em;
  overflow: hidden;
  background: linear-gradient(180deg,#5c544a,#7b7064);
  box-shadow: inset 0 .12em 0 rgba(0,0,0,.35);
}

.uvq11-rose .fl::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,transparent 0 3em,rgba(0,0,0,.15) 3em 3.08em);
}

.uvq11-rose .pj {
  position: absolute;
  left: 50%;
  top: -1.6em;
  width: 9em;
  height: 9em;
  margin-left: -4.5em;
  opacity: .8;
  mix-blend-mode: screen;
  filter: blur(3px) saturate(1.6);
  transform: translateX(calc(var(--sx) * -2.5em)) perspective(12em) rotateX(64deg) scale(1.15,.9);
}

.uvq11-rose .bm {
  position: absolute;
  left: 50%;
  top: 5em;
  width: 9em;
  height: 8em;
  margin-left: -4.5em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--sel) 30%,rgba(255,250,230,.25)),transparent 95%);
  clip-path: polygon(18% 0,82% 0,100% 100%,0 100%);
  mix-blend-mode: screen;
  opacity: .55;
  transform: skewX(calc(var(--sx) * 18deg));
  transform-origin: 50% 0;
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-rose .nm {
  position: absolute;
  right: .9em;
  bottom: .8em;
  margin: 0;
  padding: .35em .8em;
  border-radius: 2em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(20,18,15,.55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

.uvq11-rose .nm::before {
  content: "";
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-right: .45em;
  border-radius: 50%;
  background: var(--sel);
  vertical-align: -.05em;
}

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

### JavaScript

```js
document.querySelectorAll(".uvq11-rose").forEach(el => {
  const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;const sv=el.querySelector(".rw"),pts=[...el.querySelectorAll(".rw .pt")],sun=el.querySelector(".sun"),nm=el.querySelector(".nm");let i=0,sx=0,sy=-28,tx=0,ty=-28,raf=0,hov=false;
const step=()=>{sx+=(tx-sx)*.12;sy+=(ty-sy)*.12;sun.setAttribute("cx",sx.toFixed(2));sun.setAttribute("cy",sy.toFixed(2));el.style.setProperty("--sx",(sx/44).toFixed(3));raf=Math.abs(tx-sx)+Math.abs(ty-sy)>.05?requestAnimationFrame(step):0};
const go=()=>{if(rm){sx=tx;sy=ty;step();return}if(!raf)raf=requestAnimationFrame(step)};
const aim=()=>{const a=(i*60-90)*Math.PI/180;tx=28*Math.cos(a);ty=28*Math.sin(a);go()};
const sel=(k,f)=>{i=(k+pts.length)%pts.length;pts.forEach((p,j)=>{p.setAttribute("aria-checked",String(j===i));p.setAttribute("tabindex",j===i?"0":"-1")});nm.textContent=pts[i].getAttribute("aria-label");el.style.setProperty("--sel",pts[i].style.fill);if(f)pts[i].focus();if(!hov)aim()};
pts.forEach((p,j)=>{p.addEventListener("click",()=>sel(j,false));p.addEventListener("keydown",e=>{const d={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(d){e.preventDefault();sel(i+d,true)}else if(e.key===" "||e.key==="Enter"){e.preventDefault();sel(j,false)}})});
el.addEventListener("pointermove",e=>{const r=sv.getBoundingClientRect();let x=(e.clientX-r.left)/r.width*100-50,y=(e.clientY-r.top)/r.height*100-50;const d=Math.hypot(x,y);if(d>40){x*=40/d;y*=40/d}hov=true;tx=x;ty=y;go()});
el.addEventListener("pointerleave",()=>{hov=false;aim()});aim();
return()=>cancelAnimationFrame(raf)
});
```

### 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-rose {
  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;
  --sx: 0;
  background: radial-gradient(40% 50% at 50% 35%,rgba(255,225,170,.16),transparent 70%),repeating-linear-gradient(0deg,transparent 0 2.2em,rgba(0,0,0,.28) 2.2em 2.3em),repeating-linear-gradient(90deg,transparent 0 3.4em,rgba(0,0,0,.18) 3.4em 3.5em),linear-gradient(#4b4640,#2d2925);
}

.uvq11-rose .rw {
  position: absolute;
  left: 50%;
  top: .55em;
  width: 9.4em;
  height: 9.4em;
  margin-left: -4.7em;
  filter: drop-shadow(0 0 .25em rgba(0,0,0,.6));
}

.uvq11-rose .pt {
  fill-opacity: .62;
  cursor: pointer;
  outline: 0;
  transition: fill-opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-rose .pt:hover {
  fill-opacity: .8;
}

.uvq11-rose .pt[aria-checked=true] {
  fill-opacity: .97;
}

.uvq11-rose .ld {
  fill: none;
  stroke: #17130f;
  stroke-width: 1.8;
  stroke-linejoin: round;
  pointer-events: none;
}

.uvq11-rose .pt:focus-visible {
  stroke: #fff;
  stroke-width: 2.2;
}

.uvq11-rose .fl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.6em;
  overflow: hidden;
  background: linear-gradient(180deg,#5c544a,#7b7064);
  box-shadow: inset 0 .12em 0 rgba(0,0,0,.35);
}

.uvq11-rose .fl::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,transparent 0 3em,rgba(0,0,0,.15) 3em 3.08em);
}

.uvq11-rose .pj {
  position: absolute;
  left: 50%;
  top: -1.6em;
  width: 9em;
  height: 9em;
  margin-left: -4.5em;
  opacity: .8;
  mix-blend-mode: screen;
  filter: blur(3px) saturate(1.6);
  transform: translateX(calc(var(--sx) * -2.5em)) perspective(12em) rotateX(64deg) scale(1.15,.9);
}

.uvq11-rose .bm {
  position: absolute;
  left: 50%;
  top: 5em;
  width: 9em;
  height: 8em;
  margin-left: -4.5em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--sel) 30%,rgba(255,250,230,.25)),transparent 95%);
  clip-path: polygon(18% 0,82% 0,100% 100%,0 100%);
  mix-blend-mode: screen;
  opacity: .55;
  transform: skewX(calc(var(--sx) * 18deg));
  transform-origin: 50% 0;
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-rose .nm {
  position: absolute;
  right: .9em;
  bottom: .8em;
  margin: 0;
  padding: .35em .8em;
  border-radius: 2em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(20,18,15,.55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

.uvq11-rose .nm::before {
  content: "";
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-right: .45em;
  border-radius: 50%;
  background: var(--sel);
  vertical-align: -.05em;
}

@media (prefers-reduced-motion:reduce) {
  .uvq11-rose,.uvq11-rose *,.uvq11-rose *::before,.uvq11-rose *::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 sv=el.querySelector(".rw"),pts=[...el.querySelectorAll(".rw .pt")],sun=el.querySelector(".sun"),nm=el.querySelector(".nm");let i=0,sx=0,sy=-28,tx=0,ty=-28,raf=0,hov=false;
const step=()=>{sx+=(tx-sx)*.12;sy+=(ty-sy)*.12;sun.setAttribute("cx",sx.toFixed(2));sun.setAttribute("cy",sy.toFixed(2));el.style.setProperty("--sx",(sx/44).toFixed(3));raf=Math.abs(tx-sx)+Math.abs(ty-sy)>.05?requestAnimationFrame(step):0};
const go=()=>{if(rm){sx=tx;sy=ty;step();return}if(!raf)raf=requestAnimationFrame(step)};
const aim=()=>{const a=(i*60-90)*Math.PI/180;tx=28*Math.cos(a);ty=28*Math.sin(a);go()};
const sel=(k,f)=>{i=(k+pts.length)%pts.length;pts.forEach((p,j)=>{p.setAttribute("aria-checked",String(j===i));p.setAttribute("tabindex",j===i?"0":"-1")});nm.textContent=pts[i].getAttribute("aria-label");el.style.setProperty("--sel",pts[i].style.fill);if(f)pts[i].focus();if(!hov)aim()};
pts.forEach((p,j)=>{p.addEventListener("click",()=>sel(j,false));p.addEventListener("keydown",e=>{const d={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(d){e.preventDefault();sel(i+d,true)}else if(e.key===" "||e.key==="Enter"){e.preventDefault();sel(j,false)}})});
el.addEventListener("pointermove",e=>{const r=sv.getBoundingClientRect();let x=(e.clientX-r.left)/r.width*100-50,y=(e.clientY-r.top)/r.height*100-50;const d=Math.hypot(x,y);if(d>40){x*=40/d;y*=40/d}hov=true;tx=x;ty=y;go()});
el.addEventListener("pointerleave",()=>{hov=false;aim()});aim();
return()=>cancelAnimationFrame(raf)
}

export default function LgStainedRose() {
  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": "#1d4ed8",
          "--c2": "#dc2626",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq11-rose" style={{ "--sel": "var(--c1)" } as CSSProperties}><i className="bm" aria-hidden="true"></i><svg className="rw" viewBox="-50 -50 100 100"><defs><filter id="uvq11-rose-f" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence type="fractalNoise" baseFrequency=".16" numOctaves="2" seed="4" result="n" /><feColorMatrix in="n" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -.9 .72" result="w" /><feComposite in="w" in2="SourceGraphic" operator="in" result="m" /><feBlend in="m" in2="SourceGraphic" mode="screen" /></filter><radialGradient id="uvq11-rose-s"><stop offset="0" stopColor="#fffbe8" /><stop offset=".4" stopColor="#fff3c4" stopOpacity=".7" /><stop offset="1" stopColor="#fff3c4" stopOpacity="0" /></radialGradient></defs><circle r="48" fill="#141826" /><circle className="sun" cx="0" cy="-28" r="30" fill="url(#uvq11-rose-s)" /><g id="uvq11-rose-g" filter="url(#uvq11-rose-f)"><circle cx="16.5" cy="-28.6" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="33.0" cy="0.0" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="16.5" cy="28.6" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="-16.5" cy="28.6" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="-33.0" cy="0.0" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="-16.5" cy="-28.6" r="5" fill="#e9b949" fillOpacity=".8" /><g role="radiogroup" aria-label="Stained glass color"><path className="pt" role="radio" tabIndex={0} aria-checked="true" aria-label="Cobalt" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(0)" style={{ fill: "var(--c1)" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Ruby" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(60)" style={{ fill: "var(--c2)" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Amber" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(120)" style={{ fill: "#f59e0b" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Emerald" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(180)" style={{ fill: "#059669" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Amethyst" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(240)" style={{ fill: "#7c3aed" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Turquoise" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(300)" style={{ fill: "#06b6d4" }} /></g><circle r="8.5" fill="#e9b949" /></g><g className="ld"><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(0)" /><path d="M0 -12V-44" transform="rotate(0)" /><circle cx="16.5" cy="-28.6" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(60)" /><path d="M0 -12V-44" transform="rotate(60)" /><circle cx="33.0" cy="0.0" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(120)" /><path d="M0 -12V-44" transform="rotate(120)" /><circle cx="16.5" cy="28.6" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(180)" /><path d="M0 -12V-44" transform="rotate(180)" /><circle cx="-16.5" cy="28.6" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(240)" /><path d="M0 -12V-44" transform="rotate(240)" /><circle cx="-33.0" cy="0.0" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(300)" /><path d="M0 -12V-44" transform="rotate(300)" /><circle cx="-16.5" cy="-28.6" r="5" /><circle r="8.5" /><circle r="47.5" strokeWidth="3" /></g></svg><div className="fl" aria-hidden="true"><svg className="pj" viewBox="-50 -50 100 100"><use href="#uvq11-rose-g" /></svg></div><p className="nm" aria-live="polite">Cobalt</p></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 “Stained glass rose window” block (Liquid Glass) from AIMRAN Library to my project.

## What it is
A leaded glass rose window: the sun follows the cursor and the petal you choose casts its color on the stone floor.

## Chosen settings
- Main color: #1d4ed8
- Secondary color: #dc2626
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)

## 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-rose {
  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;
  --sx: 0;
  background: radial-gradient(40% 50% at 50% 35%,rgba(255,225,170,.16),transparent 70%),repeating-linear-gradient(0deg,transparent 0 2.2em,rgba(0,0,0,.28) 2.2em 2.3em),repeating-linear-gradient(90deg,transparent 0 3.4em,rgba(0,0,0,.18) 3.4em 3.5em),linear-gradient(#4b4640,#2d2925);
}

.uvq11-rose .rw {
  position: absolute;
  left: 50%;
  top: .55em;
  width: 9.4em;
  height: 9.4em;
  margin-left: -4.7em;
  filter: drop-shadow(0 0 .25em rgba(0,0,0,.6));
}

.uvq11-rose .pt {
  fill-opacity: .62;
  cursor: pointer;
  outline: 0;
  transition: fill-opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-rose .pt:hover {
  fill-opacity: .8;
}

.uvq11-rose .pt[aria-checked=true] {
  fill-opacity: .97;
}

.uvq11-rose .ld {
  fill: none;
  stroke: #17130f;
  stroke-width: 1.8;
  stroke-linejoin: round;
  pointer-events: none;
}

.uvq11-rose .pt:focus-visible {
  stroke: #fff;
  stroke-width: 2.2;
}

.uvq11-rose .fl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.6em;
  overflow: hidden;
  background: linear-gradient(180deg,#5c544a,#7b7064);
  box-shadow: inset 0 .12em 0 rgba(0,0,0,.35);
}

.uvq11-rose .fl::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,transparent 0 3em,rgba(0,0,0,.15) 3em 3.08em);
}

.uvq11-rose .pj {
  position: absolute;
  left: 50%;
  top: -1.6em;
  width: 9em;
  height: 9em;
  margin-left: -4.5em;
  opacity: .8;
  mix-blend-mode: screen;
  filter: blur(3px) saturate(1.6);
  transform: translateX(calc(var(--sx) * -2.5em)) perspective(12em) rotateX(64deg) scale(1.15,.9);
}

.uvq11-rose .bm {
  position: absolute;
  left: 50%;
  top: 5em;
  width: 9em;
  height: 8em;
  margin-left: -4.5em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--sel) 30%,rgba(255,250,230,.25)),transparent 95%);
  clip-path: polygon(18% 0,82% 0,100% 100%,0 100%);
  mix-blend-mode: screen;
  opacity: .55;
  transform: skewX(calc(var(--sx) * 18deg));
  transform-origin: 50% 0;
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-rose .nm {
  position: absolute;
  right: .9em;
  bottom: .8em;
  margin: 0;
  padding: .35em .8em;
  border-radius: 2em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(20,18,15,.55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

.uvq11-rose .nm::before {
  content: "";
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-right: .45em;
  border-radius: 50%;
  background: var(--sel);
  vertical-align: -.05em;
}

@media (prefers-reduced-motion:reduce) {
  .uvq11-rose,.uvq11-rose *,.uvq11-rose *::before,.uvq11-rose *::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 sv=el.querySelector(".rw"),pts=[...el.querySelectorAll(".rw .pt")],sun=el.querySelector(".sun"),nm=el.querySelector(".nm");let i=0,sx=0,sy=-28,tx=0,ty=-28,raf=0,hov=false;
const step=()=>{sx+=(tx-sx)*.12;sy+=(ty-sy)*.12;sun.setAttribute("cx",sx.toFixed(2));sun.setAttribute("cy",sy.toFixed(2));el.style.setProperty("--sx",(sx/44).toFixed(3));raf=Math.abs(tx-sx)+Math.abs(ty-sy)>.05?requestAnimationFrame(step):0};
const go=()=>{if(rm){sx=tx;sy=ty;step();return}if(!raf)raf=requestAnimationFrame(step)};
const aim=()=>{const a=(i*60-90)*Math.PI/180;tx=28*Math.cos(a);ty=28*Math.sin(a);go()};
const sel=(k,f)=>{i=(k+pts.length)%pts.length;pts.forEach((p,j)=>{p.setAttribute("aria-checked",String(j===i));p.setAttribute("tabindex",j===i?"0":"-1")});nm.textContent=pts[i].getAttribute("aria-label");el.style.setProperty("--sel",pts[i].style.fill);if(f)pts[i].focus();if(!hov)aim()};
pts.forEach((p,j)=>{p.addEventListener("click",()=>sel(j,false));p.addEventListener("keydown",e=>{const d={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(d){e.preventDefault();sel(i+d,true)}else if(e.key===" "||e.key==="Enter"){e.preventDefault();sel(j,false)}})});
el.addEventListener("pointermove",e=>{const r=sv.getBoundingClientRect();let x=(e.clientX-r.left)/r.width*100-50,y=(e.clientY-r.top)/r.height*100-50;const d=Math.hypot(x,y);if(d>40){x*=40/d;y*=40/d}hov=true;tx=x;ty=y;go()});
el.addEventListener("pointerleave",()=>{hov=false;aim()});aim();
return()=>cancelAnimationFrame(raf)
}

export default function LgStainedRose() {
  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": "#1d4ed8",
          "--c2": "#dc2626",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq11-rose" style={{ "--sel": "var(--c1)" } as CSSProperties}><i className="bm" aria-hidden="true"></i><svg className="rw" viewBox="-50 -50 100 100"><defs><filter id="uvq11-rose-f" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence type="fractalNoise" baseFrequency=".16" numOctaves="2" seed="4" result="n" /><feColorMatrix in="n" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -.9 .72" result="w" /><feComposite in="w" in2="SourceGraphic" operator="in" result="m" /><feBlend in="m" in2="SourceGraphic" mode="screen" /></filter><radialGradient id="uvq11-rose-s"><stop offset="0" stopColor="#fffbe8" /><stop offset=".4" stopColor="#fff3c4" stopOpacity=".7" /><stop offset="1" stopColor="#fff3c4" stopOpacity="0" /></radialGradient></defs><circle r="48" fill="#141826" /><circle className="sun" cx="0" cy="-28" r="30" fill="url(#uvq11-rose-s)" /><g id="uvq11-rose-g" filter="url(#uvq11-rose-f)"><circle cx="16.5" cy="-28.6" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="33.0" cy="0.0" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="16.5" cy="28.6" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="-16.5" cy="28.6" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="-33.0" cy="0.0" r="5" fill="#e9b949" fillOpacity=".8" /><circle cx="-16.5" cy="-28.6" r="5" fill="#e9b949" fillOpacity=".8" /><g role="radiogroup" aria-label="Stained glass color"><path className="pt" role="radio" tabIndex={0} aria-checked="true" aria-label="Cobalt" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(0)" style={{ fill: "var(--c1)" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Ruby" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(60)" style={{ fill: "var(--c2)" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Amber" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(120)" style={{ fill: "#f59e0b" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Emerald" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(180)" style={{ fill: "#059669" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Amethyst" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(240)" style={{ fill: "#7c3aed" }} /><path className="pt" role="radio" tabIndex={-1} aria-checked="false" aria-label="Turquoise" d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(300)" style={{ fill: "#06b6d4" }} /></g><circle r="8.5" fill="#e9b949" /></g><g className="ld"><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(0)" /><path d="M0 -12V-44" transform="rotate(0)" /><circle cx="16.5" cy="-28.6" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(60)" /><path d="M0 -12V-44" transform="rotate(60)" /><circle cx="33.0" cy="0.0" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(120)" /><path d="M0 -12V-44" transform="rotate(120)" /><circle cx="16.5" cy="28.6" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(180)" /><path d="M0 -12V-44" transform="rotate(180)" /><circle cx="-16.5" cy="28.6" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(240)" /><path d="M0 -12V-44" transform="rotate(240)" /><circle cx="-33.0" cy="0.0" r="5" /><path d="M0 -10C13 -16 15 -36 0 -46C-15 -36 -13 -16 0 -10Z" transform="rotate(300)" /><path d="M0 -12V-44" transform="rotate(300)" /><circle cx="-16.5" cy="-28.6" r="5" /><circle r="8.5" /><circle r="47.5" strokeWidth="3" /></g></svg><div className="fl" aria-hidden="true"><svg className="pj" viewBox="-50 -50 100 100"><use href="#uvq11-rose-g" /></svg></div><p className="nm" aria-live="polite">Cobalt</p></div>
      </div>
    </>
  );
}
```

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