🎮ArcadeLab

中华乐器知多少·答题小游戏

by GlitchFlare80
180 lines5.2 KB
▶ Play
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <title>中华乐器知多少·答题小游戏</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "微软雅黑",sans-serif;
        }
        body{
            min-height: 100vh;
            background: linear-gradient(135deg, #fdf6e9 0%, #f0e6d2 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px 15px;
            color: #3d2b1e;
        }
        .game-title{
            font-size: 26px;
            color: #8b4513;
            text-align: center;
            margin-bottom: 8px;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
        }
        .game-sub{
            font-size: 14px;
            color: #6b4423;
            margin-bottom: 20px;
            text-align: center;
        }
        .score-box{
            display: flex;
            gap: 30px;
            margin-bottom: 20px;
            font-size: 16px;
            font-weight: bold;
        }
        .score-item{
            padding: 6px 12px;
            background: #fff;
            border-radius: 20px;
            border: 1px solid #d2b48c;
        }
        .quiz-card{
            width: 100%;
            max-width: 380px;
            background: #fff;
            border-radius: 16px;
            padding: 25px 20px;
            box-shadow: 0 4px 12px rgba(139,69,19,0.15);
            margin-bottom: 25px;
        }
        .question{
            font-size: 18px;
            line-height: 1.6;
            margin-bottom: 20px;
            text-align: center;
            font-weight: 500;
        }
        .options{
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .option-btn{
            padding: 14px;
            border: 2px solid #d2b48c;
            border-radius: 10px;
            background: #faf6f0;
            font-size: 16px;
            color: #3d2b1e;
            cursor: pointer;
            transition: all 0.3s;
            text-align: left;
        }
        .option-btn:hover{
            background: #f5e9d7;
            border-color: #b8860b;
        }
        .option-btn.correct{
            background: #e6f7e6;
            border-color: #2e8b57;
            color: #1a5c1a;
        }
        .option-btn.wrong{
            background: #ffeaea;
            border-color: #cd5c5c;
            color: #8b3a3a;
        }
        .tip-text{
            margin-top: 15px;
            padding: 10px;
            background: #fef8e8;
            border-radius: 8px;
            font-size: 14px;
            color: #8b4513;
            display: none;
        }
        .control-box{
            display: flex;
            gap: 15px;
        }
        .ctrl-btn{
            padding: 12px 24px;
            border: none;
            border-radius: 30px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: 0.3s;
        }
        .btn-next{
            background: #8b4513;
            color: #fff;
        }
        .btn-restart{
            background: #b8860b;
            color: #fff;
        }
        .ctrl-btn:disabled{
            opacity: 0.5;
            cursor: not-allowed;
        }
        .game-over{
            text-align: center;
            padding: 30px 20px;
            display: none;
        }
        .over-title{
            font-size: 24px;
            color: #8b4513;
            margin-bottom: 15px;
        }
        .over-score{
            font-size: 18px;
            margin-bottom: 25px;
        }
    </style>
</head>
<body>
    <h1 class="game-title">中华乐器知多少</h1>
    <p class="game-sub">传统民乐知识答题闯关 | 感受国乐之美</p>

    <div class="score-box">
        <div class="score-item">当前题号:<span id="qNum">1</span>/10</div>
        <div class="score-item">得分:<span id="score">0</span></div>
    </div>

    <div class="quiz-card" id="quizBox">
        <div class="question" id="question">题目加载中...</div>
        <div class="options" id="options"></div>
        <div class="tip-text" id="tip">解析提示区</div>
    </div>

    <div class="game-over" id="overBox">
        <h2 class="over-title">答题结束!</h2>
        <p class="over-score">最终得分:<span id="finalScore">0</span>/100</p>
        <button class="ctrl-btn btn-restart" onclick="restartGame()">重新开始</button>
    </div>

    <div class="control-box">
        <button class="ctrl-btn btn-next" id="nextBtn" disabled onclick="nextQuestion()">下一题</button>
    </div>

    <script>
        const questionList = [
            {
                question: "下列属于弹拨乐器的是?",
                options: ["二胡", "古筝", "笛子", "唢呐"],
                answer: 1,
                tip: "古筝属于弹拨乐器;二胡是拉弦乐器,笛子、唢呐是吹管乐器。"
            },
            {
                question: "被称为“民乐之王”的乐器是?",
                options: ["琵琶", "扬琴", "古筝"

Game Source: 中华乐器知多少·答题小游戏

Creator: GlitchFlare80

Libraries: none

Complexity: moderate (180 lines, 5.2 KB)

The full source code is displayed above on this page.

Remix Instructions

To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: -glitchflare80-mpcs0o5k" to link back to the original. Then publish at arcadelab.ai/publish.