| |
| console.log('Peec AI Platform loaded'); |
|
|
| |
| document.addEventListener('DOMContentLoaded', function() { |
| |
| const observerOptions = { |
| threshold: 0.1, |
| rootMargin: '0px 0px -50px 0px' |
| }); |
|
|
| |
| 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' |
| }); |
| } |
| }); |
| }); |
|
|
| |
| document.querySelectorAll('a[href*="app.peec.ai"]').forEach(button => { |
| button.addEventListener('click', function() { |
| this.classList.add('loading'); |
| setTimeout(() => { |
| this.classList.remove('loading'); |
| }, 2000); |
| }); |
| }); |
| } |
|
|
| |
| function initMobileMenu() { |
| const mobileMenuButton = document.querySelector('[data-mobile-menu-button]'); |
| const mobileMenu = document.querySelector('[data-mobile-menu]'); |
|
|
| if (mobileMenuButton && mobileMenu) { |
| mobileMenuButton.addEventListener('click', function() { |
| mobileMenu.classList.toggle('hidden'); |
| }); |
| } |
| } |
|
|
| initMobileMenu(); |
|
|
| |
| window.addEventListener('load', function() { |
| const loadTime = performance.timing.loadEventEnd - performance.timing.navigationStart; |
| console.log(`Page loaded in ${loadTime}ms`); |
| }); |