// ============================================================ // Foro Valor Emprendedor ? Components // ============================================================ const { useState, useEffect, useRef, useMemo } = React; const CONTACT_EMAIL = "evento@fundacionvaloremprendedor.com"; const CONTACT_PHONE_DISPLAY = "+34 611 94 13 68"; const CONTACT_PHONE_RAW = "34611941368"; const CONTACT_WHATSAPP_URL = `https://wa.me/${CONTACT_PHONE_RAW}`; const FLOAT_WHATSAPP_RAW = CONTACT_PHONE_RAW; const FLOAT_WHATSAPP_URL = `https://wa.me/${FLOAT_WHATSAPP_RAW}`; const CONTACT_MAILTO_URL = `mailto:${CONTACT_EMAIL}`; const CONTACT_TEL_URL = `tel:+${CONTACT_PHONE_RAW}`; const SOCIAL_X_URL = "https://x.com/ForoValor"; const SOCIAL_INSTAGRAM_URL = "https://www.instagram.com/forovaloremprendedor/"; const SOCIAL_LINKEDIN_URL = "https://www.linkedin.com/company/foro-valor-emprendedor/?viewAsMember=true"; async function submitInboxForm(payload) { const response = await fetch("/api/contact.php", { method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json", }, body: JSON.stringify({ formType: payload.formType || "Solicitud web", audience: payload.audience || "", nombre: payload.nombre || "", medio: payload.medio || "", email: payload.email || "", telefono: payload.telefono || "", empresa: payload.empresa || "", acreditaciones: payload.acreditaciones || "", mensaje: payload.mensaje || "", motivacion: payload.motivacion || "", origen: payload.origen || window.location.href, }), }); let data = {}; try { data = await response.json(); } catch (error) { data = {}; } if (!response.ok || !data.ok) { throw new Error(data.error || "No se pudo enviar el formulario."); } return data; } // ---------- Custom Cursor ---------- function CustomCursor() { const dotRef = useRef(null); const ringRef = useRef(null); const [label, setLabel] = useState(""); const [hovering, setHovering] = useState(false); const hoverStateRef = useRef({ hovering: false, label: "" }); useEffect(() => { if (window.matchMedia("(pointer: coarse)").matches) return undefined; let mx = window.innerWidth / 2, my = window.innerHeight / 2; let rx = mx, ry = my; let dx = mx, dy = my; let raf; const onMove = (e) => { mx = e.clientX; my = e.clientY; }; const onOver = (e) => { const t = e.target.closest("[data-cursor]"); const nextHovering = !!t; const nextLabel = t ? (t.getAttribute("data-cursor") || "") : ""; const { hovering: prevHovering, label: prevLabel } = hoverStateRef.current; if (nextHovering !== prevHovering) { hoverStateRef.current.hovering = nextHovering; setHovering(nextHovering); } if (nextLabel !== prevLabel) { hoverStateRef.current.label = nextLabel; setLabel(nextLabel); } }; const tick = () => { rx += (mx - rx) * 0.76; ry += (my - ry) * 0.76; dx += (mx - dx) * 0.92; dy += (my - dy) * 0.92; if (dotRef.current) dotRef.current.style.transform = `translate3d(${dx}px, ${dy}px, 0) translate(-50%, -50%)`; if (ringRef.current) { const scale = hoverStateRef.current.hovering ? 2.35 : 1; ringRef.current.style.transform = `translate3d(${rx}px, ${ry}px, 0) translate(-50%, -50%) scale(${scale})`; } raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick); window.addEventListener("pointermove", onMove, { passive: true }); window.addEventListener("mouseover", onOver); return () => { cancelAnimationFrame(raf); window.removeEventListener("pointermove", onMove); window.removeEventListener("mouseover", onOver); }; }, []); return ( <>
Un día. Dieciocho ponentes del habla hispana. Cientos de emprendedores compartiendo clientes, aprendizajes y oportunidades reales.