Spaces:
Running
Running
File size: 1,211 Bytes
8c78f48 | 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 | // Initialize tooltips
document.addEventListener('DOMContentLoaded', () => {
// Add any interactive elements here
const buttons = document.querySelectorAll('button');
buttons.forEach(button => {
button.addEventListener('mouseenter', () => {
button.classList.add('glow');
});
button.addEventListener('mouseleave', () => {
button.classList.remove('glow');
});
});
// Rainbow text effect for h1
const rainbowText = document.querySelector('h1');
if (rainbowText) {
rainbowText.innerHTML = rainbowText.textContent.split('').map((char, i) =>
`<span style="animation: rainbow 8s linear infinite ${i * 0.1}s;">${char}</span>`
).join('');
}
});
// Add rainbow animation to style dynamically
const style = document.createElement('style');
style.textContent = `
@keyframes rainbow {
0% { color: #ff0000; }
14% { color: #ff7f00; }
28% { color: #ffff00; }
42% { color: #00ff00; }
57% { color: #0000ff; }
71% { color: #4b0082; }
85% { color: #9400d3; }
100% { color: #ff0000; }
}
`;
document.head.appendChild(style); |