/* global React */ // Espalhe Gardênias — institutional site · UI primitives const { useState, useEffect, useRef } = React; // ---------------------------------------------------------------- Icon (Lucide) function Icon({ name, size = 20, stroke = 1.6, color = "currentColor", style }) { const ref = useRef(null); useEffect(() => { if (window.lucide && ref.current) { ref.current.innerHTML = ""; const el = document.createElement("i"); el.setAttribute("data-lucide", name); ref.current.appendChild(el); window.lucide.createIcons({ attrs: { width: size, height: size, "stroke-width": stroke, stroke: color }, nameAttr: "data-lucide", }); } }, [name, size, stroke, color]); return ; } // ---------------------------------------------------------------- Gardenia ornament function Flower({ which = 1, simple = true, size = 80, opacity = 1, style }) { const src = assetURL(`assets/flor-${which}-${simple ? "simples" : "detalhada"}.png`); return ; } // ---------------------------------------------------------------- Espalhe Gardênias movement wordmark function Logo({ variant = "vinho", height = 40, style, onClick }) { return ( Espalhe Gardênias ); } // ---------------------------------------------------------------- Gardênia Cavalcanti monogram / lockup function GCMark({ tone = "vinho", size = 42, style }) { return ; } function GCLockup({ tone = "vinho", height = 120, style, onClick }) { return Gardênia Cavalcanti; } // ---------------------------------------------------------------- Eyebrow / kicker function Eyebrow({ children, color = "var(--terracota)", style }) { return (
{children}
); } // ---------------------------------------------------------------- Button function Button({ children, variant = "primary", onClick, full, size = "md", style }) { const pad = size === "sm" ? "11px 22px" : size === "lg" ? "18px 40px" : "15px 32px"; const base = { fontFamily: "var(--font-display)", fontWeight: 500, fontSize: size === "sm" ? 12 : 13, letterSpacing: ".14em", textTransform: "uppercase", padding: pad, border: "none", cursor: "pointer", borderRadius: 0, transition: "background .25s, color .25s, border-color .25s", width: full ? "100%" : "auto", display: "inline-flex", alignItems: "center", justifyContent: "center", gap: 10, whiteSpace: "nowrap", }; const variants = { primary: { background: "var(--terracota)", color: "#fff" }, dark: { background: "var(--vinho)", color: "var(--pessego)" }, outline: { background: "transparent", color: "var(--fg1)", border: "1px solid var(--fg1)" }, outlineLight: { background: "transparent", color: "var(--pessego)", border: "1px solid var(--pessego)" }, ghost: { background: "transparent", color: "var(--terracota)", border: "1px solid var(--border)" }, }; const hover = { primary: { background: "var(--terracota-hover)" }, dark: { background: "var(--vinho-hover)" }, outline: { background: "var(--fg1)", color: "var(--cream)" }, outlineLight: { background: "var(--pessego)", color: "var(--vinho)" }, ghost: { background: "var(--terracota)", color: "#fff", borderColor: "var(--terracota)" }, }; const [h, setH] = useState(false); return ( ); } // ---------------------------------------------------------------- Navigation map (brief sitemap) const NAV = [ { id: "home", label: "Início" }, { id: "movimento", label: "O Movimento" }, { id: "gardenia", label: "Gardênia" }, { id: "livro", label: "O Livro" }, { id: "loja", label: "Loja" }, { id: "imprensa", label: "Imprensa" }, { id: "contato", label: "Contato" }, ]; // ---------------------------------------------------------------- Header function Header({ onNav, current = "home", dark = false }) { const [scrolled, setScrolled] = useState(false); const [open, setOpen] = useState(false); useEffect(() => { const el = document.getElementById("eg-scroll"); const sc = () => setScrolled((el?.scrollTop || 0) > 20); el && el.addEventListener("scroll", sc); return () => el && el.removeEventListener("scroll", sc); }, []); useEffect(() => { setOpen(false); }, [current]); const onDark = dark && !scrolled; const ink = onDark ? "var(--pessego)" : "var(--fg1)"; return (
onNav("home")} style={{ maxHeight: "clamp(38px, 9vw, 54px)" }} /> {/* desktop nav */} {/* mobile trigger */}
{/* mobile overlay — rendered outside header so backdrop-filter doesn't contain the fixed positioning */} {open && (
onNav("home")} />
)}
); } // ---------------------------------------------------------------- Mega footer function Footer({ onNav }) { const cols = [ { h: "Navegar", items: [["O Movimento","movimento"],["Gardênia","gardenia"],["O Livro","livro"]] }, { h: "Institucional", items: [["Imprensa","imprensa"],["Contato","contato"]] }, ]; const link = (label, id) => (
  • { e.preventDefault(); onNav && onNav(id); }} className="eg-footlink" style={{ fontFamily: "var(--font-body)", fontSize: 13.5, color: "var(--fg-on-dark-soft)", textDecoration: "none" }}>{label}
  • ); return ( ); } Object.assign(window, { Icon, Flower, Logo, GCMark, GCLockup, Button, Eyebrow, Header, Footer, NAV });