// Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // Floating CTA visibility const floatingCta = document.getElementById('floatingCta'); const heroSection = document.querySelector('.hero'); function toggleFloatingCta() { const heroBottom = heroSection.offsetTop + heroSection.offsetHeight; const scrollPosition = window.pageYOffset; if (scrollPosition > heroBottom) { floatingCta.classList.add('show'); } else { floatingCta.classList.remove('show'); } } window.addEventListener('scroll', toggleFloatingCta); // --- Removido o alerta de redirecionamento --- // Agora todos os botões funcionam apenas como links normais para a Kiwify // Animações de scroll const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.style.opacity = '1'; entry.target.style.transform = 'translateY(0)'; } }); }, observerOptions); document.querySelectorAll('.benefit-card, .course-category, .audience-card, .bonus-card, .faq-item').forEach(el => { el.style.opacity = '0'; el.style.transform = 'translateY(30px)'; el.style.transition = 'opacity 0.6s ease, transform 0.6s ease'; observer.observe(el); }); window.addEventListener('load', () => { document.body.style.opacity = '1'; }); document.body.style.opacity = '0'; document.body.style.transition = 'opacity 0.5s ease'; if ('ontouchstart' in window) { document.querySelectorAll('.benefit-card, .audience-card, .bonus-card, .faq-item').forEach(card => { card.addEventListener('touchstart', function() { this.style.transform = 'translateY(-5px)'; }); card.addEventListener('touchend', function() { setTimeout(() => { this.style.transform = 'translateY(0)'; }, 150); }); }); }