// Home page — reads from window.__C (content.json)
const _h = () => window.c('home.hero', {});
const _stats = () => window.c('home.stats', []);
const _trust = () => window.c('home.trust', {});
const _why = () => window.c('home.why', {});
const _comp = () => window.c('home.comparison', {});
const _pp = () => window.c('home.products_preview', {});
const _proc = () => window.c('home.process', {});
const _gal = () => window.c('home.gallery', {});
const _man = () => window.c('home.manifesto', {});
// Render image or placeholder slot
function Img({ src, label, ratio = '16/9', cobalt = false, style = {}, className = '' }) {
if (src && (src.startsWith('assets/') || src.startsWith('http'))) {
// Use image if it exists (with onError fallback)
return (

{ e.target.style.display = 'none'; e.target.nextSibling.style.display = 'flex'; }}
/>
{label}
);
}
return ;
}
function HomeHero({ variant, setRoute }) {
return (
{variant === 'a' && }
{variant === 'b' && }
{variant === 'c' && }
);
}
function HeroA({ setRoute }) {
const h = _h();
const t = _trust();
return (
<>
{h.chip || '#1 prefab panel in indonesia'}
{h.eyebrow || 'Wall + floor panel system'}
{h.headline_a || 'Built\ndifferent.'}
{h.sub || "Indonesia's first building panel system engineered for primary structures."}
{/* Triplet below hero */}
{t.tested_title || 'Tested & certified by'}
{(t.tested_lines || []).map((l, i) => (
· {l}
))}
100% Karya
Anak Bangsa
Engineered & made in Indonesia
>
);
}
function HeroB({ setRoute }) {
const h = _h();
return (
{h.chip || '#1 prefab panel · indonesia'}
{h.headline_b || 'Built\ndifferent.'}
{h.sub || ''}
);
}
function HeroC({ setRoute }) {
const h = _h();
return (
{h.chip || '#1 prefab panel in indonesia'}
{h.headline_c || 'We rebuild\nhow Indonesia builds.'}
{h.sub || ''}
);
}
function StatStrip() {
const stats = _stats();
return (
{stats.map((s, i) => (
))}
);
}
function WhyMyfab() {
const w = _why();
return (
{(w.pillars || []).map((p, i) => (
))}
);
}
function Comparison() {
const cmp = _comp();
return (
{cmp.eyebrow}
{cmp.headline}
|
Brick & mortar |
Common precast |
Myfab panels |
{(cmp.rows || []).map((r, i) => (
| {r.label} |
{r.brick} |
{r.precast} |
{r.myfab} |
))}
);
}
function ProductsPreview({ setRoute }) {
const pp = _pp();
const items = pp.items || [];
return (
{pp.eyebrow}
{pp.headline}
);
}
function ProcessTimeline() {
const pr = _proc();
const phases = pr.phases || [];
return (
{pr.eyebrow}
{pr.headline}
{phases.map((p, i) => (
{p.title}
{p.body}
{p.who}
))}
);
}
function GalleryPreview({ setRoute }) {
const g = _gal();
const cells = g.cells || [];
const layout = [
{ c: 'span 6', r: 'span 2' },
{ c: 'span 3', r: 'span 1' },
{ c: 'span 3', r: 'span 1' },
{ c: 'span 3', r: 'span 1' },
{ c: 'span 3', r: 'span 1' },
{ c: 'span 6', r: 'span 1' },
];
return (
{cells.map((cell, i) => (
))}
);
}
function Manifesto() {
const m = _man();
return (
{m.headline}
{(m.columns || []).map((col, i) => (
))}
);
}
function HomePage({ setRoute, tweaks }) {
return (
);
}
Object.assign(window, { HomePage, Img });