/* App entry — DCAF microsite */ const { useState, useEffect } = React; const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "lang": "en", "heroImg": "facility", "accent": "signal", "theme": "noir" }/*EDITMODE-END*/; const HERO_IMAGES = { facility: "media/fbo-header-exterior.webp", hangar: "media/hangar-exterior.webp", ramp: "media/fbo-ramp.webp", clouds: "media/clouds.webp", wing: "media/wing-detail.webp", }; // Accent: stored as a hex string so TweakColor swatches work natively. const ACCENT_HEX = { signal: '#E16A26', azure: '#2A6FB5', gold: '#B89860' }; const ACCENT_REVERSE = { '#E16A26': 'signal', '#2A6FB5': 'azure', '#B89860': 'gold' }; function App() { const t0 = window.useTweaks ? window.useTweaks(TWEAK_DEFAULTS) : [TWEAK_DEFAULTS, () => {}]; const tweaks = t0[0]; const setTweak = t0[1]; const lang = tweaks.lang || 'en'; const t = window.CONTENT[lang] || window.CONTENT.en; const dir = t.dir || 'ltr'; // Apply accent — value may be a key ("signal") OR a hex string from the color chip const accentHex = ACCENT_HEX[tweaks.accent] || tweaks.accent || '#E16A26'; useEffect(() => { document.documentElement.style.setProperty('--signal', accentHex); }, [accentHex]); // Apply lang to useEffect(() => { document.documentElement.lang = lang; document.documentElement.dir = dir; }, [lang, dir]); // Hide boot loader once rendered useEffect(() => { const el = document.getElementById('boot'); if (el) setTimeout(() => { el.classList.add('gone'); setTimeout(() => el.remove(), 700); }, 200); }, []); const heroImg = HERO_IMAGES[tweaks.heroImg] || HERO_IMAGES.facility; const setLang = (l) => setTweak('lang', l); return (