/* EntecPower corporate site — shared shell Provides: , , , Loaded by every page after react + babel. Page identifies itself via window.__EP_PAGE = 'home' | 'about' | ... Initial tweak state lives in etc. and is persisted via the __edit_mode_set_keys postMessage protocol. */ const NAV_ITEMS = [ ['home', 'index.html', 'nav_home'], ['about', 'about.html', 'nav_about'], ['products', 'products.html', 'nav_products'], ['industries', 'industries.html', 'nav_industries'], ['partners', 'partners.html', 'nav_partners'], ['news', 'news.html', 'nav_news'], ['contact', 'contact.html', 'nav_contact'], ]; function SiteNav({ page, lang, setLang }) { const [open, setOpen] = React.useState(false); return ( ); } function SiteFooter() { return ( ); } function CtaBand() { return (
); } /* ── Tweaks panel (shared across pages) ────────────────────────────────── */ const HERO_OPTIONS = [ {value:'photo', label:'Photo'}, {value:'video', label:'Video'}, {value:'graphic', label:'Graphic'}, ]; const FONT_OPTIONS = [ {value:'pretendard', label:'Pretendard'}, {value:'space-grotesk', label:'Space Grotesk'}, {value:'nanum-gothic', label:'Nanum Gothic'}, ]; const TONE_OPTIONS = [ ['cobalt','#2563EB'], ['orange','#f7941d'], ['amber','#f59e0b'], ['emerald','#10b981'], ]; function SiteTweaks({ tweaks, setTweak }) { return ( setTweak('theme', v)}/> k === tweaks.tone)?.[1]} options={TONE_OPTIONS.map(([k,c]) => c)} onChange={v => { const tone = TONE_OPTIONS.find(([k,c]) => c === v); if (tone) setTweak('tone', tone[0]); }}/> setTweak('font', v)}/> setTweak('hero', v)}/> ); } /* ── Top-level Shell that wires Nav + Footer + i18n + tweaks ───────────── */ function Shell({ page, children, hideCtaBand }) { const defaults = window.__EP_TWEAK_DEFAULTS; const [tweaks, setTweak] = useTweaks(defaults); const [lang, setLangState] = React.useState(() => window.epDetectDefaultLang ? window.epDetectDefaultLang() : 'ko'); const setLang = React.useCallback((next) => { const l = next === 'ko' ? 'ko' : 'en'; setLangState(l); }, []); // Translate when lang changes React.useEffect(() => { window.epTranslate(lang); }, [lang]); // Pick lookup for current language so children can read strings const t = window.EP_I18N[lang] || window.EP_I18N.en; // Bridge tweaks + lang to children const ctx = { tweaks, setTweak, lang, setLang, t }; return ( {children} {!hideCtaBand && } ); } const SiteCtx = React.createContext({}); window.useSite = () => React.useContext(SiteCtx); Object.assign(window, { SiteNav, SiteFooter, CtaBand, SiteTweaks, Shell, NAV_ITEMS });