// Interior Lab — main App + state routing. function App() { const [route, setRoute] = React.useState({ name: 'home' }); // Hash-based routing for shareable URLs React.useEffect(() => { const fromHash = () => { const h = window.location.hash.replace(/^#\/?/, ''); if (!h) { setRoute({ name: 'home' }); return; } const [name, slug] = h.split('/'); if (name === 'project' && slug) setRoute({ name: 'project', slug }); else if (['portfolio', 'studio', 'services', 'journal', 'contact', 'home'].includes(name)) setRoute({ name }); else setRoute({ name: 'home' }); }; fromHash(); window.addEventListener('hashchange', fromHash); return () => window.removeEventListener('hashchange', fromHash); }, []); const go = (r) => { setRoute(r); const hash = r.name === 'home' ? '#/' : r.name === 'project' ? `#/project/${r.slug}` : `#/${r.name}`; if (window.location.hash !== hash) window.location.hash = hash; window.scrollTo({ top: 0, behavior: 'auto' }); }; let page; switch (route.name) { case 'portfolio': page = ; break; case 'project': page = ; break; case 'studio': page = ; break; case 'services': page = ; break; case 'contact': page = ; break; case 'journal': page = ; break; default: page = ; } // screen-label for comment context const screenLabel = ({ home: '01 Home', portfolio: '02 Portfolio', project: '03 Project Case Study', studio: '04 Studio', services: '05 Disciplines', journal: '06 Journal', contact: '07 Start a project', })[route.name] || '01 Home'; return (
); } const root = ReactDOM.createRoot(document.getElementById('app')); root.render();