/* global React */ // ============================================================ // Craque Cidadão — site chrome: Header, Footer, FloatingWhatsApp // ============================================================ const { Icon, CC_LOGO, WA_LINK, IG_LINK } = window; const NAV_LINKS = [ { id: 'home', label: 'Home' }, { id: 'quem-somos', label: 'Quem Somos' }, { id: 'projetos', label: 'Projetos' }, { id: 'parceiros', label: 'Parceiros' }, { id: 'transparencia', label: 'Transparência' }, { id: 'galeria', label: 'Galeria' }, { id: 'contato', label: 'Contato' }, ]; function Logo({ onNav, dark = false }) { return ( onNav('home')} aria-label="Craque Cidadão — início" style={{ display: 'flex', alignItems: 'center', cursor: 'pointer', textDecoration: 'none' }}> ); } function Header({ route, onNav }) { const { Button } = window.CraqueCidadODesignSystem_6fdc08; const [open, setOpen] = React.useState(false); const [scrolled, setScrolled] = React.useState(false); React.useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 8); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); React.useEffect(() => { setOpen(false); }, [route]); const go = (id) => { setOpen(false); onNav(id); }; return ( {/* desktop nav */} {NAV_LINKS.map((l) => ( go(l.id)} style={{ padding: '9px 13px', cursor: 'pointer', borderRadius: 'var(--radius-pill)', fontFamily: 'var(--font-display)', fontWeight: 600, fontSize: 14.5, color: route === l.id ? 'var(--brand)' : 'var(--text-body)', background: route === l.id ? 'var(--brand-soft)' : 'transparent', textDecoration: 'none', transition: 'background var(--dur), color var(--dur)', }} onMouseEnter={(e) => { if (route !== l.id) e.currentTarget.style.background = 'var(--paper-2)'; }} onMouseLeave={(e) => { if (route !== l.id) e.currentTarget.style.background = 'transparent'; }} >{l.label} ))} WhatsApp {/* mobile toggle */} setOpen((o) => !o)} style={{ display: 'none', border: 0, background: 'var(--brand-soft)', color: 'var(--brand)', width: 46, height: 46, borderRadius: 12, cursor: 'pointer', alignItems: 'center', justifyContent: 'center', }}> {/* mobile drawer */} {NAV_LINKS.map((l) => ( go(l.id)} style={{ padding: '13px 14px', cursor: 'pointer', borderRadius: 12, fontFamily: 'var(--font-display)', fontWeight: 700, fontSize: 16, color: route === l.id ? 'var(--brand)' : 'var(--text-strong)', background: route === l.id ? 'var(--brand-soft)' : 'transparent', textDecoration: 'none', }}>{l.label} ))} Fale pelo WhatsApp ); } function FloatingWhatsApp() { const [hover, setHover] = React.useState(false); return ( setHover(true)} onMouseLeave={() => setHover(false)} style={{ position: 'fixed', right: 22, bottom: 22, zIndex: 80, display: 'flex', alignItems: 'center', gap: 10, background: 'linear-gradient(135deg, #2BD96E 0%, #1EBE5B 100%)', color: '#fff', textDecoration: 'none', padding: '14px 19px 14px 16px', borderRadius: 'var(--radius-pill)', fontFamily: 'var(--font-display)', fontWeight: 700, fontSize: 15, boxShadow: hover ? '0 16px 34px rgba(30,190,91,0.5)' : '0 10px 26px rgba(30,190,91,0.4)', transform: hover ? 'translateY(-2px)' : 'none', transition: 'transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out)', }}> Fale conosco ); } function Footer({ onNav }) { const { Button } = window.CraqueCidadODesignSystem_6fdc08; const year = new Date().getFullYear(); const social = [ { icon: 'instagram', href: IG_LINK }, { icon: 'message-circle', href: WA_LINK }, { icon: 'mail', href: 'mailto:ongcraquecidadao@gmail.com' }, ]; return ( <> {/* contact CTA band */} Ficou alguma dúvida? Fale com a gente agora mesmo pelo WhatsApp. Fale pelo WhatsApp > ); } Object.assign(window, { Header, Footer, FloatingWhatsApp, Logo, NAV_LINKS });
Fale com a gente agora mesmo pelo WhatsApp.