可以试试这个语音猜数字的儿童小游戏,通过语音识别来获取你的数字进行比较反馈。
完整代码:
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>猜数字语音游戏</title> <style> body { font-family: Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: #f0f0f0; } .game-container { text-align: center; background-color: white; padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0,0,0,0.1); } #character { width: 200px; height: 200px; margin: 20px auto; background-color: #ffd700; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 100px; } button { background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; border-radius: 5px; } </style> </head> <body> <div class="game-container"> <h1>猜数字游戏</h1> <p>我想了一个1到10之间的数字,你能猜出来吗?</p> <div id="character">
网友回复