Spaces:
Running

File size: 3,589 Bytes
b58dab8
99467e2
27ef0a8
 
99467e2
27ef0a8
 
b58dab8
6d80bc9
 
 
 
 
 
 
 
 
 
 
 
 
 
b58dab8
 
 
 
6d80bc9
 
 
 
 
 
b58dab8
 
 
 
 
 
 
 
 
6d80bc9
 
 
 
 
b58dab8
 
6d80bc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

document.addEventListener('DOMContentLoaded', function() {
    // Initialize chart
    initChart();
    
    // Setup event listeners
    setupEventListeners();

    // Add smooth scroll behavior
    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'
                });
            }
        });
    });

    // Mobile menu toggle
    document.addEventListener('click', function(e) {
        if (e.target.closest('.menu-button')) {
            const sidebar = document.querySelector('custom-sidebar');
            if (sidebar) {
                const aside = sidebar.shadowRoot.querySelector('aside');
                aside.classList.toggle('open');
                // Add animation class
                aside.style.transform = aside.classList.contains('open') ? 'translateX(0)' : 'translateX(-100%)';
            }
        }
    });

    // Close sidebar when clicking outside on mobile
    document.addEventListener('click', function(e) {
        const sidebar = document.querySelector('custom-sidebar');
        if (window.innerWidth < 1024 && sidebar && 
            !e.target.closest('custom-sidebar') && 
            !e.target.closest('.menu-button')) {
            const aside = sidebar.shadowRoot.querySelector('aside');
            if (aside.classList.contains('open')) {
                aside.classList.remove('open');
                aside.style.transform = 'translateX(-100%)';
            }
        }
    });

    // Add parallax effect to cards
    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 all cards
    document.querySelectorAll('.group').forEach(card => {
        card.style.opacity = '0';
        card.style.transform = 'translateY(20px)';
        card.style.transition = 'all 0.6s cubic-bezier(0.4, 0, 0.2, 1)';
        observer.observe(card);
    });

    // Add interactive hover effects
    document.querySelectorAll('button, .activity-item').forEach(element => {
        element.addEventListener('mouseenter', function() {
            this.style.transform = 'scale(1.05)';
        });
        element.addEventListener('mouseleave', function() {
            this.style.transform = 'scale(1)';
        });
    });

    // Initialize tooltips
    document.querySelectorAll('[data-tooltip]').forEach(element => {
        element.addEventListener('mouseenter', function(e) {
            const tooltip = document.createElement('div');
            tooltip.className = 'absolute bg-gray-800 text-white text-xs rounded px-2 py-1 z-50';
            tooltip.textContent = this.getAttribute('data-tooltip');
            tooltip.style.top = e.pageY - 30 + 'px';
            tooltip.style.left = e.pageX + 10 + 'px';
            document.body.appendChild(tooltip);
        });
        
        element.addEventListener('mouseleave', function() {
            const tooltip = document.querySelector('.absolute.bg-gray-800');
            if (tooltip) tooltip.remove();
        });
    });