// Shared JavaScript across all pages document.addEventListener('DOMContentLoaded', function() { // Smooth scroll 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' }); } }); }); // Add fade-in animation to sections when they come into view const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }; const observer = new IntersectionObserver(function(entries) { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('fade-in'); } }); }, observerOptions); // Observe all sections document.querySelectorAll('section').forEach(section => { observer.observe(section); }); // Mobile menu toggle (if needed) const mobileMenuButton = document.getElementById('mobile-menu-button'); const mobileMenu = document.getElementById('mobile-menu'); if (mobileMenuButton && mobileMenu) { mobileMenuButton.addEventListener('click', function() { mobileMenu.classList.toggle('hidden'); }); } // Initialize Feather icons feather.replace(); }); // Form submission handler function handleFormSubmit(event) { event.preventDefault(); // Add form submission logic here console.log('Form submitted'); } // Contact form modal function openContactForm() { // Create modal overlay const modal = document.createElement('div'); modal.style.cssText = ` position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; z-index: 10000; backdrop-filter: blur(5px); `; modal.innerHTML = `
Мы свяжемся с вами в течение 30 минут