Spaces:
Running
Running
| 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)'; | |
| }); | |
| }); | |
| }); |