/* app.jsx — assembly, tweaks, sticky CTA */
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"heroVariant": "cinematic",
"accent": "#aa00ee",
"titleFont": "Rubik",
"showBadges": true
} /*EDITMODE-END*/;
const ACCENTS = {
"#aa00ee": ["#aa00ee", "#8400b8", "#cf6bff"],
"#7a3cff": ["#7a3cff", "#5e23d6", "#a986ff"],
"#e0249a": ["#e0249a", "#b3157a", "#f06ec0"],
"#2f7bff": ["#2f7bff", "#1c5ad6", "#7aa9ff"]
};
function scrollToContact() {
document.getElementById("contato")?.scrollIntoView({ behavior: "smooth" });
}
function StickyCTA() {
const [show, setShow] = useState(false);
useEffect(() => {
const onScroll = () => {
const contato = document.getElementById("contato");
const past = window.scrollY > window.innerHeight * 0.7;
const nearForm = contato && contato.getBoundingClientRect().top < window.innerHeight * 0.9;
setShow(past && !nearForm);
};
window.addEventListener("scroll", onScroll, { passive: true });
onScroll();
return () => window.removeEventListener("scroll", onScroll);
}, []);
return (
);
}
function App() {
const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);
useEffect(() => {
const move = (e) => {
document.querySelectorAll(".spot-card").forEach((el) => {
const r = el.getBoundingClientRect();
el.style.setProperty("--x", e.clientX - r.left + "px");
el.style.setProperty("--y", e.clientY - r.top + "px");
});
};
window.addEventListener("pointermove", move, { passive: true });
return () => window.removeEventListener("pointermove", move);
}, []);
useEffect(() => {
const trio = ACCENTS[t.accent] || ACCENTS["#aa00ee"];
const r = document.documentElement.style;
r.setProperty("--purple", trio[0]);
r.setProperty("--purple-700", trio[1]);
r.setProperty("--purple-300", trio[2]);
r.setProperty("--purple-glow", trio[0] + "73");
}, [t.accent]);
useEffect(() => {
document.documentElement.style.setProperty("--title-font", t.titleFont);
document.querySelectorAll("h1,h2,h3,h4,.display,.h2,.h3").forEach((el) => el.style.fontFamily = `"${t.titleFont}", sans-serif`);
}, [t.titleFont, t.heroVariant]);
return (
<>
setTweak("heroVariant", v)} />
setTweak("accent", v)} />
setTweak("titleFont", v)} />
>);
}
ReactDOM.createRoot(document.getElementById("root")).render();