// Shared components and SVG illustrations for Latma // === Bandeirinha bunting (festas juninas vibe) === function Bunting({ colors = ['#3878D6', '#EFC987', '#E84A8C', '#5BA85A', '#1F4FA8'], count = 22 }) { const flags = Array.from({ length: count }, (_, i) => { const x = (i / (count - 1)) * 100; const droopY = Math.sin((i / (count - 1)) * Math.PI) * 18; return { x, y: 20 + droopY, color: colors[i % colors.length] }; }); return (
{flags.map((f, i) => { const cx = (f.x / 100) * 1000; const cy = f.y + 4; return ( ); })}
); } // === Star (Latma logo mark) === function Star({ color = '#EFC987', size = 16 }) { return ( ); } // === Palm tree silhouette === function PalmTree({ color = '#1F4FA8', className = '', style = {} }) { return ( ); } // === Arrow icons === function ArrowRight({ size = 16 }) { return ( ); } function ArrowUpRight({ size = 16 }) { return ( ); } function CloseIcon({ size = 18 }) { return ( ); } function CheckIcon({ size = 20 }) { return ( ); } // === Nav (with active state and scroll detection) === function Nav({ route, onNavigate }) { const [scrolled, setScrolled] = React.useState(false); const [menuOpen, setMenuOpen] = React.useState(false); React.useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 16); window.addEventListener('scroll', onScroll, { passive: true }); onScroll(); return () => window.removeEventListener('scroll', onScroll); }, []); React.useEffect(() => { document.body.style.overflow = menuOpen ? 'hidden' : ''; return () => { document.body.style.overflow = ''; }; }, [menuOpen]); const links = [ { key: 'historia', label: 'Nossa História' }, { key: 'produtos', label: 'Produtos' }, ]; const go = (k) => { setMenuOpen(false); onNavigate(k); }; return ( <>
{ e.preventDefault(); go('home'); }} href="#home" >Início {links.map(l => ( { e.preventDefault(); go(l.key); }} href={`#${l.key}`} >{l.label} ))} { e.preventDefault(); go('contato'); }} href="#contato" >Fale com a gente
latma@outlook.com.br
@laticiniosmaranhao
); } // === Footer === function Footer({ onNavigate }) { return ( ); } // Export to window for cross-file access Object.assign(window, { Bunting, Star, PalmTree, ArrowRight, ArrowUpRight, CloseIcon, CheckIcon, Nav, Footer, });