酷代码 AI
菜单
全部AI  /  热门  /  AI写代码神器
服务商

帮我生成一个html网页代码,用代码实现一条龙在代码雨中穿梭,最后在中央展现一个龙头的代码标志

<!DOCTYPE html> <html> <head> <title>Code Rain with Dragon</title> <style> body { background-color: #000; overflow: hidden; font-family: monospace; color: #0F0; } #dragon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 30px; } .code { position: absolute; color: #0F0; } </style> </head> <body> <div id="dragon"></div> <script> const dragon = document.getElementById('dragon'); const codeRain = []; const codeChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; const codeCharsLength = codeChars.length; for (let i = 0; i < 100; i++) { const code = document.createElement('div'); code.className = 'code'; code.style.left = Math.floor(Math.random() * window.innerWidth) + 'px'; code.style.top = Math.floor(Math.random() * window.innerHeight) + 'px'; code.textContent = codeChars.charAt(Math.floor(Math.random() * codeCharsLength)); codeRain.push(code); document.body.appendChild(code); } function updateCodeRain() { codeRain.forEach(code => { const top = parseInt(code.style.top); code.style.top = (top >= window.innerHeight) ? '0px' : (top + 3) + 'px'; }); requestAnimationFrame(updateCodeRain); } updateCodeRain(); </script> </body> </html> [2024-08-23 20:14:26 | AI写代码神器 | 1103点数解答]

相关提问