// Header.jsx — Jetsites institutional site header // Visual style ported from apps/proposals/proposta.html: glyph + brand text, // scroll-spy underline on active section, sticky bar with backdrop blur. // Mobile drawer kept for nav access in <1024px viewports. const Header = () => { const [open, setOpen] = React.useState(false); const [activeId, setActiveId] = React.useState(null); // Body scroll lock when drawer open React.useEffect(() => { document.body.style.overflow = open ? 'hidden' : ''; return () => { document.body.style.overflow = ''; }; }, [open]); // Scroll-spy: highlights the link of the section currently in viewport. React.useEffect(() => { if (!('IntersectionObserver' in window)) return; const ids = ['cases', 'metodo', 'estudio', 'contato']; const sections = ids .map((id) => document.getElementById(id)) .filter(Boolean); if (!sections.length) return; const io = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) setActiveId(entry.target.id); }); }, { rootMargin: '-40% 0px -50% 0px', threshold: 0 } ); sections.forEach((s) => io.observe(s)); return () => io.disconnect(); }, []); const go = (id) => (e) => { e.preventDefault(); setOpen(false); const el = document.getElementById(id); if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' }); }; const linkClass = (id) => `nav__link${activeId === id ? ' is-active' : ''}`; return (
Jetsites
Cases Método Estúdio Contato
); }; window.Header = Header;