# Blueprint element inspector

> An inspect mode that covers the page with a blueprint grid and marks margin, padding and size of whatever you point at.

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

## Where to use it

Browser devtools draw boxes over elements, and this overlay turns that into a design piece. Switching it on lays a blueprint grid and rulers over the page, and pointing at an element slides orange hatched margins, green padding and a blue content box to it, plus a tag with its name and size. The rulers highlight its extent. It fits design system docs, tutorials and developer portfolios.

The main color is the blueprint and the second one the margins. Add data-ins to any element you want to inspect, move through them with the arrow keys and leave the mode with Escape or the same button.

## Code

### HTML

```html
<div class="uvq13-bp"><button type="button" class="fire" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="7"/><path d="M12 2.5v5M12 16.5v5M2.5 12h5M16.5 12h5"/></svg><span>Inspect</span></button><div class="cd" data-ins><span class="av" data-ins aria-hidden="true">MR</span><h4 data-ins>Marta Ruiz</h4><p data-ins>Product designer in Lisbon</p><button type="button" class="fw" data-ins>Follow</button></div><div class="bp" aria-hidden="true"><i class="rx"><b class="hx"></b></i><i class="ry"><b class="hy"></b></i><i class="mb"></i><i class="pb"></i><i class="cb"></i><span class="lbl"><b></b> <span></span></span></div><p class="hn">Hover or use the arrow keys</p></div>
```

### CSS

```css
.uvq13-bp {
  --c1: #2563eb;
  --c2: #f97316;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq13-bp {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-bp .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 1em;
  top: 1em;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: .4em;
  padding: .5em .9em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp .fire:active {
  transform: scale(.96);
}

.uvq13-bp .fire svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq13-bp .fire[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
}

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

.uvq13-bp .cd {
  position: absolute;
  left: 4em;
  right: 4em;
  top: 3.6em;
  padding: 1em 1.2em 1.1em;
  border-radius: 1em;
  text-align: center;
  background: var(--bg);
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 .8em 1.6em -1em rgba(0,0,0,.3);
}

.uvq13-bp .av {
  display: grid;
  place-items: center;
  width: 2.6em;
  height: 2.6em;
  margin: 0 auto .5em;
  border-radius: 50%;
  font-size: .95em;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg,#f472b6,#f59e0b);
}

.uvq13-bp h4 {
  margin: 0 0 .15em;
  font-size: 1em;
}

.uvq13-bp .cd p {
  margin: 0 0 .8em;
  font-size: .75em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-bp .fw {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .55em 1.3em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
}

.uvq13-bp .bp {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(color-mix(in srgb,var(--c1) 16%,transparent) 1px,transparent 1px) 0 0/1em 1em,linear-gradient(90deg,color-mix(in srgb,var(--c1) 16%,transparent) 1px,transparent 1px) 0 0/1em 1em,color-mix(in srgb,var(--c1) 7%,transparent);
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp.open .bp {
  opacity: 1;
}

.uvq13-bp .bp i,.uvq13-bp .lbl {
  position: absolute;
  display: block;
  transition: left calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),top calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),width calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),height calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .rx {
  left: 0;
  right: 0;
  top: 0;
  height: .7em;
  background: repeating-linear-gradient(90deg,color-mix(in srgb,var(--c1) 60%,transparent) 0 1px,transparent 1px .5em) 0 100%/100% 50% no-repeat,repeating-linear-gradient(90deg,var(--c1) 0 1px,transparent 1px 2.5em) 0 0/100% 100% no-repeat;
  border-bottom: 1px solid var(--c1);
}

.uvq13-bp .ry {
  left: 0;
  top: 0;
  bottom: 0;
  width: .7em;
  background: repeating-linear-gradient(180deg,color-mix(in srgb,var(--c1) 60%,transparent) 0 1px,transparent 1px .5em) 100% 0/50% 100% no-repeat,repeating-linear-gradient(180deg,var(--c1) 0 1px,transparent 1px 2.5em) 0 0/100% 100% no-repeat;
  border-right: 1px solid var(--c1);
}

.uvq13-bp .hx,.uvq13-bp .hy {
  position: absolute;
  display: block;
  background: color-mix(in srgb,var(--c2) 55%,transparent);
  transition: inherit;
}

.uvq13-bp .hx {
  top: 0;
  bottom: 0;
  transition: left calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),width calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .hy {
  left: 0;
  right: 0;
  transition: top calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),height calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .mb {
  background: repeating-linear-gradient(45deg,color-mix(in srgb,var(--c2) 45%,transparent) 0 2px,transparent 2px 5px);
  outline: 1px dashed var(--c2);
}

.uvq13-bp .pb {
  background: repeating-linear-gradient(-45deg,rgba(34,197,94,.42) 0 2px,transparent 2px 5px);
}

.uvq13-bp .cb {
  background: color-mix(in srgb,var(--c1) 26%,transparent);
  outline: 1px solid var(--c1);
}

.uvq13-bp .lbl {
  z-index: 2;
  padding: .3em .5em;
  border-radius: .3em;
  font: 600 .62em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  white-space: nowrap;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .2em .5em rgba(0,0,0,.25);
}

.uvq13-bp .lbl b {
  color: #fde68a;
}

.uvq13-bp .hn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .9em;
  z-index: 5;
  margin: 0;
  text-align: center;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  opacity: 0;
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp.open .hn {
  opacity: 1;
}

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

### JavaScript

```js
document.querySelectorAll(".uvq13-bp").forEach(el => {
  const fire=el.querySelector(".fire"),[mb,pb,cb,lbl,hx,hy]=[".mb",".pb",".cb",".lbl",".hx",".hy"].map(s=>el.querySelector(s)),ns=[...el.querySelectorAll("[data-ins]")];let k=-1,tms=[];
const px=v=>parseFloat(v)||0;const isO=()=>el.classList.contains("open");
const box=(n,x,y,w,h)=>{n.style.left=x+"px";n.style.top=y+"px";n.style.width=Math.max(0,w)+"px";n.style.height=Math.max(0,h)+"px"};
const show=i=>{k=(i+ns.length)%ns.length;const n=ns[k],s=el.getBoundingClientRect().width/el.offsetWidth||1,R=el.getBoundingClientRect(),r=n.getBoundingClientRect(),c=getComputedStyle(n),x=(r.left-R.left)/s,y=(r.top-R.top)/s,w=r.width/s,h=r.height/s;const m=[c.marginTop,c.marginRight,c.marginBottom,c.marginLeft].map(px),p=[c.paddingTop,c.paddingRight,c.paddingBottom,c.paddingLeft].map(px);
box(mb,x-m[3],y-m[0],w+m[1]+m[3],h+m[0]+m[2]);box(pb,x,y,w,h);box(cb,x+p[3],y+p[0],w-p[1]-p[3],h-p[0]-p[2]);
lbl.querySelector("b").textContent=n.tagName.toLowerCase()+(n.classList[0]?"."+n.classList[0]:"");lbl.querySelector("span").textContent=Math.round(w)+" × "+Math.round(h);
const lw=lbl.offsetWidth,ly=y-m[0]-24>12?y-m[0]-24:y+h+m[2]+6;lbl.style.left=Math.max(14,Math.min(el.clientWidth-lw-6,x))+"px";lbl.style.top=ly+"px";
hx.style.left=x+"px";hx.style.width=w+"px";hy.style.top=y+"px";hy.style.height=h+"px"};
const set=o=>{el.classList.toggle("open",o);fire.setAttribute("aria-pressed",String(o));if(o)show(k<0?0:k)};
fire.addEventListener("click",()=>set(!isO()));
el.addEventListener("pointermove",e=>{if(!isO())return;const n=e.target.closest&&e.target.closest("[data-ins]");if(n){const i=ns.indexOf(n);if(i!==k)show(i)}});
el.addEventListener("keydown",e=>{if(!isO())return;const m={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1}[e.key];if(m){e.preventDefault();show(k+m)}else if(e.key==="Escape"){e.preventDefault();set(false);fire.focus({preventScroll:true})}});
const ro=new ResizeObserver(()=>{if(isO())show(k)});ro.observe(el);
tms.push(setTimeout(()=>{set(true);show(2)},600));return()=>{ro.disconnect();tms.forEach(clearTimeout)}
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq13-bp {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-bp .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 1em;
  top: 1em;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: .4em;
  padding: .5em .9em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp .fire:active {
  transform: scale(.96);
}

.uvq13-bp .fire svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq13-bp .fire[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
}

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

.uvq13-bp .cd {
  position: absolute;
  left: 4em;
  right: 4em;
  top: 3.6em;
  padding: 1em 1.2em 1.1em;
  border-radius: 1em;
  text-align: center;
  background: var(--bg);
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 .8em 1.6em -1em rgba(0,0,0,.3);
}

.uvq13-bp .av {
  display: grid;
  place-items: center;
  width: 2.6em;
  height: 2.6em;
  margin: 0 auto .5em;
  border-radius: 50%;
  font-size: .95em;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg,#f472b6,#f59e0b);
}

.uvq13-bp h4 {
  margin: 0 0 .15em;
  font-size: 1em;
}

.uvq13-bp .cd p {
  margin: 0 0 .8em;
  font-size: .75em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-bp .fw {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .55em 1.3em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
}

.uvq13-bp .bp {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(color-mix(in srgb,var(--c1) 16%,transparent) 1px,transparent 1px) 0 0/1em 1em,linear-gradient(90deg,color-mix(in srgb,var(--c1) 16%,transparent) 1px,transparent 1px) 0 0/1em 1em,color-mix(in srgb,var(--c1) 7%,transparent);
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp.open .bp {
  opacity: 1;
}

.uvq13-bp .bp i,.uvq13-bp .lbl {
  position: absolute;
  display: block;
  transition: left calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),top calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),width calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),height calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .rx {
  left: 0;
  right: 0;
  top: 0;
  height: .7em;
  background: repeating-linear-gradient(90deg,color-mix(in srgb,var(--c1) 60%,transparent) 0 1px,transparent 1px .5em) 0 100%/100% 50% no-repeat,repeating-linear-gradient(90deg,var(--c1) 0 1px,transparent 1px 2.5em) 0 0/100% 100% no-repeat;
  border-bottom: 1px solid var(--c1);
}

.uvq13-bp .ry {
  left: 0;
  top: 0;
  bottom: 0;
  width: .7em;
  background: repeating-linear-gradient(180deg,color-mix(in srgb,var(--c1) 60%,transparent) 0 1px,transparent 1px .5em) 100% 0/50% 100% no-repeat,repeating-linear-gradient(180deg,var(--c1) 0 1px,transparent 1px 2.5em) 0 0/100% 100% no-repeat;
  border-right: 1px solid var(--c1);
}

.uvq13-bp .hx,.uvq13-bp .hy {
  position: absolute;
  display: block;
  background: color-mix(in srgb,var(--c2) 55%,transparent);
  transition: inherit;
}

.uvq13-bp .hx {
  top: 0;
  bottom: 0;
  transition: left calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),width calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .hy {
  left: 0;
  right: 0;
  transition: top calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),height calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .mb {
  background: repeating-linear-gradient(45deg,color-mix(in srgb,var(--c2) 45%,transparent) 0 2px,transparent 2px 5px);
  outline: 1px dashed var(--c2);
}

.uvq13-bp .pb {
  background: repeating-linear-gradient(-45deg,rgba(34,197,94,.42) 0 2px,transparent 2px 5px);
}

.uvq13-bp .cb {
  background: color-mix(in srgb,var(--c1) 26%,transparent);
  outline: 1px solid var(--c1);
}

.uvq13-bp .lbl {
  z-index: 2;
  padding: .3em .5em;
  border-radius: .3em;
  font: 600 .62em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  white-space: nowrap;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .2em .5em rgba(0,0,0,.25);
}

.uvq13-bp .lbl b {
  color: #fde68a;
}

.uvq13-bp .hn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .9em;
  z-index: 5;
  margin: 0;
  text-align: center;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  opacity: 0;
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp.open .hn {
  opacity: 1;
}

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

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const fire=el.querySelector(".fire"),[mb,pb,cb,lbl,hx,hy]=[".mb",".pb",".cb",".lbl",".hx",".hy"].map(s=>el.querySelector(s)),ns=[...el.querySelectorAll("[data-ins]")];let k=-1,tms=[];
const px=v=>parseFloat(v)||0;const isO=()=>el.classList.contains("open");
const box=(n,x,y,w,h)=>{n.style.left=x+"px";n.style.top=y+"px";n.style.width=Math.max(0,w)+"px";n.style.height=Math.max(0,h)+"px"};
const show=i=>{k=(i+ns.length)%ns.length;const n=ns[k],s=el.getBoundingClientRect().width/el.offsetWidth||1,R=el.getBoundingClientRect(),r=n.getBoundingClientRect(),c=getComputedStyle(n),x=(r.left-R.left)/s,y=(r.top-R.top)/s,w=r.width/s,h=r.height/s;const m=[c.marginTop,c.marginRight,c.marginBottom,c.marginLeft].map(px),p=[c.paddingTop,c.paddingRight,c.paddingBottom,c.paddingLeft].map(px);
box(mb,x-m[3],y-m[0],w+m[1]+m[3],h+m[0]+m[2]);box(pb,x,y,w,h);box(cb,x+p[3],y+p[0],w-p[1]-p[3],h-p[0]-p[2]);
lbl.querySelector("b").textContent=n.tagName.toLowerCase()+(n.classList[0]?"."+n.classList[0]:"");lbl.querySelector("span").textContent=Math.round(w)+" × "+Math.round(h);
const lw=lbl.offsetWidth,ly=y-m[0]-24>12?y-m[0]-24:y+h+m[2]+6;lbl.style.left=Math.max(14,Math.min(el.clientWidth-lw-6,x))+"px";lbl.style.top=ly+"px";
hx.style.left=x+"px";hx.style.width=w+"px";hy.style.top=y+"px";hy.style.height=h+"px"};
const set=o=>{el.classList.toggle("open",o);fire.setAttribute("aria-pressed",String(o));if(o)show(k<0?0:k)};
fire.addEventListener("click",()=>set(!isO()));
el.addEventListener("pointermove",e=>{if(!isO())return;const n=e.target.closest&&e.target.closest("[data-ins]");if(n){const i=ns.indexOf(n);if(i!==k)show(i)}});
el.addEventListener("keydown",e=>{if(!isO())return;const m={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1}[e.key];if(m){e.preventDefault();show(k+m)}else if(e.key==="Escape"){e.preventDefault();set(false);fire.focus({preventScroll:true})}});
const ro=new ResizeObserver(()=>{if(isO())show(k)});ro.observe(el);
tms.push(setTimeout(()=>{set(true);show(2)},600));return()=>{ro.disconnect();tms.forEach(clearTimeout)}
}

export default function OvBlueprintInspector() {
  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": "#2563eb",
          "--c2": "#f97316",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq13-bp"><button type="button" className="fire" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="7" /><path d="M12 2.5v5M12 16.5v5M2.5 12h5M16.5 12h5" /></svg><span>Inspect</span></button><div className="cd" data-ins={true}><span className="av" data-ins={true} aria-hidden="true">MR</span><h4 data-ins={true}>Marta Ruiz</h4><p data-ins={true}>Product designer in Lisbon</p><button type="button" className="fw" data-ins={true}>Follow</button></div><div className="bp" aria-hidden="true"><i className="rx"><b className="hx"></b></i><i className="ry"><b className="hy"></b></i><i className="mb"></i><i className="pb"></i><i className="cb"></i><span className="lbl"><b></b> <span></span></span></div><p className="hn">Hover or use the arrow keys</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 “Blueprint element inspector” block (Overlays) from AIMRAN Library to my project.

## What it is
An inspect mode that covers the page with a blueprint grid and marks margin, padding and size of whatever you point at.

## Chosen settings
- Main color: #2563eb
- Secondary color: #f97316
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Inspeccionar"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq13-bp {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  width: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-bp .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 1em;
  top: 1em;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: .4em;
  padding: .5em .9em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp .fire:active {
  transform: scale(.96);
}

.uvq13-bp .fire svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq13-bp .fire[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
}

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

.uvq13-bp .cd {
  position: absolute;
  left: 4em;
  right: 4em;
  top: 3.6em;
  padding: 1em 1.2em 1.1em;
  border-radius: 1em;
  text-align: center;
  background: var(--bg);
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent),0 .8em 1.6em -1em rgba(0,0,0,.3);
}

.uvq13-bp .av {
  display: grid;
  place-items: center;
  width: 2.6em;
  height: 2.6em;
  margin: 0 auto .5em;
  border-radius: 50%;
  font-size: .95em;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg,#f472b6,#f59e0b);
}

.uvq13-bp h4 {
  margin: 0 0 .15em;
  font-size: 1em;
}

.uvq13-bp .cd p {
  margin: 0 0 .8em;
  font-size: .75em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-bp .fw {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .55em 1.3em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
}

.uvq13-bp .bp {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(color-mix(in srgb,var(--c1) 16%,transparent) 1px,transparent 1px) 0 0/1em 1em,linear-gradient(90deg,color-mix(in srgb,var(--c1) 16%,transparent) 1px,transparent 1px) 0 0/1em 1em,color-mix(in srgb,var(--c1) 7%,transparent);
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp.open .bp {
  opacity: 1;
}

.uvq13-bp .bp i,.uvq13-bp .lbl {
  position: absolute;
  display: block;
  transition: left calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),top calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),width calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),height calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .rx {
  left: 0;
  right: 0;
  top: 0;
  height: .7em;
  background: repeating-linear-gradient(90deg,color-mix(in srgb,var(--c1) 60%,transparent) 0 1px,transparent 1px .5em) 0 100%/100% 50% no-repeat,repeating-linear-gradient(90deg,var(--c1) 0 1px,transparent 1px 2.5em) 0 0/100% 100% no-repeat;
  border-bottom: 1px solid var(--c1);
}

.uvq13-bp .ry {
  left: 0;
  top: 0;
  bottom: 0;
  width: .7em;
  background: repeating-linear-gradient(180deg,color-mix(in srgb,var(--c1) 60%,transparent) 0 1px,transparent 1px .5em) 100% 0/50% 100% no-repeat,repeating-linear-gradient(180deg,var(--c1) 0 1px,transparent 1px 2.5em) 0 0/100% 100% no-repeat;
  border-right: 1px solid var(--c1);
}

.uvq13-bp .hx,.uvq13-bp .hy {
  position: absolute;
  display: block;
  background: color-mix(in srgb,var(--c2) 55%,transparent);
  transition: inherit;
}

.uvq13-bp .hx {
  top: 0;
  bottom: 0;
  transition: left calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),width calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .hy {
  left: 0;
  right: 0;
  transition: top calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1),height calc(0.22s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq13-bp .mb {
  background: repeating-linear-gradient(45deg,color-mix(in srgb,var(--c2) 45%,transparent) 0 2px,transparent 2px 5px);
  outline: 1px dashed var(--c2);
}

.uvq13-bp .pb {
  background: repeating-linear-gradient(-45deg,rgba(34,197,94,.42) 0 2px,transparent 2px 5px);
}

.uvq13-bp .cb {
  background: color-mix(in srgb,var(--c1) 26%,transparent);
  outline: 1px solid var(--c1);
}

.uvq13-bp .lbl {
  z-index: 2;
  padding: .3em .5em;
  border-radius: .3em;
  font: 600 .62em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  white-space: nowrap;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .2em .5em rgba(0,0,0,.25);
}

.uvq13-bp .lbl b {
  color: #fde68a;
}

.uvq13-bp .hn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .9em;
  z-index: 5;
  margin: 0;
  text-align: center;
  font-size: .72em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  opacity: 0;
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-bp.open .hn {
  opacity: 1;
}

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

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const fire=el.querySelector(".fire"),[mb,pb,cb,lbl,hx,hy]=[".mb",".pb",".cb",".lbl",".hx",".hy"].map(s=>el.querySelector(s)),ns=[...el.querySelectorAll("[data-ins]")];let k=-1,tms=[];
const px=v=>parseFloat(v)||0;const isO=()=>el.classList.contains("open");
const box=(n,x,y,w,h)=>{n.style.left=x+"px";n.style.top=y+"px";n.style.width=Math.max(0,w)+"px";n.style.height=Math.max(0,h)+"px"};
const show=i=>{k=(i+ns.length)%ns.length;const n=ns[k],s=el.getBoundingClientRect().width/el.offsetWidth||1,R=el.getBoundingClientRect(),r=n.getBoundingClientRect(),c=getComputedStyle(n),x=(r.left-R.left)/s,y=(r.top-R.top)/s,w=r.width/s,h=r.height/s;const m=[c.marginTop,c.marginRight,c.marginBottom,c.marginLeft].map(px),p=[c.paddingTop,c.paddingRight,c.paddingBottom,c.paddingLeft].map(px);
box(mb,x-m[3],y-m[0],w+m[1]+m[3],h+m[0]+m[2]);box(pb,x,y,w,h);box(cb,x+p[3],y+p[0],w-p[1]-p[3],h-p[0]-p[2]);
lbl.querySelector("b").textContent=n.tagName.toLowerCase()+(n.classList[0]?"."+n.classList[0]:"");lbl.querySelector("span").textContent=Math.round(w)+" × "+Math.round(h);
const lw=lbl.offsetWidth,ly=y-m[0]-24>12?y-m[0]-24:y+h+m[2]+6;lbl.style.left=Math.max(14,Math.min(el.clientWidth-lw-6,x))+"px";lbl.style.top=ly+"px";
hx.style.left=x+"px";hx.style.width=w+"px";hy.style.top=y+"px";hy.style.height=h+"px"};
const set=o=>{el.classList.toggle("open",o);fire.setAttribute("aria-pressed",String(o));if(o)show(k<0?0:k)};
fire.addEventListener("click",()=>set(!isO()));
el.addEventListener("pointermove",e=>{if(!isO())return;const n=e.target.closest&&e.target.closest("[data-ins]");if(n){const i=ns.indexOf(n);if(i!==k)show(i)}});
el.addEventListener("keydown",e=>{if(!isO())return;const m={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1}[e.key];if(m){e.preventDefault();show(k+m)}else if(e.key==="Escape"){e.preventDefault();set(false);fire.focus({preventScroll:true})}});
const ro=new ResizeObserver(()=>{if(isO())show(k)});ro.observe(el);
tms.push(setTimeout(()=>{set(true);show(2)},600));return()=>{ro.disconnect();tms.forEach(clearTimeout)}
}

export default function OvBlueprintInspector() {
  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": "#2563eb",
          "--c2": "#f97316",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq13-bp"><button type="button" className="fire" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="7" /><path d="M12 2.5v5M12 16.5v5M2.5 12h5M16.5 12h5" /></svg><span>Inspect</span></button><div className="cd" data-ins={true}><span className="av" data-ins={true} aria-hidden="true">MR</span><h4 data-ins={true}>Marta Ruiz</h4><p data-ins={true}>Product designer in Lisbon</p><button type="button" className="fw" data-ins={true}>Follow</button></div><div className="bp" aria-hidden="true"><i className="rx"><b className="hx"></b></i><i className="ry"><b className="hy"></b></i><i className="mb"></i><i className="pb"></i><i className="cb"></i><span className="lbl"><b></b> <span></span></span></div><p className="hn">Hover or use the arrow keys</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.
````
