js实现补齐成语文字游戏代码
代码语言:html
所属分类:游戏
代码描述:js实现补齐成语文字游戏代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!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; background-color: #f0f0f0; text-align: center; } .container { margin: 50px auto; padding: 20px; background: white; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); max-width: 400px; } h1 { color: #333; } .option { display: inline-block; margin: 10px; padding: 10px 20px; background: #007bff; color: white; border-radius: 5px; cursor: pointer; transition: background 0.3s; } .option:hover { background: #0056b3; } .error { animation: shake 0.5s; } @keyframes shake { 0% { transform: translate(1px, 0); } 25% { transform: translate(-1px, 0); } 50% { transform: translate(1px, 0); } 75% { transform: translate(-1px, 0); } 100% { transform: translate(0, 0); } } </style> </head> <body> <div class="container"> <h1>补齐成语文字游戏</h1> <div id="idiom"></div> <div id="options"></div> <button id="next" style="display: none;">下一个</button> </div> <script> const idioms = [ { idiom: "一帆____", answer: "风顺", options: ["风顺", "如意", "顺风"] }, { idiom: "半途____", answer: ".........完整代码请登录后点击上方下载按钮下载查看
网友评论0