// Demo video modal document.addEventListener('DOMContentLoaded', function() { simulateTelegramBot(); // Smooth scroll for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); // Animation on scroll const animateOnScroll = function() { const elements = document.querySelectorAll('.feature-card, .testimonial-card, .pricing-card'); elements.forEach(element => { const elementPosition = element.getBoundingClientRect().top; const screenPosition = window.innerHeight / 1.3; if (elementPosition < screenPosition) { element.classList.add('animate-fade-in'); } }); }; window.addEventListener('scroll', animateOnScroll); animateOnScroll(); // Trigger on load // Video modal functionality const videoModal = document.getElementById('video-modal'); const videoThumbnail = document.querySelector('.video-thumbnail'); const closeModal = document.querySelector('.close-modal'); if (videoThumbnail) { videoThumbnail.addEventListener('click', function() { videoModal.classList.remove('hidden'); document.body.style.overflow = 'hidden'; }); } if (closeModal) { closeModal.addEventListener('click', function() { videoModal.classList.add('hidden'); document.body.style.overflow = 'auto'; }); } // Close modal when clicking outside window.addEventListener('click', function(e) { if (e.target === videoModal) { videoModal.classList.add('hidden'); document.body.style.overflow = 'auto'; } }); }); // Telegram bot simulation function simulateTelegramBot() { const telegramBtn = document.createElement('div'); telegramBtn.innerHTML = ` `; document.body.appendChild(telegramBtn); } // Form validation for newsletter signup function validateNewsletterForm() { const emailInput = document.getElementById('newsletter-email'); const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(emailInput.value)) { alert('Please enter a valid email address');