/* hero.jsx — 3 hero variants + slim brand header */ function useParallax(strength = 1) { const ref = useRef(null); useEffect(() => { const el = ref.current; if (!el) return; if (matchMedia("(prefers-reduced-motion:reduce)").matches) return; let raf; const onMove = (e) => { const x = (e.clientX / window.innerWidth - .5) * 2; const y = (e.clientY / window.innerHeight - .5) * 2; cancelAnimationFrame(raf); raf = requestAnimationFrame(() => { el.style.setProperty("--px", x * 12 * strength + "px"); el.style.setProperty("--py", y * 12 * strength + "px"); }); }; window.addEventListener("mousemove", onMove); return () => {window.removeEventListener("mousemove", onMove);cancelAnimationFrame(raf);}; }, [strength]); return ref; } function BrandHeader({ onCTA }) { const [solid, setSolid] = useState(false); const [open, setOpen] = useState(false); useEffect(() => { const onScroll = () => {setSolid(window.scrollY > 40);if (window.scrollY > 80) setOpen(false);}; window.addEventListener("scroll", onScroll, { passive: true }); return () => window.removeEventListener("scroll", onScroll); }, []); useEffect(() => { document.body.style.overflow = open ? "hidden" : ""; return () => {document.body.style.overflow = "";}; }, [open]); const close = () => setOpen(false); const goTo = (id) => {close();setTimeout(() => document.getElementById(id)?.scrollIntoView({ behavior: "smooth" }), 60);}; return ( <>
STG Consult STG Consult {/* Hamburger — mobile only */}
{/* Mobile nav overlay */}
); } const HEADLINE = <>Desenvolvimento de
E‑Commerce sob medida;const SUB = <>Criamos, migramos e estruturamos operações de E‑Commerce
com foco em performance e escala; function HeroBadges() { return (
{["+20 anos de experiência", "+200 projetos", "Migração sem downtime"].map((t, i) => {t} )}
); } /* ----- Variant: Cinematic (centered) ----- */ function HeroCinematic({ onCTA }) { const pref = useParallax(1); return (
STG Consult {HEADLINE} {SUB} Receber orçamento
); } /* ----- Variant: Split (asymmetric) ----- */ function HeroSplit({ onCTA }) { const pref = useParallax(1.2); return (
STG Consult {HEADLINE} {SUB}
); } /* ----- Variant: Depth (layered cluster) ----- */ function HeroDepth({ onCTA }) { const pref = useParallax(1); return (
STG Consult {HEADLINE} {SUB}
); } function Hero({ variant = "split", onCTA }) { const map = { cinematic: HeroCinematic, split: HeroSplit, depth: HeroDepth }; const C = map[variant] || HeroSplit; return
; } Object.assign(window, { Hero, BrandHeader, useParallax });