File size: 2,934 Bytes
dc967a7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
// 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 = `
<a href="https://telegram.org" target="_blank" class="fixed bottom-6 right-6 bg-blue-500 text-white p-4 rounded-full shadow-lg hover:bg-blue-600 transition duration-300 z-50">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 5L2 12.5L9 13.5M21 5L18.5 20L9 13.5M21 5L9 13.5M9 13.5V19L12.5 15.5"/>
</svg>
</a>
`;
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'); |