File size: 2,592 Bytes
01926e2
c5ded71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
01926e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

// User profile data - replace with your actual information
const userData = {
    name: "Your Name",
    title: "Your Profession",
    cvUrl: "#", // Replace with your CV download link
    linkedin: "#", // Replace with your LinkedIn profile URL
    medium: "#", // Replace with your Medium profile URL
    scholar: "#"  // Replace with your Google Scholar profile URL
};

// Set user data on page load
document.addEventListener('DOMContentLoaded', () => {
    document.getElementById('userName').textContent = userData.name;
    document.getElementById('userTitle').textContent = userData.title;
    
    const cvDownload = document.getElementById('cvDownload');
    const linkedinLink = document.getElementById('linkedinLink');
    const mediumLink = document.getElementById('mediumLink');
    const scholarLink = document.getElementById('scholarLink');
    
    if (cvDownload) cvDownload.href = userData.cvUrl;
    if (linkedinLink) linkedinLink.href = userData.linkedin;
    if (mediumLink) mediumLink.href = userData.medium;
    if (scholarLink) scholarLink.href = userData.scholar;
});

// Intersection Observer for section animations
const observer = new IntersectionObserver((entries) => {
    entries.forEach(entry => {
        if (entry.isIntersecting) {
            entry.target.classList.add('visible');
        }
    });
}, {
    threshold: 0.1
});
document.querySelectorAll('section').forEach(section => {
    observer.observe(section);
});

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

// Close mobile menu when clicking a link
document.addEventListener('click', function(e) {
    if (e.target.matches('a[href^="#"]')) {
        const mobileMenu = document.querySelector('custom-navbar').shadowRoot.getElementById('mobileMenu');
        if (mobileMenu && !mobileMenu.classList.contains('hidden')) {
            mobileMenu.classList.add('hidden');
            const menuButton = document.querySelector('custom-navbar').shadowRoot.getElementById('mobileMenuButton');
            if (menuButton) {
                const icon = menuButton.querySelector('i');
                icon.setAttribute('data-feather', 'menu');
                feather.replace();
            }
        }
    }
});