File size: 944 Bytes
ffe0e1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
document.addEventListener('DOMContentLoaded', () => {
    // Typewriter effect for subtitle
    const subtitle = document.querySelector('.text-xl');
    if (subtitle) {
        const text = subtitle.textContent;
        subtitle.textContent = '';
        
        let i = 0;
        const typeWriter = () => {
            if (i < text.length) {
                subtitle.textContent += text.charAt(i);
                i++;
                setTimeout(typeWriter, Math.random() * 100 + 50);
            }
        }
        typeWriter();
    }

    // Add hover effect to all article cards
    const articles = document.querySelectorAll('article');
    articles.forEach(article => {
        article.addEventListener('mouseenter', () => {
            article.style.transform = 'translate(-4px, -4px)';
        });
        article.addEventListener('mouseleave', () => {
            article.style.transform = 'translate(0, 0)';
        });
    });
});