// app.jsx — Composition principale + Tweaks panel
// Choisit la variation HERO selon les Tweaks, anime les sections au scroll.
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"heroVariant": "constellation",
"showLabels": "few",
"accentGold": "#F5B544",
"navStyle": "floating"
}/*EDITMODE-END*/;
function useReveal() {
React.useEffect(() => {
const els = document.querySelectorAll(".reveal:not(.in)");
if (!("IntersectionObserver" in window)) {
els.forEach(el => el.classList.add("in"));
return;
}
const obs = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add("in");
obs.unobserve(entry.target);
}
});
}, { threshold: 0.12, rootMargin: "0px 0px -10% 0px" });
els.forEach(el => obs.observe(el));
return () => obs.disconnect();
});
}
function Nav() {
return (
);
}
function App() {
const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);
useReveal();
// Re-trigger reveal on hero variant change
React.useEffect(() => {
requestAnimationFrame(() => {
document.querySelectorAll(".hero .reveal").forEach(el => el.classList.add("in"));
});
}, [t.heroVariant]);
const Hero =
t.heroVariant === "typographic" ? HeroTypographic :
t.heroVariant === "immersive" ? HeroImmersive :
HeroConstellation;
return (
<>
setTweak("heroVariant", v)}
/>
setTweak("showLabels", v)}
/>
>
);
}
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render();