INNER CODE UNIT · Python
rect
yaojingang/GEOFlow · scripts/audit-admin-ui-v3-flicker.py:45
const rect = (selector) => {
const element = document.querySelector(selector);
if (!element) return null;
const bounds = element.getBoundingClientRect();
return { x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height };
};
let frame = 0;
const sample = () => {
window.__gfFlickerAudit.frames.push({
time: performance.now(),
ready: document.readyState,
state: document.documentElement.getAttribute('data-gf-sidebar-state'),
booting: document.documentElement.hasAttribute('data-gf-ui-booting'),
sidebar: rect('.gf-sidebar'),
shellBody: rect('.gf-shell__body'),
heading: rect('.gf-content h1'),
aiStart: rect('.gf-ai-start'),
aiHeading: rect('.gf-ai-heading'),