/* eslint-disable */ // Sticky nav. Transparent over hero, becomes off-white-on-light after threshold. // Smooth-scrolls to section anchors. const NAV_ITEMS = [ { id: 'about', href: 'about.html', label: 'About', external: true }, { id: 'work', href: 'index.html#work', label: 'Workshop' }, { id: 'projects', href: 'index.html#projects', label: 'Projects' }, { id: 'process', href: 'index.html#process', label: 'Process' }, { id: 'contact', href: 'index.html#contact', label: 'Contact' }, ]; const Nav = () => { const [scrolled, setScrolled] = React.useState(false); const [active, setActive] = React.useState(''); React.useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 80); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); // Section-aware active link via IntersectionObserver React.useEffect(() => { const ids = ['work', 'projects', 'process', 'about', 'contact']; const els = ids.map((id) => document.getElementById(id)).filter(Boolean); if (els.length === 0) return; const io = new IntersectionObserver((entries) => { entries.forEach((e) => { if (e.isIntersecting) setActive(e.target.id); }); }, { rootMargin: '-40% 0px -55% 0px' }); els.forEach((el) => io.observe(el)); return () => io.disconnect(); }, []); const spa = typeof window !== 'undefined' && window.__ucSPA; const go = (item) => (e) => { if (item.external) { // About page if (spa) { e.preventDefault(); if (location.hash !== '#/about') location.hash = '#/about'; } return; // multi-page: follow href to about.html } // section link const el = document.getElementById(item.id); if (el) { e.preventDefault(); el.scrollIntoView({ behavior: 'smooth', block: 'start' }); return; } if (spa) { e.preventDefault(); window.__pendingSection = item.id; location.hash = ''; } // multi-page & not on this page: follow href to index.html#id }; const goTop = (e) => { if (spa) { e.preventDefault(); if (location.hash) location.hash = ''; else window.scrollTo({ top: 0, behavior: 'smooth' }); return; } if (!document.getElementById('top')) return; // not on home; follow href e.preventDefault(); window.scrollTo({ top: 0, behavior: 'smooth' }); }; const hrefFor = (item) => { if (!spa) return item.href; return item.external ? '#/about' : `#${item.id}`; }; const fg = 'var(--color-off-white)'; const logoColor = 'var(--color-acid-yellow)'; const bg = scrolled ? 'var(--color-deep-brown)' : 'transparent'; const border = scrolled ? '1px solid rgba(253, 254, 120, 0.18)' : '1px solid transparent'; return (
{'[uni\ncraft]'}
); }; Object.assign(window, { Nav });