// chrome.jsx — Squarespace-style site chrome (header, anchor nav, footer)
const NAV_SECTIONS = [
{ id: "letters", label: "Letters" },
{ id: "numbers", label: "By the Numbers" },
{ id: "moments", label: "Top Moments" },
{ id: "grants", label: "HCIP", group: "Grants" },
{ id: "fire", label: "FIRE", group: "Grants" },
{ id: "ecamp", label: "ECAMP" },
{ id: "kpis", label: "Strategic Progress" },
{ id: "partnerships", label: "Partnerships" },
{ id: "financials", label: "Financials" },
{ id: "ahead", label: "Looking Ahead" },
{ id: "people", label: "People" },
];
function SqsHeader() {
return (
<>
Edmonton Heritage Council · 2025 Annual Report just released →
Read the report
>
);
}
function MicrositeAnchorNav() {
const [activeId, setActiveId] = React.useState(null);
const [hovId, setHovId] = React.useState(null);
React.useEffect(() => {
const onScroll = () => {
const scrollY = window.scrollY + 64;
let current = null;
for (const s of NAV_SECTIONS) {
const el = document.getElementById(s.id);
if (el && el.offsetTop <= scrollY) current = s.id;
}
setActiveId(current);
};
window.addEventListener('scroll', onScroll, { passive: true });
onScroll();
return () => window.removeEventListener('scroll', onScroll);
}, []);
const scrollTo = (e, id) => {
e.preventDefault();
const el = document.getElementById(id);
if (!el) return;
const top = el.getBoundingClientRect().top + window.scrollY - 46;
window.scrollTo({ top, behavior: 'smooth' });
};
return (
{ e.preventDefault(); window.scrollTo({ top: 0, behavior: 'smooth' }); }}>Heritage Wrapped 2025
{NAV_SECTIONS.map((s, i) => {
const isActive = activeId === s.id;
const isHov = hovId === s.id;
const groupStart = s.group && (i === 0 || NAV_SECTIONS[i - 1].group !== s.group);
return (
{groupStart && (
{s.group}
)}
scrollTo(e, s.id)}
onMouseEnter={() => setHovId(s.id)}
onMouseLeave={() => setHovId(null)}
style={{
color: isActive ? 'var(--ink)' : (isHov ? 'var(--ink)' : 'rgba(39,37,37,0.55)'),
background: isHov && !isActive ? 'rgba(39,37,37,0.06)' : 'transparent',
paddingLeft: s.group ? 10 : 14,
paddingRight: s.group ? 10 : 14,
}}
>
{s.label}
);
})}
);
}
function SqsFooter() {
return (
);
}
Object.assign(window, { SqsHeader, MicrositeAnchorNav, SqsFooter });