// Love2 landing: aplica links do config.js, sombra do topo e entrada suave das seções. (function () { var cfg = window.LOVE2_CONFIG || {}; var map = { checkout: cfg.CHECKOUT_URL, app: cfg.APP_URL, whatsapp: cfg.WHATSAPP_URL, email: cfg.SUPPORT_EMAIL ? "mailto:" + cfg.SUPPORT_EMAIL : "", terms: cfg.TERMS_URL, privacy: cfg.PRIVACY_URL, }; document.querySelectorAll("[data-link]").forEach(function (a) { var url = map[a.getAttribute("data-link")]; if (!url || url === "#") return; a.setAttribute("href", url); if (/^https?:/.test(url)) a.setAttribute("rel", "noopener"); }); // FAQ em acordeão: abrir uma pergunta fecha as outras (reforço para navegadores sem
). var faqs = document.querySelectorAll(".faq details"); faqs.forEach(function (d) { d.addEventListener("toggle", function () { if (!d.open) return; faqs.forEach(function (o) { if (o !== d && o.open) o.open = false; }); }); }); var nav = document.querySelector(".nav"); var hero = document.querySelector("#abertura"); if (nav && hero && "IntersectionObserver" in window) { new IntersectionObserver(function (entries) { nav.classList.toggle("is-scrolled", !entries[0].isIntersecting); }, { rootMargin: "-64px 0px 0px 0px", threshold: 0.98 }).observe(hero); } var reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches; if (reduce || !("IntersectionObserver" in window)) return; var io = new IntersectionObserver(function (entries) { entries.forEach(function (e) { if (!e.isIntersecting) return; e.target.classList.add("is-in"); io.unobserve(e.target); }); }, { rootMargin: "0px 0px -8% 0px", threshold: 0.12 }); document.querySelectorAll(".reveal").forEach(function (el, i) { el.style.transitionDelay = (el.closest(".life__grid, .steps, .access__items") ? (i % 5) * 60 : 0) + "ms"; io.observe(el); }); })();