Olá, mundo!

Boas-vindas ao WordPress. Esse é o seu primeiro post. Edite-o ou exclua-o, e então comece a escrever!

// SCROLL PROGRESS INDICATOR function updateScrollProgress() { const scrollTop = window.pageYOffset; const docHeight = document.documentElement.scrollHeight - window.innerHeight; const scrollPercent = (scrollTop / docHeight) * 100; const indicator = document.querySelector('.scroll-indicator'); if (indicator) { indicator.style.setProperty('--scroll-progress', scrollPercent + '%'); } } window.addEventListener('scroll', updateScrollProgress); // INTERSECTION OBSERVER PARA ANIMAÇÕES const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }; const animationObserver = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('animate-fade-in-up'); animationObserver.unobserve(entry.target); } }); }, observerOptions); // Aplicar animações automaticamente document.addEventListener('DOMContentLoaded', function() { // Elementos que devem animar const animateElements = document.querySelectorAll( '.material-card, .contact-item, .footer-column, .stat-item, .hero-content > *' ); animateElements.forEach(el => { el.style.opacity = '0'; el.style.transform = 'translateY(30px)'; el.style.transition = 'all 0.6s ease'; animationObserver.observe(el); }); }); // SMOOTH SCROLL PARA LINKS INTERNOS document.querySelectorAll('a[href^="#"]').forEach(link => { link.addEventListener('click', function(e) { e.preventDefault(); const targetId = this.getAttribute('href').substring(1); const targetElement = document.getElementById(targetId); if (targetElement) { targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // LAZY LOADING PARA IMAGENS if ('IntersectionObserver' in window) { const imageObserver = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { const img = entry.target; img.src = img.dataset.src; img.classList.remove('lazy'); imageObserver.unobserve(img); } }); }); document.querySelectorAll('img[data-src]').forEach(img => { imageObserver.observe(img); }); } // PERFORMANCE OPTIMIZATION window.addEventListener('load', function() { // Preload critical resources const criticalResources = [ 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap' ]; criticalResources.forEach(resource => { const link = document.createElement('link'); link.rel = 'preload'; link.href = resource; link.as = 'style'; document.head.appendChild(link); }); });