Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mzbb6zeFTjT6Rp8b92AVkA
9 lines
643 B
JavaScript
9 lines
643 B
JavaScript
// Prints the boxes of the elements named in window.FEBE_MISURE (CSS selectors), for checking a layout against a mockup.
|
|
await new Promise((r) => setTimeout(r, 300));
|
|
const selectors = (window.FEBE_MISURE || new URLSearchParams(location.hash.slice(1)).get('m') || '.testa-blocco .destra').split('|');
|
|
return selectors.map((s) => [...document.querySelectorAll(s)].slice(0, 4).map((el) => {
|
|
const r = el.getBoundingClientRect();
|
|
const cs = getComputedStyle(el);
|
|
return `${s}: x=${Math.round(r.left)} y=${Math.round(r.top)} w=${Math.round(r.width)} h=${Math.round(r.height)} ml=${cs.marginLeft} d=${cs.display}`;
|
|
}).join('\n')).join('\n');
|