// Modern Scripts for SmartSolTech Website document.addEventListener('DOMContentLoaded', function() { console.log('SmartSolTech: DOM loaded, initializing...'); // Hide loading screen const loadingScreen = document.getElementById('loading-screen'); if (loadingScreen) { console.log('SmartSolTech: Loading screen found, hiding...'); setTimeout(() => { loadingScreen.style.opacity = '0'; loadingScreen.style.pointerEvents = 'none'; setTimeout(() => { // Полностью удаляем элемент из DOM if (loadingScreen.parentNode) { loadingScreen.parentNode.removeChild(loadingScreen); console.log('SmartSolTech: Loading screen completely removed from DOM'); } }, 300); }, 200); // Уменьшили время ожидания до 200ms } else { console.log('SmartSolTech: Loading screen not found'); } // Navbar scroll behavior const navbar = document.querySelector('.navbar-modern'); if (navbar) { window.addEventListener('scroll', function() { if (window.scrollY > 50) { navbar.classList.add('scrolled'); } else { navbar.classList.remove('scrolled'); } }); } // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { const target = document.querySelector(this.getAttribute('href')); if (target) { e.preventDefault(); target.scrollIntoView({ behavior: 'smooth' }); } }); }); // Intersection Observer for animations 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); // Observe cards and service items document.querySelectorAll('.card-modern, .service-card, .step-card').forEach(card => { observer.observe(card); }); console.log('SmartSolTech: All scripts loaded successfully'); });