/* Federica Gori — chrome condiviso del sito (Header + Footer + mount).
Sito multi-pagina: la navigazione usa URL reali (un file per pagina).
onNav(id) → naviga al file corrispondente. */
const FG_LOGO = (window.__resources && window.__resources.fgLogo) || "assets/logo-federica-transparent.png";
const FG_PORTRAIT = (window.__resources && window.__resources.fgPortrait) || "assets/federica-3.jpg";
const FG_NAV = [
{ id: "home", label: "Home", url: "/" },
{ id: "method", label: "Il metodo", url: "/metodo" },
{ id: "analisi", label: "Analisi a distanza", url: "/analisi-a-distanza" },
{ id: "about", label: "Chi sono", url: "/chi-sono" },
{ id: "diario", label: "Diario", url: "/diario" },
{ id: "contact", label: "Contatti", url: "/contatti" },
];
const FG_URL = FG_NAV.reduce((m, l) => { m[l.id] = l.url; return m; }, {});
function fgGo(id) {
const url = FG_URL[id] || "/";
window.location.href = url;
}
/* Guscio di pagina: Header + main + Footer, coerente su ogni pagina. */
function SiteShell({ current, children }) {
const NS = window.FedericaGoriDesignSystem_549960;
const { Header, Footer } = NS;
const navLinks = FG_NAV.map(({ id, label }) => ({ id, label }));
// Header fisso: ombra leggera solo a pagina scrollata (classe via listener).
React.useEffect(() => {
const el = document.querySelector("header[data-fg-sticky]");
if (!el) return;
const onScroll = () => el.classList.toggle("is-scrolled", window.scrollY > 8);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
return (
fgGo("contact")}
links={navLinks}
ctaLabel="Prenota"
logoSrc={FG_LOGO}
subtitle="Naturopata · Medicina funzionale"
data-fg-sticky=""
style={{ position: "sticky", top: 0 }}
/>
{children}
);
}
/* Monta una pagina dentro il guscio, quando bundle + helper sono pronti. */
function fgMount(PageComponent, current) {
function ready() {
// fgSlotsDone: false solo mentre slots.js sta caricando gli slot dal CMS
// (max 1200ms); undefined nelle pagine senza slot → si procede subito.
return window.FedericaGoriDesignSystem_549960 && window.Icon && window.Photo && window.Reveal && window.fgSlotsDone !== false;
}
function go() {
if (!ready()) { setTimeout(go, 30); return; }
ReactDOM.createRoot(document.getElementById("root")).render(
);
}
go();
}
Object.assign(window, { FG_LOGO, FG_PORTRAIT, FG_NAV, FG_URL, fgGo, SiteShell, fgMount });