Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Uma resposta

Deixe um comentário para A WordPress Commenter Cancelar resposta

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

(function() { function splitWordsPreservandoEspacos(texto) { return (texto || "").match(/\S+|\s+/g) || []; } function prepararParagrafo(p) { if (!p || p.dataset.apReady === "1") return; const tokens = splitWordsPreservandoEspacos(p.textContent); p.textContent = ""; let wordIndex = 0; tokens.forEach(tok => { if (/^\s+$/.test(tok)) { p.appendChild(document.createTextNode(tok)); } else { const span = document.createElement("span"); span.className = "ap-word"; span.textContent = tok; span.style.setProperty("--ap-i", wordIndex); p.appendChild(span); wordIndex++; } }); p.dataset.apReady = "1"; } function resetInstantaneo(p) { if (!p) return; p.classList.remove("ap-visible"); p.querySelectorAll(".ap-word").forEach(w => { w.style.transition = "none"; w.style.opacity = "0"; w.style.transform = "translateY(16px)"; w.style.filter = "blur(8px)"; requestAnimationFrame(() => { requestAnimationFrame(() => { w.style.transition = ""; }); }); }); } let observer = new IntersectionObserver(entries => { entries.forEach(entry => { const el = entry.target; if (entry.isIntersecting) { el.classList.add("ap-visible"); } else { resetInstantaneo(el); } }); }, { threshold: 0.25 }); function iniciarAnimacoes(scope) { const ps = (scope || document).querySelectorAll(".animated-paragraph"); ps.forEach(p => { prepararParagrafo(p); observer.observe(p); }); } // Aguarda Elementor carregar antes de acessar hooks function whenElementorReady(callback, tentativas = 50) { if (window.elementorFrontend?.hooks) return callback(); if (tentativas <= 0) return; setTimeout(() => whenElementorReady(callback, tentativas - 1), 100); } document.addEventListener("DOMContentLoaded", function() { whenElementorReady(function() { elementorFrontend.hooks.addAction("frontend/element_ready/global", function($scope) { iniciarAnimacoes($scope[0] || $scope); }); }); // Fallback pra quando não for Elementor iniciarAnimacoes(document); }); })();