// ============================================================
// PACE — Secciones A: Header, Hero, Stats, Selector de meta
// ============================================================
// ---- Dropdown de navegación ----
function NavDrop({ label, items }) {
const [open, setOpen] = React.useState(false);
return (
setOpen(true)}
onMouseLeave={() => setOpen(false)}
>
);
}
// ---- Header ----
function Header({ route }) {
const [scrolled, setScrolled] = React.useState(false);
const [open, setOpen] = React.useState(false);
React.useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 40);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
const groups = [
{
label: "Entrenamiento",
items: [
{ label: "¿Cuál es tu meta? · Planes", href: "#/metas" },
{ label: "Programas mensuales", href: "#/programas" },
{ label: "El método PACE", href: "#/metodo" },
],
},
{
label: "El club",
items: [
{ label: "Comunidad y horarios", href: "#/club" },
{ label: "Preguntas frecuentes", href: "#/faq" },
],
},
];
const links = [{ label: "Inicio", href: "#/" }].concat(groups[0].items, groups[1].items);
return (
);
}
// ---- Hero ----
function Hero({ copy }) {
const [ready, setReady] = React.useState(false);
React.useEffect(() => {
const t = setTimeout(() => setReady(true), 150);
return () => clearTimeout(t);
}, []);
const c = PACE.heroCopies[copy] || PACE.heroCopies["No corres solo"];
return (
Bogotá · 2.640 m de altura · Correr con sentido
{c.a}
{c.b}
Planes de entrenamiento para cada meta — de tus primeros pasos a la maratón.
Con coach real, comunidad real.
);
}
// ---- Stats band ----
function Stats() {
const stats = [
{ end: 2640, suffix: "", label: "metros de altura. Bogotá nos hace fuertes" },
{ end: 5, suffix: "", label: "metas: de Start a maratón" },
{ end: 1, suffix: "", label: "sesión presencial: domingos en el Parque El Virrey" },
{ end: 100, suffix: "%", label: "acompañamiento real de tu coach" },
];
return (
{stats.map((s, i) => (
0 ? "1px solid var(--line)" : "none",
}}
>
{s.label}
))}
);
}
// ---- Goal selector (sección de venta principal) ----
function GoalSelector() {
const [active, setActive] = React.useState("21k");
const [swap, setSwap] = React.useState(false);
const goal = PACE.goals.find((g) => g.id === active);
const pick = (id) => {
if (id === active) return;
setSwap(true);
setTimeout(() => {
setActive(id);
setSwap(false);
}, 220);
};
const idx = PACE.goals.findIndex((g) => g.id === active);
return (
);
}
Object.assign(window, { Header, Hero, Stats, GoalSelector });