| |
| const services = [ |
| "Telegram Promotion", |
| "Telegram Ads", |
| "Telegram Bot Development", |
| "App Development", |
| "Music Marketing", |
| "Crypto Marketing" |
| ]; |
|
|
| let currentServiceIndex = 0; |
| const serviceTextElement = document.getElementById('serviceText'); |
|
|
| function rotateServices() { |
| currentServiceIndex = (currentServiceIndex + 1) % services.length; |
| serviceTextElement.style.opacity = '0'; |
| |
| setTimeout(() => { |
| serviceTextElement.textContent = services[currentServiceIndex]; |
| serviceTextElement.style.opacity = '1'; |
| }, 500); |
| } |
|
|
| setInterval(rotateServices, 3000); |
|
|
| |
| 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' |
| }); |
| } |
| }); |
| }); |
|
|
| |
| const mobileMenuBtn = document.getElementById('mobileMenuBtn'); |
| if (mobileMenuBtn) { |
| mobileMenuBtn.addEventListener('click', function() { |
| |
| console.log('Mobile menu toggled'); |
| }); |
| } |
|
|
| |
| document.querySelectorAll('.rating-stars').forEach(ratingGroup => { |
| const stars = ratingGroup.querySelectorAll('i'); |
| let rating = 0; |
|
|
| stars.forEach((star, index) => { |
| star.addEventListener('click', () => { |
| rating = index + 1; |
| updateStars(); |
| }); |
|
|
| star.addEventListener('mouseenter', () => { |
| stars.forEach((s, i) => { |
| if (i <= index) { |
| s.classList.add('text-yellow-400'); |
| s.classList.remove('text-gray-600'); |
| } else { |
| s.classList.remove('text-yellow-400'); |
| s.classList.add('text-gray-600'); |
| } |
| }); |
| }); |
| }); |
|
|
| ratingGroup.addEventListener('mouseleave', updateStars); |
|
|
| function updateStars() { |
| stars.forEach((s, i) => { |
| if (i < rating) { |
| s.classList.add('text-yellow-400', 'star-glow'); |
| s.classList.remove('text-gray-600'); |
| } else { |
| s.classList.remove('text-yellow-400', 'star-glow'); |
| s.classList.add('text-gray-600'); |
| } |
| }); |
| } |
| }); |
|
|
| |
| document.getElementById('reviewForm').addEventListener('submit', function(e) { |
| e.preventDefault(); |
| |
| |
| const successMessage = document.getElementById('successMessage'); |
| successMessage.classList.remove('hidden'); |
| successMessage.classList.add('success-checkmark'); |
| |
| |
| this.reset(); |
| |
| |
| document.querySelectorAll('.rating-stars i').forEach(star => { |
| star.classList.remove('text-yellow-400', 'star-glow'); |
| star.classList.add('text-gray-600'); |
| }); |
| |
| |
| setTimeout(() => { |
| successMessage.classList.add('hidden'); |
| }, 5000); |
| }); |
|
|
| |
| document.getElementById('contactForm').addEventListener('submit', function(e) { |
| e.preventDefault(); |
| |
| |
| const submitBtn = this.querySelector('button[type="submit"]'); |
| const originalText = submitBtn.innerHTML; |
| submitBtn.innerHTML = '<div class="loading-spinner mx-auto"></div>'; |
| submitBtn.disabled = true; |
| |
| |
| setTimeout(() => { |
| |
| const successMessage = document.getElementById('contactSuccess'); |
| successMessage.classList.remove('hidden'); |
| successMessage.classList.add('success-checkmark'); |
| |
| |
| this.reset(); |
| submitBtn.innerHTML = originalText; |
| submitBtn.disabled = false; |
| |
| |
| setTimeout(() => { |
| successMessage.classList.add('hidden'); |
| }, 5000); |
| }, 1500); |
| }); |
|
|
| |
| const observerOptions = { |
| threshold: 0.1, |
| rootMargin: '0px 0px -50px 0px' |
| }; |
|
|
| const observer = new IntersectionObserver((entries) => { |
| entries.forEach(entry => { |
| if (entry.isIntersecting) { |
| entry.target.classList.add('animate-slide-up'); |
| entry.target.style.opacity = '1'; |
| } |
| }); |
| }, observerOptions); |
|
|
| |
| document.querySelectorAll('.glass-morphism').forEach(el => { |
| el.style.opacity = '0'; |
| observer.observe(el); |
| }); |
|
|
| |
| window.addEventListener('scroll', () => { |
| const scrolled = window.pageYOffset; |
| const shapes = document.querySelectorAll('.floating-shape'); |
| |
| shapes.forEach((shape, index) => { |
| const speed = 1 + (index * 0.5); |
| shape.style.transform = `translateY(${scrolled * speed * 0.1}px)`; |
| }); |
| }); |
|
|
| |
| document.querySelectorAll('.glass-morphism').forEach(card => { |
| card.addEventListener('mouseenter', function() { |
| this.classList.add('hover-lift'); |
| }); |
| |
| card.addEventListener('mouseleave', function() { |
| this.classList.remove('hover-lift'); |
| }); |
| }); |
|
|
| |
| const yearElement = document.querySelector('footer p'); |
| if (yearElement && yearElement.textContent.includes('2024')) { |
| yearElement.innerHTML = yearElement.innerHTML.replace('2024', new Date().getFullYear()); |
| } |
|
|
| |
| document.querySelector('footer button')?.addEventListener('click', function(e) { |
| e.preventDefault(); |
| const emailInput = this.previousElementSibling; |
| if (emailInput && emailInput.value) { |
| |
| emailInput.value = ''; |
| emailInput.placeholder = 'Subscribed! ✓'; |
| setTimeout(() => { |
| emailInput.placeholder = 'Your email'; |
| }, 3000); |
| } |
| }); |
|
|
| |
| document.addEventListener('keydown', (e) => { |
| if (e.key === 'Escape') { |
| |
| document.querySelectorAll('.mobile-menu.active').forEach(menu => { |
| menu.classList.remove('active'); |
| }); |
| } |
| }); |
|
|
| |
| function debounce(func, wait) { |
| let timeout; |
| return function executedFunction(...args) { |
| const later = () => { |
| clearTimeout(timeout); |
| func(...args); |
| }; |
| clearTimeout(timeout); |
| timeout = setTimeout(later, wait); |
| }; |
| } |
|
|
| |
| window.addEventListener('scroll', debounce(() => { |
| const scrolled = window.pageYOffset; |
| const shapes = document.querySelectorAll('.floating-shape'); |
| |
| shapes.forEach((shape, index) => { |
| const speed = 1 + (index * 0.5); |
| shape.style.transform = `translateY(${scrolled * speed * 0.1}px)`; |
| }); |
| }, 10)); |
|
|
| |
| function initFeatherIcons() { |
| feather.replace(); |
| } |
|
|
| |
| document.addEventListener('DOMContentLoaded', initFeatherIcons); |