File size: 805 Bytes
27d39ac |
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 |
document.addEventListener('DOMContentLoaded', () => {
// Add interactive cursor effect
const cursor = document.createElement('div');
cursor.classList.add('cursor');
document.body.appendChild(cursor);
document.addEventListener('mousemove', (e) => {
cursor.style.left = e.clientX + 'px';
cursor.style.top = e.clientY + 'px';
});
// Add typewriter effect to the heading
const heading = document.querySelector('h1 span:last-child');
const text = heading.textContent;
heading.textContent = '';
let i = 0;
const typeWriter = () => {
if (i < text.length) {
heading.textContent += text.charAt(i);
i++;
setTimeout(typeWriter, 100);
}
};
setTimeout(typeWriter, 1000);
}); |