/* ═══════════════════════════════════════════════════════════════════
Top sections: Nav · Hero · CredBar · VSL (Poligus)
═══════════════════════════════════════════════════════════════════ */
const NAV_LINKS = [
{ label: "Recursos", href: "#recursos" },
{ label: "Planos", href: "#planos" },
{ label: "FAQ", href: "#faq" },
{ label: "Contato", href: "#contato" },
];
const Nav = ({ scrolled }) => {
const [open, setOpen] = React.useState(false);
return (
{/* desktop links */}
{ e.currentTarget.style.borderColor = "var(--cyan)"; e.currentTarget.style.color = "var(--cyan-2)"; }}
onMouseLeave={e => { e.currentTarget.style.borderColor = "var(--line-strong)"; e.currentTarget.style.color = "var(--ink-1)"; }}
onTouchStart={e => { e.currentTarget.style.borderColor = "var(--cyan)"; e.currentTarget.style.color = "var(--cyan-2)"; }}
onTouchEnd={e => { e.currentTarget.style.borderColor = "var(--line-strong)"; e.currentTarget.style.color = "var(--ink-1)"; }}>Entrar
Testar 7 dias grátis
{/* mobile hamburger */}
setOpen(o => !o)} style={{
display: "none", background: "rgba(125,211,255,0.08)", border: "1px solid var(--line-strong)",
borderRadius: 10, width: 42, height: 42, color: "var(--cyan)", cursor: "pointer",
alignItems: "center", justifyContent: "center",
}}>
{/* mobile dropdown panel */}
{open && (
)}
);
};
/* ═══ HERO ═════════════════════════════════════════════════════════ */
const Hero = () => {
const heroRef = React.useRef(null);
const [mouse, setMouse] = React.useState({ x: 0.5, y: 0.5 });
React.useEffect(() => {
const onMove = (e) => {
if (!heroRef.current) return;
const r = heroRef.current.getBoundingClientRect();
setMouse({ x: (e.clientX - r.left) / r.width, y: (e.clientY - r.top) / r.height });
};
const onTouch = (e) => {
if (!heroRef.current || !e.touches || !e.touches[0]) return;
const r = heroRef.current.getBoundingClientRect();
const t = e.touches[0];
setMouse({ x: (t.clientX - r.left) / r.width, y: (t.clientY - r.top) / r.height });
};
const el = heroRef.current;
if (el) {
el.addEventListener("mousemove", onMove);
el.addEventListener("touchmove", onTouch, { passive: true });
el.addEventListener("touchstart", onTouch, { passive: true });
}
return () => {
if (el) {
el.removeEventListener("mousemove", onMove);
el.removeEventListener("touchmove", onTouch);
el.removeEventListener("touchstart", onTouch);
}
};
}, []);
const px = (mouse.x - 0.5) * 30, py = (mouse.y - 0.5) * 30;
return (
{/* desktop sphere */}
{/* text block */}
POLIGUS · IA · NO · WHATSAPP
Seu WhatsApp trabalhando
para sua empresa
24h por dia. {" "}
Sem parar.
A Poligus atende clientes, responde mensagens, faz follow-up, agenda compromissos e organiza sua operação automaticamente — tudo direto no seu WhatsApp.
{HERO.pills.map(p => (
{p}
))}
);
};
/* ═══ CREDIBILITY BAR ══════════════════════════════════════════════ */
const CredBar = () =>
{CRED.map((c, i) => (
{c}
))}
;
/* ═══ CHAT DEMO — IA atendendo ao vivo (substitui o VSL fake) ══════ */
const ChatDemo = () => {
const D = CHAT_DEMO;
const reduced = React.useRef(!!(window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches)).current;
const [count, setCount] = React.useState(reduced ? D.messages.length : 0);
const [typing, setTyping] = React.useState(false);
const bodyRef = React.useRef(null);
const startedRef = React.useRef(false);
// autoscroll
React.useEffect(() => {
const el = bodyRef.current;
if (el) el.scrollTop = el.scrollHeight;
}, [count, typing]);
// play the conversation when it scrolls into view (once), then loop
React.useEffect(() => {
if (reduced) return;
const root = bodyRef.current && bodyRef.current.closest("section");
if (!root) return;
let timers = [];
const clear = () => { timers.forEach(clearTimeout); timers = []; };
const run = () => {
clear(); setCount(0); setTyping(false);
let acc = 600;
D.messages.forEach((m, i) => {
const isIA = m.from === "ia";
const tw = isIA ? (m.typingBeforeMs || 900) : 0;
if (isIA) {
timers.push(setTimeout(() => setTyping(true), acc));
acc += tw;
timers.push(setTimeout(() => { setTyping(false); setCount(i + 1); }, acc));
} else {
acc += 650;
timers.push(setTimeout(() => setCount(i + 1), acc));
}
acc += 350;
});
// loop após uma pausa
timers.push(setTimeout(run, acc + 4200));
};
const obs = new IntersectionObserver((entries) => {
entries.forEach((e) => {
if (e.isIntersecting && !startedRef.current) { startedRef.current = true; run(); }
});
}, { threshold: 0.4 });
obs.observe(root);
return () => { obs.disconnect(); clear(); };
}, []);
return (
{D.badge}
Veja a Poligus atendendo um{" "}
cliente agora.
{D.subheadline}
{["Responde na hora", "Agenda sozinha", "Lembra do cliente"].map(t => (
{t}
))}
{/* PHONE */}
Atendimento · Barbearia
● online · Poligus IA
{D.messages.slice(0, count).map((m, i) => (
{m.text}
{m.time}
))}
{typing && (
)}
);
};
Object.assign(window, { Nav, Hero, CredBar, ChatDemo });