// Main app for Industrolearn homepage
const DEFAULT_TWEAKS = /*EDITMODE-BEGIN*/{
"italTreatment": "saffron",
"routerLayout": "cards",
"manifestoLayout": "pullquote",
"programsLayout": "hero",
"studioLayout": "grid",
"founderLayout": "portrait"
}/*EDITMODE-END*/;
function App() {
const [tweak, setTweak] = useTweaks(DEFAULT_TWEAKS);
// Scroll to URL hash once the React tree has mounted (anchors don't exist
// at initial paint, so the browser's native hash-jump misses).
React.useEffect(() => {
const id = window.location.hash.slice(1);
if (!id) return;
requestAnimationFrame(() => {
const el = document.getElementById(id);
if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
});
}, []);
// Reveal-on-scroll
React.useEffect(() => {
const els = document.querySelectorAll(".reveal:not(.is-in)");
const io = new IntersectionObserver((entries) => {
entries.forEach((e) => {
if (e.isIntersecting) {
e.target.classList.add("is-in");
io.unobserve(e.target);
}
});
}, { threshold: 0.15 });
els.forEach((el) => io.observe(el));
return () => io.disconnect();
}, [tweak]);
return (
<>
setTweak("italTreatment", v)}
options={[
{ value: "default", label: "Serif italic" },
{ value: "saffron", label: "Saffron italic" },
{ value: "underline", label: "Underline" },
{ value: "fill", label: "Saffron fill" },
]}
/>
setTweak("routerLayout", v)}
options={[
{ value: "cards", label: "Cards" },
{ value: "list", label: "Editorial list" },
{ value: "stack", label: "Typographic stack" },
]}
/>
setTweak("manifestoLayout", v)}
options={[
{ value: "centered", label: "Centered column" },
{ value: "pullquote", label: "Pull-quote" },
{ value: "letter", label: "Signed letter" },
]}
/>
setTweak("programsLayout", v)}
options={[
{ value: "cards", label: "Equal cards" },
{ value: "hero", label: "Builder hero" },
{ value: "table", label: "Comparison" },
]}
/>
setTweak("studioLayout", v)}
options={[
{ value: "grid", label: "5-card grid" },
{ value: "ladder", label: "Priced ladder" },
]}
/>
setTweak("founderLayout", v)}
options={[
{ value: "portrait", label: "Portrait + text" },
{ value: "fullbleed", label: "Full-bleed cover" },
{ value: "signature", label: "Signature card" },
]}
/>
>
);
}
const root = ReactDOM.createRoot(document.getElementById("app"));
root.render();