js+css实现儿童小学生数学运算答题小游戏代码
代码语言:html
所属分类:游戏
代码描述:js+css实现儿童小学生数学运算答题小游戏代码,包含、加法乐园练习加法运算、减法城堡练习减法运算、乘法王国九九乘法表、除法森林练习除法运算、比大小数字大小比较、应用题 解决生活问题、图形乐园、认识几何图、认识时间 学看钟表时间、BOSS挑战、综合大挑战
代码标签: js+css 儿童 小学生 数学 运算 答题 小游戏 代码
下面为部分代码预览,完整代码请点击下载或在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>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Microsoft YaHei', sans-serif;
background: linear-gradient(135deg, #00b894 0%, #00cec9 50%, #0984e3 100%);
min-height: 100vh;
overflow-x: hidden;
}
/* 动态背景 */
.bg-shapes {
position: fixed;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 0;
overflow: hidden;
}
.shape {
position: absolute;
opacity: 0.1;
animation: floatShape 15s infinite ease-in-out;
}
.shape-1 { font-size: 60px; top: 10%; left: 5%; animation-delay: 0s; }
.shape-2 { font-size: 80px; top: 30%; right: 10%; animation-delay: 2s; }
.shape-3 { font-size: 50px; top: 60%; left: 15%; animation-delay: 4s; }
.shape-4 { font-size: 70px; top: 80%; right: 20%; animation-delay: 6s; }
.shape-5 { font-size: 55px; top: 45%; left: 80%; animation-delay: 8s; }
.shape-6 { font-size: 65px; top: 20%; left: 50%; animation-delay: 3s; }
@keyframes floatShape {
0%, 100% { transform: translateY(0) rotate(0deg); }
25% { transform: translateY(-20px) rotate(90deg); }
50% { transform: translateY(0) rotate(180deg); }
75% { transform: translateY(20px) rotate(270deg); }
}
/* 彩虹条 */
.rainbow-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 5px;
background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #5f27cd);
background-size: 200% 100%;
animation: rainbowMove 3s linear infinite;
z-index: 1000;
}
@keyframes rainbowMove {
0% { background-position: 0% 0%; }
100% { background-position: 200% 0%; }
}
/* 主容器 */
.game-container {
position: relative;
z-index: 1;
max-width: 950px;
margin: 0 auto;
padding: 20px;
}
/* 顶部导航 */
.top-bar {
display: flex;
justify-content: space-between;
align-items: center;
background: rgba(255,255,255,0.95);
border-radius: 25px;
padding: 15px 25px;
margin-bottom: 25px;
box-shadow: 0 10px 40px rgba(0,0,0,0.1);
backdrop-filter: blur(10px);
}
.user-profile {
display: flex;
align-items: center;
gap: 15px;
}
.avatar-circle {
width: 65px;
height: 65px;
background: linear-gradient(135deg, #ffecd2, #fcb69f);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 35px;
box-shadow: 0 5px 20px rgba(252,182,159,0.5);
animation: avatarPulse 2s infinite;
cursor: pointer;
transition: transform 0.3s;
}
.avatar-circle:hover {
transform: scale(1.1) rotate(10deg);
}
@keyframes avatarPulse {
0%, 100% { box-shadow: 0 5px 20px rgba(252,182,159,0.5); }
50% { box-shadow: 0 5px 30px rgba(252,182,159,0.8); }
}
.user-info h3 {
font-size: 18px;
color: #2d3436;
margin-bottom: 3px;
}
.user-level {
display: flex;
align-items: center;
gap: 8px;
}
.level-badge {
background: linear-gradient(135deg, #f093fb, #f5576c);
color: white;
padding: 3px 12px;
border-radius: 15px;
font-size: 12px;
font-weight: bold;
}
.exp-bar {
width: 80px;
height: 8px;
background: #eee;
border-radius: 10px;
overflow: hidden;
}
.exp-fill {
height: 100%;
background: linear-gradient(90deg, #f093fb, #f5576c);
border-radius: 10px;
transition: width 0.5s;
}
.stats-row {
display: flex;
gap: 15px;
}
.stat-box {
text-align: center;
padding: 12px 20px;
background: linear-gradient(135deg, #a8edea, #fed6e3);
border-radius: 18px;
min-width: 90px;
}
.stat-num {
font-size: 26px;
font-weight: bold;
background: linear-gradient(135deg, #667eea, #764ba2);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.stat-txt {
font-size: 11px;
color: #666;
margin-top: 2px;
}
/* 主菜单 */
.main-menu {
text-align: center;
padding: 30px 20px;
}
.logo-area {
margin-bottom: 40px;
}
.main-title {
font-size: 52px;
color: white;
text-shadow: 4px 4px 0 #e17055, 8px 8px 0 rgba(0,0,0,0.1);
margin-bottom: 10px;
animation: titleBounce 2s ease-in-out infinite;
}
@keyframes titleBounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-15px); }
}
.sub-title {
font-size: 22px;
color: rgba(255,255,255,0.95);
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.mascot {
font-size: 80px;
display: inline-block;
animation: mascotDance 1s ease-in-out infinite;
}
@keyframes mascotDance {
0%, 100% { transform: rotate(-5deg); }
50% { transform: rotate(5deg); }
}
/* 游戏卡片网格 */
.game-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
max-width: 750px;
margin: 0 auto;
}
.game-card {
background: white;
border-radius: 25px;
padding: 25px 15px;
cursor: pointer;
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
position: relative;
overflow: hidden;
}
.game-card::after {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
transition: left 0.5s;
}
.game-card:hover::after {
le.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0