Spaces:
Running
Running
File size: 1,281 Bytes
694552a | 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 | document.addEventListener('DOMContentLoaded', () => {
// Make each loader container clickable to toggle animation
const loaders = document.querySelectorAll('.pixel-loader');
loaders.forEach(loader => {
loader.addEventListener('click', () => {
const isPaused = loader.style.animationPlayState === 'paused';
loader.style.animationPlayState = isPaused ? 'running' : 'paused';
// Also pause all child pixel animations
const pixels = loader.querySelectorAll('.pixel');
pixels.forEach(pixel => {
pixel.style.animationPlayState = isPaused ? 'running' : 'paused';
});
});
});
// Add some fun hover effects
const cards = document.querySelectorAll('main > div');
cards.forEach(card => {
card.addEventListener('mouseenter', () => {
card.classList.add('transform', 'scale-105');
card.classList.remove('shadow-md');
card.classList.add('shadow-lg');
});
card.addEventListener('mouseleave', () => {
card.classList.remove('transform', 'scale-105');
card.classList.add('shadow-md');
card.classList.remove('shadow-lg');
});
});
}); |