// GuerrerosCR — Sections: Hero, Problem, Services
const { useState, useEffect, useRef } = React;
// === Inline SVG icons (original, simple geometric)
const Icon = ({ name, size = 20 }) => {
const s = size;
const stroke = { stroke: "currentColor", strokeWidth: 1.7, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" };
switch (name) {
case "app":
return ();
case "bolt":
return ();
case "link":
return ();
case "globe":
return ();
case "chart":
return ();
case "shield":
return ();
case "wa":
return ();
case "arrow":
return ();
case "check":
return ();
case "lightning":
return ();
case "users":
return ();
case "db":
return ();
case "send":
return ();
case "mail":
return ();
case "pin":
return ();
case "phone":
return ();
case "sun":
return ();
case "moon":
return ();
default: return null;
}
};
window.Icon = Icon;
// === Nav ===
function Nav({ onContact }) {
const isEn = window.location.pathname.startsWith("/en");
const base = isEn ? "/en" : "";
const [active, setActive] = useState("inicio");
const [isDark, setIsDark] = useState(false);
const [menuOpen, setMenuOpen] = useState(false);
const [langIsEn, setLangIsEn] = useState(isEn);
const sections = ["inicio", "servicios", "proyectos", "nosotros", "blog", "contacto"];
useEffect(() => {
const theme = document.documentElement.getAttribute("data-theme");
setIsDark(theme === "dark");
setLangIsEn(window.location.pathname.startsWith("/en"));
}, []);
useEffect(() => {
const onScroll = () => {
let cur = "inicio";
for (const id of sections) {
const el = document.getElementById(id);
if (el && el.getBoundingClientRect().top < 120) cur = id;
}
setActive(cur);
};
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
const go = (id) => (e) => {
e.preventDefault();
const el = document.getElementById(id);
if (el) {
const top = el.getBoundingClientRect().top + window.scrollY - 70;
window.scrollTo({ top, behavior: "smooth" });
}
setMenuOpen(false);
};
const toggleTheme = () => {
const nextDark = !isDark;
document.documentElement.setAttribute("data-theme", nextDark ? "dark" : "light");
try {
localStorage.setItem("gc_theme", nextDark ? "dark" : "light");
} catch (e) {}
setIsDark(nextDark);
};
const links = [
{ id: "inicio", label: isEn ? "Home" : "Inicio", href: `${base}/#inicio`, type: "section" },
{ id: "servicios", label: isEn ? "Services" : "Servicios", href: `${base}/#servicios`, type: "section" },
{ id: "proyectos", label: isEn ? "Projects" : "Proyectos", href: `${base}/#proyectos`, type: "section" },
{ id: "nosotros", label: isEn ? "About" : "Nosotros", href: `${base}/#nosotros`, type: "section" },
{ id: "blog", label: "Blog", href: `${base}/blog`, type: "page" },
{ id: "contacto", label: isEn ? "Contact" : "Contacto", href: `${base}/contacto`, type: "page" },
];
return (
);
}
window.Nav = Nav;
// === Hero ===
function Hero() {
const isEn = window.location.pathname.startsWith("/en");
const base = isEn ? "/en" : "";
const go = (id) => (e) => {
e.preventDefault();
const el = document.getElementById(id);
if (el) {
const top = el.getBoundingClientRect().top + window.scrollY - 70;
window.scrollTo({ top, behavior: "smooth" });
}
};
return (
{isEn ? "We build web applications, automations, ERP integrations, and professional websites so your company can reduce manual work, centralize information, and make better decisions." : "Desarrollamos aplicaciones web, automatizaciones, integraciones con ERP y sitios profesionales para que su empresa reduzca trabajo manual, centralice información y tome mejores decisiones."}
{isEn ? <>Technology for companies that want to grow with order, automation, and control.> : <>Tecnología para empresas que quieren crecer con orden, automatización y control.>}
{isEn ? "When information lives in email, spreadsheets, and disconnected systems, approvals get delayed, reporting takes too long, and teams repeat tasks that should be automated." : "Cuando la información vive en correos, Excel y sistemas separados, las aprobaciones se atrasan, los reportes toman demasiado tiempo y el equipo termina repitiendo tareas que podrían estar automatizadas."}
{isEn ? "At GuerrerosCR, we turn those processes into simple, structured, and efficient digital solutions." : "En GuerrerosCR transformamos esos procesos en soluciones digitales simples, ordenadas y eficientes."}