File size: 1,198 Bytes
c8a3bb1
ac6ce90
 
c8a3bb1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ac6ce90
c8a3bb1
ac6ce90
c8a3bb1
 
 
 
 
 
 
 
 
 
 
ac6ce90
c8a3bb1
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

// Main scripts for the application
document.addEventListener('DOMContentLoaded', function() {
  // Initialize animations
  const animateElements = () => {
    const elements = document.querySelectorAll('.animate-fade, .animate-slide');
    elements.forEach((el, i) => {
      el.style.animationDelay = `${i * 100}ms`;
      el.style.opacity = 0;
      setTimeout(() => {
        el.style.opacity = 1;
      }, i * 100);
    });
  };

  // Smooth scrolling for anchor links
  document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener('click', function(e) {
      e.preventDefault();
      const targetId = this.getAttribute('href');
      if (targetId !== '#') {
        document.querySelector(targetId).scrollIntoView({
          behavior: 'smooth'
        });
      }
    });
  });

  // Initialize mobile menu toggle
  document.addEventListener('click', (e) => {
    if (e.target.closest('[data-toggle-menu]')) {
      const menu = document.querySelector('mobile-menu');
      menu.hasAttribute('open') 
        ? menu.removeAttribute('open')
        : menu.setAttribute('open', '');
    }
  });

  // Initialize animations on page load
  animateElements();
});