/* Reyes Montero — Nav + Hero */ const { useState: useStateTop, useEffect: useEffectTop, useRef: useRefTop } = React; const NAV_LINKS = [ { l: 'Inicio', h: 'inicio' }, { l: 'Productos', h: 'productos' }, { l: 'Cómo funciona', h: 'proceso' }, { l: 'Equipo', h: 'equipo' }, { l: 'Contacto', h: 'contacto' }, ]; function Nav() { const [scrolled, setScrolled] = useStateTop(false); const [active, setActive] = useStateTop('inicio'); const [open, setOpen] = useStateTop(false); useEffectTop(() => { const onScroll = () => { setScrolled(window.scrollY > 12); const ids = NAV_LINKS.map(n => n.h); let cur = ids[0]; for (const id of ids) { const el = document.getElementById(id); if (el && el.getBoundingClientRect().top <= 120) cur = id; } setActive(cur); }; window.addEventListener('scroll', onScroll, { passive: true }); onScroll(); return () => window.removeEventListener('scroll', onScroll); }, []); return ( ); } /* particle constellation canvas */ function HeroCanvas() { const ref = useRefTop(null); useEffectTop(() => { if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return; const canvas = ref.current; if (!canvas) return; const ctx = canvas.getContext('2d'); let raf, w, h, pts = []; const DPR = Math.min(window.devicePixelRatio || 1, 2); function resize() { const r = canvas.parentElement.getBoundingClientRect(); w = r.width; h = r.height; canvas.width = w * DPR; canvas.height = h * DPR; canvas.style.width = w + 'px'; canvas.style.height = h + 'px'; ctx.setTransform(DPR, 0, 0, DPR, 0, 0); const count = Math.min(56, Math.floor(w / 26)); pts = Array.from({ length: count }, () => ({ x: Math.random() * w, y: Math.random() * h, vx: (Math.random() - .5) * .25, vy: (Math.random() - .5) * .25, })); } function tick() { ctx.clearRect(0, 0, w, h); for (const p of pts) { p.x += p.vx; p.y += p.vy; if (p.x < 0 || p.x > w) p.vx *= -1; if (p.y < 0 || p.y > h) p.vy *= -1; } for (let i = 0; i < pts.length; i++) { for (let j = i + 1; j < pts.length; j++) { const a = pts[i], b = pts[j]; const dx = a.x - b.x, dy = a.y - b.y; const dist = Math.hypot(dx, dy); if (dist < 132) { ctx.strokeStyle = 'rgba(255,255,255,' + (.16 * (1 - dist / 132)) + ')'; ctx.lineWidth = 1; ctx.beginPath(); ctx.moveTo(a.x, a.y); ctx.lineTo(b.x, b.y); ctx.stroke(); } } } for (const p of pts) { ctx.fillStyle = 'rgba(255,255,255,.5)'; ctx.beginPath(); ctx.arc(p.x, p.y, 1.6, 0, Math.PI * 2); ctx.fill(); } raf = requestAnimationFrame(tick); } resize(); tick(); window.addEventListener('resize', resize); return () => { cancelAnimationFrame(raf); window.removeEventListener('resize', resize); }; }, []); return ; } function Hero() { const [linea, setLinea] = useStateTop('Seguro de Auto'); const [nombre, setNombre] = useStateTop(''); const [tel, setTel] = useStateTop(''); const submit = (e) => { e.preventDefault(); const msg = `Hola, soy ${nombre || '(sin nombre)'}. Quiero cotizar: ${linea}.` + (tel ? ` Mi teléfono es ${tel}.` : '') + ' ¿Me pueden asesorar?'; window.open(waLink(msg), '_blank'); }; const words = 'Protegemos lo que más importa.'.split(' '); return (
Reyes Montero · Agencia de Seguros

{words.map((w, i) => ( {w === 'importa.' ? {w} : w}{i < words.length - 1 ? '\u00A0' : ''} ))}

Más de 42 años de asesoría profesional y cercana para las familias y empresas de Veracruz y todo México. Elige la protección que de verdad necesitas, con quien te conoce.

Conoce nuestros seguros Cómo funciona
años
de experiencia
clientes protegidos
+
aseguradoras

Solicita tu cotización

Te contactamos por WhatsApp, sin compromiso.
setNombre(e.target.value)} placeholder="Ej. América Reyes" />
setTel(e.target.value)} placeholder="10 dígitos" inputMode="tel" />
); } Object.assign(window, { Nav, Hero });