Untitled
unknown
plain_text
2 years ago
2.3 kB
2
Indexable
<!DOCTYPE html> <html> <head> <style> .container { position: relative; height: 300px; overflow: hidden; } .wave { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(to bottom, rgba(0, 0, 255, 0.4) 0%, rgba(0, 0, 255, 0) 100%); animation: waveAnimation 2s ease-in-out infinite; } @keyframes waveAnimation { 0% { transform: scaleY(1); } 50% { transform: scaleY(0.3); } 100% { transform: scaleY(1); } } .box { width: 50px; height: 50px; margin: 5px; display: inline-block; background-color: blue; animation: colorAnimation 2s infinite; } @keyframes colorAnimation { 0% { background-color: blue; } 50% { background-color: red; } 100% { background-color: blue; } } </style> </head> <body> <div class="container"> <div class="wave"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> </div> <script> // Function to generate a random color function getRandomColor() { var letters = '0123456789ABCDEF'; var color = '#'; for (var i = 0; i < 6; i++) { color += letters[Math.floor(Math.random() * 16)]; } return color; } // Function to update box colors function updateColors() { var boxes = document.getElementsByClassName('box'); for (var i = 0; i < boxes.length; i++) { var box = boxes[i]; box.style.backgroundColor = getRandomColor(); } } // Interval to update colors every 2 seconds setInterval(updateColors, 2000); </script> </body> </html>