js+css实现儿童小学生英语学习练习游戏代码

代码语言:html

所属分类:游戏

代码描述:js+css实现儿童小学生英语学习练习游戏代码,包含看图识词、字母乐园、听音选词、单词拼写、句子填空、英语配对、日常对话、终极挑战8个关卡。

代码标签: 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>🌟 English Star - 英语小明星</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Comic Sans MS', 'Microsoft YaHei', cursive, sans-serif;
            background: linear-gradient(135deg, #ff6b6b 0%, #feca57 25%, #48dbfb 50%, #ff9ff3 75%, #54a0ff 100%);
            background-size: 400% 400%;
            animation: gradientShift 15s ease infinite;
            min-height: 100vh;
            overflow-x: hidden;
        }

        @keyframes gradientShift {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        /* 浮动气泡 */
        .bubbles {
            position: fixed;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
        }

        .bubble {
            position: absolute;
            bottom: -100px;
            background: rgba(255,255,255,0.2);
            border-radius: 50%;
            animation: rise 15s infinite ease-in;
        }

        .bubble:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-duration: 12s; }
        .bubble:nth-child(2) { width: 20px; height: 20px; left: 20%; animation-duration: 15s; animation-delay: 2s; }
        .bubble:nth-child(3) { width: 50px; height: 50px; left: 35%; animation-duration: 18s; animation-delay: 4s; }
        .bubble:nth-child(4) { width: 30px; height: 30px; left: 50%; animation-duration: 14s; animation-delay: 1s; }
        .bubble:nth-child(5) { width: 35px; height: 35px; left: 65%; animation-duration: 16s; animation-delay: 3s; }
        .bubble:nth-child(6) { width: 25px; height: 25px; left: 80%; animation-duration: 13s; animation-delay: 5s; }
        .bubble:nth-child(7) { width: 45px; height: 45px; left: 90%; animation-duration: 17s; animation-delay: 2s; }

        @keyframes rise {
            0% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
            100% { transform: translateY(-120vh) rotate(720deg); opacity: 0; }
        }

        /* 飞行字母 */
        .flying-letters {
            position: fixed;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
        }

        .fly-letter {
            position: absolute;
            font-size: 30px;
            font-weight: bold;
            color: rgba(255,255,255,0.3);
            animation: flyAcross 20s linear infinite;
        }

        @keyframes flyAcross {
            0% { transform: translateX(-100px) rotate(0deg); }
            100% { transform: translateX(calc(100vw + 100px)) rotate(360deg); }
        }

        /* 主容器 */
        .container {
            position: relative;
            z-index: 1;
            max-width: 1000px;
            margin: 0 auto;
            padding: 20px;
        }

        /* 顶部栏 */
        .header-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(255,255,255,0.95);
            border-radius: 30px;
            padding: 15px 30px;
            margin-bottom: 25px;
            box-shadow: 0 15px 50px rgba(0,0,0,0.15);
            backdrop-filter: blur(10px);
        }

        .profile-section {
            display: flex;
            align-items: center;
            gap: 18px;
        }

        .avatar-box {
            width: 70px;
            height: 70px;
            background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 8px 25px rgba(253,203,110,0.5);
            animation: avatarFloat 3s ease-in-out infinite;
        }

        .avatar-box:hover {
            transform: scale(1.15) rotate(15deg);
        }

        @keyframes avatarFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-8px); }
        }

        .user-details h3 {
            font-size: 20px;
            color: #2d3436;
            margin-bottom: 5px;
        }

        .rank-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: linear-gradient(135deg, #a29bfe, #6c5ce7);
            color: white;
            padding: 4px 15px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: bold;
        }

        .stats-section {
            display: flex;
            gap: 20px;
        }

        .stat-card {
            text-align: center;
            padding: 12px 25px;
            background: linear-gradient(135deg, #dfe6e9, #b2bec3);
            border-radius: 20px;
            min-width: 100px;
        }

        .stat-number {
            font-size: 28px;
            font-weight: bold;
            color: #6c5ce7;
        }

        .stat-label {
            font-size: 12px;
            color: #636e72;
            margin-top: 2px;
        }

        /* 主菜单 */
        .main-menu {
            text-align: center;
            padding: 30px 20px;
        }

        .logo-section {
            margin-bottom: 45px;
        }

        .logo-icon {
            font-size: 100px;
            display: inline-block;
            animation: logoSpin 4s ease-in-out infinite;
        }

        @keyframes logoSpin {
            0%, 100% { transform: scale(1) rotate(-5deg); }
            50% { transform: scale(1.1) rotate(5deg); }
        }

        .main-title {
            font-size: 58px;
            color: white;
            text-shadow: 5px 5px 0 #e17055, 10px 10px 0 rgba(0,0,0,0.1);
            margin: 15px 0;
            letter-spacing: 3px;
        }

        .main-subtitle {
            font-size: 24px;
            color: rgba(255,255,255,0.95);
            text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
        }

        /* 游戏卡片 */
        .games-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            max-width: 900px;
            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 35px rgba(0,0,0,0.12);
            position: relative;
            overflow: hidden;
        }

        .game-card::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .game-card:hover::before {
            opacity: 1;
        }

        .game-card:hover {
            transform: translateY(-15px) scale(1.05);
            box-shadow: 0 25px 60px rgba(0,0,0,0.2);
        }

        .game-card:active {
            transform: translateY(-5px) scale(0.98);
        }

        .game-icon {
            font-size: 50px;
            margin-bottom: 12px;
            display: inline-block;
            transition: transform 0.3s;
        }

        .game-card:hover .game-icon {
            transform: scale(1.3) rotate(10deg);
            animation: iconWiggle 0.5s ease;
        }

        @keyframes iconWiggle {
            0%, 100% { transform: scale(1.3) rotate(10deg); }
            25% { transform: scale(1.3) rotate(-10deg); }
            75% { transform: s.........完整代码请登录后点击上方下载按钮下载查看

网友评论0