// header-hero.jsx — Sticky header with lang toggle + hero
function Header({ lang, setLang, openLead }) {
const c = window.CONTENT[lang].nav;
const [scrolled, setScrolled] = React.useState(false);
React.useEffect(() => {
const h = () => setScrolled(window.scrollY > 12);
window.addEventListener('scroll', h);
return () => window.removeEventListener('scroll', h);
}, []);
return (
);
}
function LangToggle({ lang, setLang }) {
return (
{['tr', 'en'].map(l => (
))}
);
}
/* ───────────── HERO ───────────── */
function Hero({ lang, openLead, headlineIdx, ctaIdx }) {
const c = window.CONTENT[lang].hero;
const h = c.heroHeadingVariants[headlineIdx % c.heroHeadingVariants.length];
const ctaLabel = c.ctaVariants[ctaIdx % c.ctaVariants.length];
return (
{/* decorative confetti */}
{c.pill}
{h.pre}{' '}
{h.mid}
{h.post}
{c.sub}
{c.bullets.map((b, i) => (
-
{b}
))}
{/* Trust strip */}
);
}
function Confetti() {
// Pure-decoration absolutely-positioned shapes
const items = [
{ top: '12%', left: '6%', c: 'var(--sun)', rot: 18 },
{ top: '70%', left: '2%', c: 'var(--leaf)', rot: -10 },
{ top: '6%', right: '20%',c: 'var(--sky)', rot: 25 },
{ top: '78%', right: '4%', c: 'var(--rose)', rot: 8 },
{ top: '40%', right: '46%',c: 'var(--plum)', rot: -25 },
];
return (
{items.map((it, i) => (
))}
);
}
Object.assign(window, { Header, Hero });