// ============================================================================= // Astovia · Static-page bootstrap // Mounts a single page per HTML file. Cross-page nav uses real navigation. // ============================================================================= const STATIC_PAGE_HREFS = { home: 'home.html', about: 'about.html', advisory: 'advisory.html', interim: 'interim.html', transformation: 'transformation.html', contact: 'contact.html', impressum: 'impressum.html', privacy: 'privacy.html' }; function staticGo(id) { const currentFile = (location.pathname.split('/').pop() || 'home.html').toLowerCase(); if (id === 'about') { // Scroll to #about anchor when we're already on a page that has it. if (currentFile === 'home.html' || currentFile === 'about.html' || currentFile === '') { const el = document.getElementById('about'); if (el) { const top = el.getBoundingClientRect().top + window.scrollY - 64; window.scrollTo({ top, behavior: 'smooth' }); return; } } location.href = 'about.html'; return; } location.href = STATIC_PAGE_HREFS[id] || 'home.html'; } function mountStaticPage(key) { const PAGE_COMPONENTS = { home: window.HomePage, about: window.AboutPage, advisory: window.AdvisoryPage, interim: window.InterimPage, transformation: window.TransformationPage, contact: window.ContactPage, impressum: window.ImpressumPage, privacy: window.PrivacyPage }; const Page = PAGE_COMPONENTS[key] || window.HomePage; // Route value: 'about' shares 'home' for nav-active styling rules; selected = key. const navRoute = key === 'about' ? 'home' : key; function StaticApp() { return (
); } const root = ReactDOM.createRoot(document.getElementById('root')); root.render(); } window.mountStaticPage = mountStaticPage; window.staticGo = staticGo;