// chrome.jsx — Shared Nav, Footer, and default tokens for all pages. // Auto-detect path depth so the same Nav/Footer works from root and subdirs. // Just check if the current URL is inside a known subdir. const BASE = (() => { const path = window.location.pathname; if (/\/servicios\/[^/]+$/.test(path)) return '../'; return ''; })(); const $ = (p) => BASE + p; // Applies the page-wide design tokens (mode, density, font, etc.) without // the Tweaks panel. Used on inner pages where we want consistency without // the live editor. function applyDefaultTokens() { const root = document.documentElement; root.setAttribute('data-mode', 'mixed'); root.setAttribute('data-hero', 'particles'); root.setAttribute('data-bg-tone', 'standard'); root.setAttribute('data-card-style', 'lines'); root.setAttribute('data-density', 'regular'); root.style.setProperty('--sans', '"Manrope", ui-sans-serif, system-ui, sans-serif'); } function Nav({ active }) { const [scrolled, setScrolled] = React.useState(false); const [menuOpen, setMenuOpen] = React.useState(false); const [mobileOpen, setMobileOpen] = React.useState(false); const dropRef = React.useRef(null); React.useEffect(() => { const on = () => setScrolled(window.scrollY > 24); window.addEventListener('scroll', on); return () => window.removeEventListener('scroll', on); }, []); React.useEffect(() => { const onDoc = (e) => { if (dropRef.current && !dropRef.current.contains(e.target)) setMenuOpen(false); }; document.addEventListener('click', onDoc); return () => document.removeEventListener('click', onDoc); }, []); React.useEffect(() => { document.body.style.overflow = mobileOpen ? 'hidden' : ''; return () => { document.body.style.overflow = ''; }; }, [mobileOpen]); const linkCls = (key) => `nav-link ${active === key ? 'is-active' : ''}`; return ( <>
{ if (e.target.tagName === 'A') setMobileOpen(false); }}> Inicio01 Servicios02 ↳ Agentes de IA ↳ Automatización de procesos ↳ Integraciones & sistemas ↳ Tableros & seguimiento Nosotros03 Blog04 Contacto05 Ingresar Activar mi Flow →
); } function Footer() { return ( ); } Object.assign(window, { Nav, Footer, applyDefaultTokens });