Spaces:
Running
Running
| // Main script for undefined universe | |
| document.addEventListener('DOMContentLoaded', function() { | |
| console.log('Welcome to the Undefined Universe! 🌀'); | |
| // Add some undefined magic to the page | |
| const elements = document.querySelectorAll('.bg-undefined-500, .bg-undefined-600, .bg-undefined-700'); | |
| elements.forEach(element => { | |
| element.addEventListener('mouseenter', function() { | |
| this.classList.add('undefined-glow', 'transition-all', 'duration-300'); | |
| }); | |
| element.addEventListener('mouseleave', function() { | |
| this.classList.remove('undefined-glow'); | |
| }); | |
| }); | |
| // Add undefined animation to main heading | |
| const mainHeading = document.querySelector('h1'); | |
| if (mainHeading) { | |
| mainHeading.classList.add('undefined-pulse'); | |
| } | |
| // Random undefined color generator for fun | |
| const undefinedColors = ['bg-undefined-400', 'bg-undefined-500', 'bg-undefined-600', 'bg-undefined-700']; | |
| const randomElements = document.querySelectorAll('.bg-white'); | |
| setInterval(() => { | |
| randomElements.forEach(element => { | |
| const randomColor = undefinedColors[Math.floor(Math.random() * undefinedColors.length)]; | |
| element.classList.remove(...undefinedColors); | |
| element.classList.add(randomColor); | |
| }); | |
| }, 3000); | |
| }); |