// Medway MSS — App shell, scroll-spy, i18n, tweaks const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "accent": "#1ea34d", "headingWeight": 500, "showGrid": true }/*EDITMODE-END*/; const ACCENT_PRESETS = [ { name: 'Medway green', v: '#1ea34d' }, { name: 'Deep green', v: '#15803d' }, { name: 'Clinical blue', v: '#2563eb' }, { name: 'Deep teal', v: '#0e7490' }, { name: 'Slate', v: '#475569' }, { name: 'Crimson', v: '#b91c1c' }, ]; function App() { const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS); const { lang, setLang, t } = useI18n(); const [active, setActive] = React.useState('home'); const isMobile = useIsMobile(); React.useEffect(() => { document.documentElement.lang = lang; }, [lang]); const onNav = (id) => { const el = document.getElementById(id); if (el) { const top = el.getBoundingClientRect().top + window.scrollY - 60; window.scrollTo({ top, behavior: 'smooth' }); } }; React.useEffect(() => { const ids = ['home', 'about', 'products', 'industries', 'contact']; const onScroll = () => { const y = window.scrollY + 140; let cur = 'home'; for (const id of ids) { const el = document.getElementById(id); if (el && el.offsetTop <= y) cur = id; } setActive(cur); }; window.addEventListener('scroll', onScroll); onScroll(); return () => window.removeEventListener('scroll', onScroll); }, []); React.useEffect(() => { if (window.lucide) window.lucide.createIcons(); }); return (