js实现补齐成语文字游戏代码
代码语言:html
所属分类:游戏
代码描述:js实现补齐成语文字游戏代码,正确和错误都有动画。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<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 {
background-color: white;
border-radius: 10px;
padding: 20px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
text-align: center;
max-width: 90%;
width: 300px;
}
.idiom {
font-size: 24px;
margin-bottom: 20px;
}
.options {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
}
.option {
background-color: #4CAF50;
border: none;
color: white;
padding: 10px 0;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s;
}
.option:hover {
background-color: #45a049;
}
.option.wrong {
animation: shake 0.5s;
background-color: #f44336;
}
.option.correct {
animation: pulse 0.5s;
background-color: #4CAF50;
}
@keyframes shake {
0%.........完整代码请登录后点击上方下载按钮下载查看
网友评论0