Code
Code
doctype html>
<html lang="vi" class="h-full">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nhà Lập Trình Nhí - Cấu Trúc Tuần Tự</title>
<script src="[Link]
<script src="/_sdk/element_sdk.js"></script>
<script src="/_sdk/data_sdk.js"></script>
<link rel="preconnect" href="[Link]
<link rel="preconnect" href="[Link] crossorigin>
<link href="[Link]
family=Fredoka:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<style>
body {
box-sizing: border-box;
font-family: 'Fredoka', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
*{
font-family: 'Fredoka', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
@keyframes float {
0%, 100% { transform: translateY(0) rotate(0deg); }
50% { transform: translateY(-15px) rotate(5deg); }
}
@keyframes spin-slow {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-20px); }
}
@keyframes wiggle {
0%, 100% { transform: rotate(0deg); }
25% { transform: rotate(-5deg); }
75% { transform: rotate(5deg); }
}
@keyframes pulse-glow {
0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.8); }
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-5px); }
75% { transform: translateX(5px); }
}
@keyframes bounce-in {
0% { transform: scale(0.3); opacity: 0; }
50% { transform: scale(1.05); }
70% { transform: scale(0.9); }
100% { transform: scale(1); opacity: 1; }
}
@keyframes countdown-pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
@keyframes shine {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
@keyframes confetti-fall {
0% {
transform: translateY(0) rotateZ(0deg);
opacity: 1;
}
100% {
transform: translateY(100vh) rotateZ(360deg);
opacity: 0;
}
}
@keyframes glow-pulse {
0%, 100% { text-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
50% { text-shadow: 0 0 30px rgba(251, 191, 36, 0.9); }
}
@keyframes gradient-shift {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
@keyframes floating-animal {
0%, 100% { transform: translateY(0) scale(1); opacity: 0.1; }
50% { transform: translateY(-30px) scale(1.1); opacity: 0.15; }
}
.animal-bg-home {
position: absolute;
font-size: 6rem;
opacity: 0.12;
animation: floating-animal 4s ease-in-out infinite;
pointer-events: none;
}
.animal-bg-topics {
position: absolute;
font-size: 7rem;
opacity: 0.08;
animation: floating-animal 5s ease-in-out infinite;
pointer-events: none;
}
.animal-bg-question {
position: absolute;
font-size: 7rem;
opacity: 0.08;
animation: floating-animal 4s ease-in-out infinite;
pointer-events: none;
}
.animal-bg-end {
position: absolute;
font-size: 8rem;
opacity: 0.08;
animation: floating-animal 5s ease-in-out infinite;
pointer-events: none;
}
</style>
<style>@view-transition { navigation: auto; }</style>
</head>
<body class="h-full m-0 p-0 overflow-auto">
<div id="app" class="w-full min-h-full"><!-- TRANG 1: TRANG CHỦ -->
<div id="page-home" class="min-h-full flex flex-col items-center justify-center p-4
relative"><!-- Động vật nền -->
<div class="animal-bg-home" style="top: 5%; left: 5%; animation-delay: 0s;">
🦁
</div>
<div class="animal-bg-home" style="top: 15%; right: 10%; animation-delay: 0.5s;">
🐯
</div>
<div class="animal-bg-home" style="bottom: 20%; left: 8%; animation-delay: 1s;">
🐻
</div>
<div class="animal-bg-home" style="bottom: 10%; right: 5%; animation-delay: 1.5s;">
🦊
</div>
<div class="animal-bg-home" style="top: 40%; right: 3%; animation-delay: 2s;">
🐨
</div>
<div class="text-center max-w-4xl mx-auto relative z-10">
<div class="mb-8 float-animation">
<div class="text-8xl mb-6">
🤖
</div>
<div class="flex justify-center gap-6 text-6xl"><span></span> <span>💻</span>
<span>👦</span>
</div>
</div>
<h1 id="main-title-display" class="text-4xl md:text-5xl font-extrabold text-white mb-3 drop-
shadow-lg">🎮 NHÀ LẬP TRÌNH NHÍ</h1>
<h2 class="text-2xl md:text-3xl font-bold text-yellow-300 mb-8 drop-shadow-md">📚 BÀI
10: CẤU TRÚC TUẦN TỰ</h2>
<div class="bg-white/20 backdrop-blur-sm rounded-2xl p-4 mb-8 inline-block">
<p class="text-white text-lg font-medium">📖 Tin học lớp 5 - Kết nối tri thức</p>
</div>
<div class="flex flex-col gap-4 items-center"><button onclick="startGame()" class="px-8
py-4 bg-gradient-to-r from-green-400 to-emerald-500 text-white text-xl font-bold rounded-full
shadow-lg hover:shadow-xl transform hover:scale-105 transition-all pulse-glow"> ▶️BẮT
ĐẦU TRÒ CHƠI </button> <button onclick="showRules()" class="px-6 py-3 bg-gradient-to-r
from-blue-400 to-cyan-500 text-white text-lg font-bold rounded-full shadow-lg hover:shadow-
xl transform hover:scale-105 transition-all"> 📘 GIỚI THIỆU LUẬT CHƠI </button>
</div>
</div>
</div><!-- MODAL LUẬT CHƠI -->
<div id="rules-modal" class="fixed inset-0 bg-black/50 backdrop-blur-sm hidden items-
center justify-center z-50 p-4 overflow-y-auto">
<div class="bg-white rounded-3xl p-8 max-w-2xl w-full my-4 card-3d bounce-in relative
overflow-hidden"><!-- Động vật nền modal -->
<div class="animal-bg-rules" style="top: -20px; right: -20px;">
🦁
</div>
<div class="animal-bg-rules" style="bottom: -30px; left: -20px;">
🐯
</div>
<div class="animal-bg-rules" style="top: 50%; right: -40px;">
🐨
</div>
<div class="relative z-10">
<h2 class="text-3xl font-bold text-purple-600 mb-6 text-center">📘 LUẬT CHƠI</h2>
<div class="space-y-4 text-gray-700">
<div class="flex items-start gap-4 p-4 bg-yellow-50 rounded-xl"><span class="text-3xl
flex-shrink-0">🐉</span>
<div>
<p class="font-bold text-yellow-600 text-lg">ĐỘI RỒNG VÀNG</p>
<p class="text-sm text-gray-600">Màu vàng - xanh lá</p>
</div>
</div>
<div class="flex items-start gap-4 p-4 bg-red-50 rounded-xl"><span class="text-3xl flex-
shrink-0">🦅</span>
<div>
<p class="font-bold text-red-600 text-lg">ĐỘI PHƯỢNG ĐỎ</p>
<p class="text-sm text-gray-600">Màu đỏ - cam</p>
</div>
</div>
<div class="bg-purple-50 p-5 rounded-xl">
<h3 class="font-bold text-purple-600 mb-3 text-lg"> CÁCH CHƠI:</h3>
<ul class="text-sm space-y-2">
<li>✅ Mỗi đội lần lượt chọn chủ đề</li>
<li> Có 15 giây để trả lời mỗi câu hỏi</li>
<li>✅ Trả lời đúng: +10 điểm, ô chuyển màu xanh</li>
<li>❌ Trả lời sai hoặc hết giờ: ô bị khóa, xem lại được</li>
<li>🏆 Đội có điểm cao hơn chiến thắng!</li>
</ul>
</div>
</div><button onclick="hideRules()" class="mt-6 w-full py-3 bg-gradient-to-r from-purple-
500 to-pink-500 text-white font-bold rounded-full hover:opacity-90 transition-all text-lg"> ✨
ĐÃ HIỂU, BẮT ĐẦU THÔI! </button>
</div>
</div>
</div><!-- TRANG 2: CHỌN CHỦ ĐỀ -->
<div id="page-topics" class="min-h-full p-6 hidden relative"><!-- Động vật nền -->
<div class="animal-bg-topics" style="top: 5%; left: 5%; animation-delay: 0s;">
🦁
</div>
<div class="animal-bg-topics" style="top: 20%; right: 8%; animation-delay: 0.5s;">
🐯
</div>
<div class="animal-bg-topics" style="bottom: 25%; left: 10%; animation-delay: 1s;">
🐻
</div>
<div class="animal-bg-topics" style="bottom: 15%; right: 8%; animation-delay: 1.5s;">
🦊
</div>
<div class="animal-bg-topics" style="top: 50%; right: 2%; animation-delay: 2s;">
🐨
</div>
<div class="max-w-7xl mx-auto relative z-10"><!-- SCORE & TURN SECTION -->
<div class="flex flex-col md:flex-row justify-center items-stretch gap-4 mb-8"><!-- Team
Dragon -->
<div class="team-dragon rounded-3xl p-6 w-full md:w-72 text-center card-3d flex flex-col
justify-center">
<div class="text-5xl mb-3">
🐉
</div>
<p class="font-bold text-white text-lg">ĐỘI RỒNG VÀNG</p>
<p id="dragon-score" class="text-5xl font-extrabold text-white my-3">0</p>
<div class="flex gap-3 justify-center mb-4"><button
onclick="addDragonScore()" class="w-12 h-12 bg-white text-yellow-600 font-
bold rounded-full hover:bg-yellow-100 text-lg flex items-center justify-center
transition-all shadow-md">➕</button> <button onclick="subDragonScore()"
class="w-12 h-12 bg-white text-yellow-600 font-bold rounded-full hover:bg-
yellow-100 text-lg flex items-center justify-center transition-all shadow-
md">➖</button>
</div>
</div><!-- Turn Indicator -->
<div id="turn-indicator" class="bg-white rounded-3xl px-8 py-6 card-3d w-full md:w-72
flex flex-col justify-center">
<p class="text-base font-bold text-purple-600 text-center mb-2">🎯 LƯỢT CHƠI</p>
<p id="current-turn" class="text-2xl font-extrabold text-center text-purple-600 mb-4">ĐỘI
RỒNG VÀNG 🐉</p><button onclick="switchTeamManual()" class="w-full px-4 py-3 bg-
purple-600 text-white font-bold rounded-xl hover:bg-purple-700 transition-all text-sm
shadow-md"> 🔄 ĐỔI ĐỘI </button>
</div><!-- Team Phoenix -->
<div class="team-phoenix rounded-3xl p-6 w-full md:w-72 text-center card-3d flex flex-
col justify-center">
<div class="text-5xl mb-3">
🦅
</div>
<p class="font-bold text-white text-lg">ĐỘI PHƯỢNG ĐỎ</p>
<p id="phoenix-score" class="text-5xl font-extrabold text-white my-3">0</p>
<div class="flex gap-3 justify-center mb-4"><button
onclick="addPhoenixScore()" class="w-12 h-12 bg-white text-red-600 font-bold
rounded-full hover:bg-red-100 text-lg flex items-center justify-center transition-
all shadow-md">➕</button> <button onclick="subPhoenixScore()" class="w-12
h-12 bg-white text-red-600 font-bold rounded-full hover:bg-red-100 text-lg flex
items-center justify-center transition-all shadow-md">➖</button>
</div>
</div>
</div><!-- TITLE -->
<h2 class="text-3xl md:text-4xl font-bold text-white text-center mb-8 drop-shadow-lg">📚
CHỌN CHỦ ĐỀ ÔN TẬP</h2><!-- TOPICS GRID -->
<div id="topics-grid" class="grid grid-cols-3 md:grid-cols-5 gap-4 mb-8 justify-items-
center">
</div><!-- ACTION BUTTONS -->
<div class="flex flex-wrap justify-center gap-4"><button onclick="goHome()" class="px-6
py-3 bg-gradient-to-r from-gray-500 to-gray-600 text-white font-bold rounded-full
hover:opacity-90 transition-all shadow-lg text-sm md:text-base"> 🏠 VỀ TRANG CHỦ
</button> <button onclick="showReview()" class="px-6 py-3 bg-gradient-to-r from-blue-500
to-cyan-500 text-white font-bold rounded-full hover:opacity-90 transition-all shadow-lg text-
sm md:text-base"> 📘 KIỂM TRA CÂU HỎI </button> <button onclick="endGame()" class="px-
6 py-3 bg-gradient-to-r from-red-500 to-red-600 text-white font-bold rounded-full
hover:opacity-90 transition-all shadow-lg text-sm md:text-base"> KẾT THÚC TRÒ CHƠI
</button>
</div>
</div>
</div><!-- TRANG 3: CÂU HỎI -->
<div id="page-question" class="min-h-full p-6 hidden relative"><!-- Động vật nền -->
<div class="animal-bg-question" style="top: 5%; left: 5%; animation-delay: 0s;">
🐻
</div>
<div class="animal-bg-question" style="top: 15%; right: 10%; animation-delay: 0.5s;">
🦊
</div>
<div class="animal-bg-question" style="bottom: 20%; left: 8%; animation-delay: 1s;">
🐨
</div>
<div class="animal-bg-question" style="bottom: 10%; right: 5%; animation-delay: 1.5s;">
🦁
</div>
<div class="max-w-4xl mx-auto relative z-10"><!-- SCORE BAR -->
<div class="flex justify-between items-center mb-6 text-white">
<div class="bg-yellow-500/90 rounded-full px-6 py-3 font-bold text-lg shadow-lg">
🐉 <span id="q-dragon-score">0</span>
</div>
<div id="q-turn-badge" class="bg-purple-600/90 rounded-full px-6 py-3 font-bold text-lg
shadow-lg">
🎯 ĐỘI RỒNG VÀNG
</div>
<div class="bg-red-500/90 rounded-full px-6 py-3 font-bold text-lg shadow-lg">
🦅 <span id="q-phoenix-score">0</span>
</div>
</div><!-- QUESTION CARD -->
<div class="bg-white rounded-3xl p-8 card-3d"><!-- Topic Badge -->
<div class="bg-gradient-to-r from-purple-500 to-pink-500 text-white rounded-2xl p-4 mb-6
text-center">
<p class="text-sm opacity-90 font-semibold">Chủ đề</p>
<h3 id="topic-title" class="text-xl font-bold">Khái niệm cấu trúc tuần tự</h3>
</div><!-- Timer -->
<div class="flex justify-center mb-6">
<div class="bg-gray-100 rounded-full px-8 py-4 inline-block">
<p class="text-gray-500 text-sm font-semibold text-center"> Thời gian</p>
<p id="timer" class="text-5xl font-extrabold text-purple-600 text-center">15</p>
</div>
</div><!-- Question -->
<div class="bg-blue-50 rounded-2xl p-6 mb-6 border-2 border-blue-200">
<p id="question-text" class="text-xl font-semibold text-gray-800 text-center leading-
relaxed">Câu hỏi sẽ hiển thị ở đây</p>
</div><!-- Answers -->
<div id="answers-container" class="grid grid-cols-1 gap-4 mb-6">
</div>
</div><!-- BACK BUTTON -->
<div class="mt-6 flex justify-center"><button onclick="goToTopics()" class="px-8 py-3 bg-
white/90 text-purple-600 font-bold rounded-full hover:bg-white transition-all shadow-lg text-
base"> ◀️VỀ TRANG CHỦ ĐỀ </button>
</div>
</div>
</div><!-- MODAL PHẢN HỒI -->
<div id="feedback-modal" class="fixed inset-0 bg-black/50 backdrop-blur-sm hidden items-
center justify-center z-50 p-4">
<div id="feedback-content" class="bg-white rounded-3xl p-8 max-w-md w-full text-center
card-3d bounce-in">
<div id="feedback-icon" class="text-7xl mb-4">
✅
</div>
<h3 id="feedback-title" class="text-2xl font-bold mb-3">CHÍNH XÁC!</h3>
<p id="feedback-message" class="text-gray-600 mb-6 text-lg">Đội được cộng 10 điểm!
</p>
<div id="feedback-explanation" class="bg-blue-50 rounded-xl p-4 mb-6 text-left border-2
border-blue-200">
<p class="text-sm text-gray-700 leading-relaxed"><span class="font-bold text-blue-
600">💡 Giải thích:</span><br><span id="explanation-text">Giải thích kiến thức</span></p>
</div><button id="feedback-btn" onclick="closeFeedback()" class="w-full py-3 bg-
gradient-to-r from-purple-500 to-pink-500 text-white font-bold rounded-full hover:opacity-90
transition-all text-lg"> TIẾP TỤC ▶️</button>
</div>
</div><!-- MODAL KIỂM TRA CÂU HỎI -->
<div id="review-modal" class="fixed inset-0 bg-black/50 backdrop-blur-sm hidden items-
center justify-center z-50 p-4 overflow-y-auto">
<div class="bg-white rounded-3xl p-8 max-w-2xl w-full my-4 card-3d">
<h2 class="text-3xl font-bold text-purple-600 mb-6 text-center">📘 KIỂM TRA CÂU HỎI
ĐÃ TRẢ LỜI</h2>
<div id="review-list" class="space-y-4 max-h-[60vh] overflow-y-auto mb-6">
</div><button onclick="hideReview()" class="w-full py-3 bg-gradient-to-r from-purple-500
to-pink-500 text-white font-bold rounded-full hover:opacity-90 transition-all text-lg"> ✖️ĐÓNG
</button>
</div>
</div><!-- TRANG KẾT THÚC -->
<div id="page-end" class="min-h-full flex flex-col items-center justify-center p-4 hidden
relative"><!-- Động vật nền -->
<div class="animal-bg-end" style="top: 5%; left: 5%; animation-delay: 0s;">
🦁
</div>
<div class="animal-bg-end" style="top: 20%; right: 8%; animation-delay: 0.5s;">
🐯
</div>
<div class="animal-bg-end" style="bottom: 25%; left: 10%; animation-delay: 1s;">
🐻
</div>
<div class="animal-bg-end" style="bottom: 15%; right: 8%; animation-delay: 1.5s;">
🦊
</div>
<div class="animal-bg-end" style="top: 50%; right: 2%; animation-delay: 2s;">
🐨
</div>
<div class="bg-white rounded-3xl p-8 max-w-lg w-full text-center card-3d bounce-in
relative z-10">
<div class="text-7xl mb-6">
🏆
</div>
<h2 id="winner-text" class="text-3xl font-bold text-purple-600 mb-8">KẾT QUẢ</h2>
<div class="grid grid-cols-2 gap-6 mb-8">
<div class="team-dragon rounded-3xl p-6 flex flex-col items-center justify-center">
<div class="text-5xl mb-3">
🐉
</div>
<p class="font-bold text-white text-base mb-2">RỒNG VÀNG</p>
<p id="final-dragon" class="text-4xl font-extrabold text-white">0</p>
</div>
<div class="team-phoenix rounded-3xl p-6 flex flex-col items-center justify-center">
<div class="text-5xl mb-3">
🦅
</div>
<p class="font-bold text-white text-base mb-2">PHƯỢNG ĐỎ</p>
<p id="final-phoenix" class="text-4xl font-extrabold text-white">0</p>
</div>
</div>
<p class="text-gray-600 mb-8 text-lg"> CẢ HAI ĐỘI ĐỀU RẤT CỐ GẮNG!</p>
<div class="flex flex-col gap-3"><button onclick="resetGame()" class="w-full py-3 bg-
gradient-to-r from-green-400 to-emerald-500 text-white font-bold rounded-full hover:opacity-
90 transition-all text-lg"> 🔁 CHƠI LẠI </button> <button onclick="goHome()" class="w-full
py-3 bg-gradient-to-r from-gray-400 to-gray-500 text-white font-bold rounded-full
hover:opacity-90 transition-all text-lg"> 🏠 VỀ TRANG CHỦ </button>
</div>
</div>
</div>
</div>
<script>
// Audio context
const audioContext = new ([Link] || [Link])();
[Link] = frequency;
[Link] = type;
[Link](0.3, [Link]);
[Link](0.01, [Link] + duration);
[Link]([Link]);
[Link]([Link] + duration);
} catch (e) {
[Link]('Audio không khả dụng');
}
}
function playCorrectSound() {
playSound(523.25, 0.1);
setTimeout(() => playSound(659.25, 0.1), 100);
setTimeout(() => playSound(783.99, 0.2), 200);
}
function playWrongSound() {
playSound(200, 0.15);
setTimeout(() => playSound(150, 0.15), 100);
}
function playClickSound() {
playSound(440, 0.05);
}
const defaultConfig = {
main_title: 'NHÀ LẬP TRÌNH NHÍ',
timer_seconds: '15',
background_color: '#667eea',
surface_color: '#ffffff',
text_color: '#374151',
primary_action_color: '#8b5cf6',
secondary_action_color: '#06b6d4'
};
const topics = [
{ id: 1, name: "Gấu Nâu", icon: "🐻", question: "Cấu trúc tuần tự là gì?", answers: ["Các
bước được thực hiện theo đúng thứ tự từ đầu đến cuối", "Các bước làm ngẫu nhiên", "Chỉ
làm bước cuối", "Không cần theo thứ tự"], correct: 0, explanation: "Cấu trúc tuần tự là các
bước được thực hiện theo đúng thứ tự từ đầu đến cuối, không bỏ qua bước nào." },
{ id: 2, name: "Sư Tử Vàng", icon: "🦁", question: "Đặc điểm nào ĐÚNG về cấu trúc tuần
tự?", answers: ["Các bước thực hiện lần lượt theo thứ tự", "Có thể bỏ qua bước nào cũng
được", "Thực hiện bước nào trước cũng được", "Chỉ cần làm bước quan trọng nhất"],
correct: 0, explanation: "Đặc điểm quan trọng của cấu trúc tuần tự là các bước được thực
hiện lần lượt theo đúng thứ tự đã định." },
{ id: 3, name: "Thỏ Trắng", icon: "🐰", question: "Vì sao cần thực hiện công việc theo
đúng trình tự?", answers: ["Để đạt kết quả mong muốn", "Để làm nhanh hơn", "Để tiết kiệm
công sức", "Để người khác khen"], correct: 0, explanation: "Thực hiện đúng trình tự giúp ta
đạt được kết quả mong muốn và tránh sai sót." },
{ id: 4, name: "Cáo Xảo Quyệt", icon: "🦊", question: "Khi nấu mì gói, việc nào cần làm
TRƯỚC?", answers: ["Đun sôi nước", "Cho mì vào", "Ăn mì", "Rửa bát"], correct: 0,
explanation: "Khi nấu mì, ta cần đun sôi nước trước rồi mới cho mì vào - đây là cấu trúc
tuần tự." },
{ id: 5, name: "Ếch Xanh", icon: "🐸", question: "Sắp xếp đúng: Thức dậy → ? → Đi học",
answers: ["Ăn sáng", "Ngủ tiếp", "Xem tivi", "Đá bóng"], correct: 0, explanation: "Trình tự
sinh hoạt buổi sáng: Thức dậy → Ăn sáng → Đi học." },
{ id: 6, name: "Cú Thông Thái", icon: "🦉", question: "Khi làm bài kiểm tra, bước đầu tiên
là gì?", answers: ["Đọc kỹ đề bài", "Viết ngay câu trả lời", "Nộp bài", "Hỏi bạn bên cạnh"],
correct: 0, explanation: "Khi làm bài kiểm tra, bước đầu tiên là đọc kỹ đề bài để hiểu yêu
cầu." },
{ id: 7, name: "Rùa Chậm Rãi", icon: "🐢", question: "Để bật máy tính, bước đầu tiên là
gì?", answers: ["Bật công tắc nguồn", "Mở phần mềm", "Đăng nhập", "Tắt máy"], correct: 0,
explanation: "Để sử dụng máy tính, bước đầu tiên là bật công tắc nguồn." },
{ id: 8, name: "Khỉ Thông Minh", icon: "🐵", question: "Khi gặp bài toán khó, em nên làm
gì TRƯỚC?", answers: ["Đọc kỹ đề, tìm hiểu yêu cầu", "Viết đáp số ngay", "Bỏ qua không
làm", "Chép bài bạn"], correct: 0, explanation: "Khi giải bài toán, bước đầu tiên là đọc kỹ đề
và tìm hiểu yêu cầu." },
{ id: 9, name: "Vịt Vàng", icon: "🦆", question: "Khi đánh răng, thứ tự đúng là gì?",
answers: ["Lấy bàn chải → Cho kem → Đánh răng → Súc miệng", "Súc miệng → Đánh răng
→ Cho kem", "Đánh răng → Lấy bàn chải", "Cho kem → Súc miệng → Đánh răng"], correct:
0, explanation: "Thứ tự đánh răng: Lấy bàn chải → Cho kem → Đánh răng → Súc miệng." },
{ id: 10, name: "Sâu Bé Nhỏ", icon: "🐛", question: "Trình tự nào SAI khi rửa tay?",
answers: ["Lau khô → Xoa xà phòng → Mở vòi nước", "Mở vòi nước → Xoa xà phòng →
Rửa sạch → Lau khô", "Làm ướt tay → Xoa xà phòng → Rửa sạch", "Mở vòi → Làm ướt
tay → Xoa xà phòng"], correct: 0, explanation: "Lau khô trước khi rửa là sai! Trình tự đúng:
Mở vòi → Xoa xà phòng → Rửa → Lau khô." },
{ id: 11, name: "Công Tước", icon: "🦚", question: "Khi viết một đoạn văn, bước đầu tiên
là gì?", answers: ["Xác định chủ đề, lập dàn ý", "Viết ngay câu đầu tiên", "Kiểm tra chính tả",
"Nộp bài cho cô giáo"], correct: 0, explanation: "Bước đầu tiên khi viết văn là xác định chủ
đề và lập dàn ý." },
{ id: 12, name: "Bướm Xinh", icon: "🦋", question: "Khi hoàn thành bài vẽ, bước CÓ CUỐI
CÙNG là gì?", answers: ["Kiểm tra và hoàn thiện bài", "Phác thảo hình", "Vẽ màu nền",
"Chuẩn bị để vẽ"], correct: 0, explanation: "Bước cuối cùng khi vẽ là kiểm tra và hoàn thiện
bài." },
{ id: 13, name: "Bạch Tuộc", icon: "🐙", question: "Câu nào SAI về cấu trúc tuần tự?",
answers: ["Có thể làm bước nào trước cũng được", "Các bước phải theo thứ tự", "Không
được bỏ qua bước nào", "Mỗi bước đều quan trọng"], correct: 0, explanation: "Sai vì trong
cấu trúc tuần tự, các bước phải theo đúng thứ tự, không thể làm tùy ý." },
{ id: 14, name: "Ưng Hung", icon: "🦅", question: "Trong lập trình, cấu trúc tuần tự giúp
gì?", answers: ["Thực hiện các lệnh theo đúng thứ tự", "Làm chương trình chạy nhanh hơn",
"Giảm số dòng code", "Không cần quan trọng"], correct: 0, explanation: "Trong lập trình, cấu
trúc tuần tự giúp máy tính thực hiện các lệnh theo đúng thứ tự." },
{ id: 15, name: "Sư Tử Dũng Cảm", icon: "🦁", question: "Cấu trúc tuần tự giúp chúng ta
điều gì?", answers: ["Làm việc có kế hoạch, đạt kết quả tốt", "Làm việc nhanh hơn nhưng
không cần thứ tự", "Bỏ qua các bước không cần thiết", "Chỉ làm những việc mình thích"],
correct: 0, explanation: "Cấu trúc tuần tự giúp ta làm việc có kế hoạch, logic và đạt kết quả
tốt nhất." }
];
let gameState = {
dragonScore: 0,
phoenixScore: 0,
currentTeam: 'dragon',
topicsStatus: {},
currentTopic: null,
timerInterval: null,
timeLeft: 15,
gameStarted: false,
answeredQuestions: [],
dragonLifelines: 3,
phoenixLifelines: 3
};
function stopBackgroundMusic() {
if ([Link] > 0) {
[Link](osc => {
try { [Link](); } catch(e) {}
});
bgOscillators = [];
}
if (currentBgMusic) {
clearInterval(currentBgMusic);
currentBgMusic = null;
}
if (bgGainNode) {
[Link]([Link], [Link]);
[Link](0, [Link] + 0.5);
}
}
function playBackgroundMusic(type) {
stopBackgroundMusic();
try {
bgGainNode = [Link]();
[Link]([Link]);
[Link](0.08, [Link]);
function createHomeMusic(gainNode) {
const melody = [
{ freq: 261.63, dur: 400 },
{ freq: 329.63, dur: 400 },
{ freq: 392.00, dur: 400 },
{ freq: 329.63, dur: 400 },
{ freq: 261.63, dur: 400 },
{ freq: 329.63, dur: 400 },
{ freq: 392.00, dur: 800 }
];
let noteIndex = 0;
currentBgMusic = setInterval(() => {
const note = melody[noteIndex % [Link]];
const osc = [Link]();
const envGain = [Link]();
[Link](envGain);
[Link](gainNode);
[Link] = [Link];
[Link] = 'sine';
[Link](0, [Link]);
[Link](0.5, [Link] + 0.1);
[Link](0, [Link] + ([Link] /
1000 - 0.05));
[Link]([Link]);
[Link]([Link] + ([Link] / 1000));
[Link](osc);
noteIndex++;
}, 400);
}
function createGameMusic(gainNode) {
const melody = [
{ freq: 349.23, dur: 200 },
{ freq: 440.00, dur: 200 },
{ freq: 523.25, dur: 400 },
{ freq: 440.00, dur: 200 },
{ freq: 349.23, dur: 200 },
{ freq: 392.00, dur: 400 }
];
let noteIndex = 0;
currentBgMusic = setInterval(() => {
const note = melody[noteIndex % [Link]];
const osc = [Link]();
const envGain = [Link]();
[Link](envGain);
[Link](gainNode);
[Link] = [Link];
[Link] = 'triangle';
[Link](0, [Link]);
[Link](0.6, [Link] + 0.08);
[Link](0, [Link] + ([Link] /
1000 - 0.02));
[Link]([Link]);
[Link]([Link] + ([Link] / 1000));
[Link](osc);
noteIndex++;
}, 200);
}
function createQuestionMusic(gainNode) {
const melody = [
{ freq: 246.94, dur: 300 },
{ freq: 329.63, dur: 300 },
{ freq: 392.00, dur: 600 },
{ freq: 261.63, dur: 300 },
{ freq: 349.23, dur: 300 },
{ freq: 440.00, dur: 600 }
];
let noteIndex = 0;
currentBgMusic = setInterval(() => {
const note = melody[noteIndex % [Link]];
const osc = [Link]();
const envGain = [Link]();
[Link](envGain);
[Link](gainNode);
[Link] = [Link];
[Link] = 'square';
[Link](0, [Link]);
[Link](0.5, [Link] + 0.1);
[Link](0, [Link] + ([Link] /
1000 - 0.08));
[Link]([Link]);
[Link]([Link] + ([Link] / 1000));
[Link](osc);
noteIndex++;
}, 300);
}
function createEndMusic(gainNode) {
const melody = [
{ freq: 523.25, dur: 200 },
{ freq: 659.25, dur: 200 },
{ freq: 783.99, dur: 200 },
{ freq: 1046.50, dur: 400 },
{ freq: 783.99, dur: 200 },
{ freq: 659.25, dur: 200 },
{ freq: 523.25, dur: 400 }
];
let noteIndex = 0;
currentBgMusic = setInterval(() => {
const note = melody[noteIndex % [Link]];
const osc = [Link]();
const envGain = [Link]();
[Link](envGain);
[Link](gainNode);
[Link] = [Link];
[Link] = 'sine';
[Link](0, [Link]);
[Link](0.7, [Link] + 0.1);
[Link](0, [Link] + ([Link] /
1000 - 0.05));
[Link]([Link]);
[Link]([Link] + ([Link] / 1000));
[Link](osc);
noteIndex++;
}, 200);
}
function showPage(pageId) {
['page-home', 'page-topics', 'page-question', 'page-end'].forEach(id => {
[Link](id).[Link]('hidden');
});
[Link](pageId).[Link]('hidden');
function updateScoreDisplay() {
[Link]('dragon-score').textContent = [Link];
[Link]('phoenix-score').textContent = [Link];
[Link]('q-dragon-score').textContent = [Link];
[Link]('q-phoenix-score').textContent = [Link];
}
function updateTurnDisplay() {
const turnText = [Link] === 'dragon' ? 'ĐỘI RỒNG VÀNG 🐉' : 'ĐỘI
PHƯỢNG ĐỎ 🦅';
[Link]('current-turn').textContent = turnText;
[Link]('q-turn-badge').textContent = '🎯 ' + ([Link]
=== 'dragon' ? 'ĐỘI RỒNG VÀNG' : 'ĐỘI PHƯỢNG ĐỎ');
function switchTeam() {
[Link] = [Link] === 'dragon' ? 'phoenix' : 'dragon';
updateTurnDisplay();
}
function switchTeamManual() {
switchTeam();
}
function addDragonScore() {
[Link] += 10;
updateScoreDisplay();
}
function subDragonScore() {
[Link] = [Link](0, [Link] - 10);
updateScoreDisplay();
}
function addPhoenixScore() {
[Link] += 10;
updateScoreDisplay();
}
function subPhoenixScore() {
[Link] = [Link](0, [Link] - 10);
updateScoreDisplay();
}
function initGame() {
gameState = {
dragonScore: 0,
phoenixScore: 0,
currentTeam: 'dragon',
topicsStatus: {},
currentTopic: null,
timerInterval: null,
timeLeft: parseInt(config.timer_seconds) || 15,
gameStarted: true,
answeredQuestions: [],
dragonLifelines: 3,
phoenixLifelines: 3
};
[Link](topic => {
[Link][[Link]] = 'available';
});
updateScoreDisplay();
updateTurnDisplay();
renderTopicsGrid();
}
function renderTopicsGrid() {
const grid = [Link]('topics-grid');
[Link] = '';
[Link](topic => {
const status = [Link][[Link]];
const btn = [Link]('button');
[Link] = 'topic-btn rounded-2xl p-4 w-20 h-20 md:w-24 md:h-24 flex flex-col
items-center justify-center text-center card-3d transition-all';
[Link](btn);
});
}
function selectTopic(topic) {
playClickSound();
[Link] = topic;
showQuestion(topic);
}
function showQuestion(topic) {
[Link]('topic-title').textContent = [Link];
[Link]('question-text').textContent = [Link];
showPage('page-question');
startTimer();
}
function showCompletedTopic(topic) {
const modal = [Link]('feedback-modal');
[Link]('feedback-icon').textContent = '✅';
[Link]('feedback-title').textContent = 'CÂU ĐÃ TRẢ LỜI ĐÚNG';
[Link]('feedback-title').className = 'text-2xl font-bold mb-3 text-
green-600';
[Link]('feedback-message').textContent = `Câu hỏi: $
{[Link]}`;
function showWrongTopic(topic) {
const modal = [Link]('feedback-modal');
[Link]('feedback-icon').textContent = '❌';
[Link]('feedback-title').textContent = 'TỰ KIỂM TRA CÂU SAI';
[Link]('feedback-title').className = 'text-2xl font-bold mb-3 text-red-
600';
[Link]('feedback-message').innerHTML = `📖 Câu hỏi: $
{[Link]}`;
function playCountdownTick(timeLeft) {
try {
const frequencies = {
5: 784.00,
4: 698.46,
3: 587.33,
2: 523.25,
1: 440.00
};
[Link](gain);
[Link]([Link]);
[Link] = frequency;
[Link] = 'sine';
[Link](0.4, [Link]);
[Link](0.01, [Link] + 0.2);
[Link]([Link]);
[Link]([Link] + 0.2);
} catch (e) {
[Link]('Không thể phát âm đếm ngược');
}
}
function startTimer() {
[Link] = parseInt(config.timer_seconds) || 15;
const timerDisplay = [Link]('timer');
[Link] = [Link];
[Link]('countdown-critical');
if ([Link]) clearInterval([Link]);
if ([Link] <= 0) {
clearInterval([Link]);
handleTimeout();
}
}, 1000);
}
function stopTimer() {
if ([Link]) {
clearInterval([Link]);
[Link] = null;
}
}
function handleTimeout() {
stopTimer();
[Link][[Link]] = 'locked';
[Link]({
topic: [Link],
team: [Link],
correct: false,
isTimeout: true
});
showFeedback(false, true);
}
if (isCorrect) {
[Link]('correct');
playCorrectSound();
if ([Link] === 'dragon') {
[Link] += 10;
} else {
[Link] += 10;
}
[Link][[Link]] = 'completed';
} else {
[Link]('incorrect');
playWrongSound();
allBtns[[Link]].[Link]('correct');
[Link][[Link]] = 'locked';
}
[Link]({
topic: [Link],
team: [Link],
correct: isCorrect,
isTimeout: false
});
updateScoreDisplay();
setTimeout(() => {
showFeedback(isCorrect, false);
}, 1000);
}
if (isTimeout) {
[Link] = '⏰';
[Link] = 'HẾT GIỜ!';
[Link] = 'text-2xl font-bold mb-3 text-orange-600';
[Link] = 'Ô này sẽ bị khóa. Chuyển lượt!';
[Link] = 'bg-white rounded-3xl p-8 max-w-md w-full text-center card-3d
bounce-in border-4 border-orange-400';
} else if (isCorrect) {
[Link] = '🎉';
[Link] = 'CHÍNH XÁC!';
[Link] = 'text-2xl font-bold mb-3 text-green-600';
[Link] = `${[Link] === 'dragon' ? 'Đội Rồng Vàng' :
'Đội Phượng Đỏ'} được cộng 10 điểm!`;
[Link] = 'bg-white rounded-3xl p-8 max-w-md w-full text-center card-3d
bounce-in border-4 border-green-400';
} else {
[Link] = '❌';
[Link] = 'CHƯA ĐÚNG!';
[Link] = 'text-2xl font-bold mb-3 text-red-600';
[Link] = 'Ô này sẽ bị khóa!';
[Link] = 'bg-white rounded-3xl p-8 max-w-md w-full text-center card-3d
bounce-in border-4 border-red-400';
}
[Link] = [Link];
[Link]('hidden');
[Link]('flex');
}
function closeFeedback() {
const modal = [Link]('feedback-modal');
[Link]('hidden');
[Link]('flex');
if (checkGameEnd()) {
showEndGame();
} else {
goToTopics();
}
}
function checkGameEnd() {
return [Link]([Link]).every(
status => status === 'completed' || status === 'locked'
);
}
function playVictorySound() {
const notes = [
{ freq: 523.25, dur: 200 },
{ freq: 659.25, dur: 200 },
{ freq: 783.99, dur: 200 },
{ freq: 1046.50, dur: 400 },
{ freq: 1046.50, dur: 200 },
{ freq: 1046.50, dur: 600 }
];
let noteIndex = 0;
const playNextNote = () => {
if (noteIndex < [Link]) {
const note = notes[noteIndex];
const osc = [Link]();
const gain = [Link]();
[Link](gain);
[Link]([Link]);
[Link] = [Link];
[Link] = 'sine';
[Link](0.4, [Link]);
[Link](0.01, [Link] +
([Link] / 1000));
[Link]([Link]);
[Link]([Link] + ([Link] / 1000));
noteIndex++;
setTimeout(playNextNote, [Link]);
}
};
playNextNote();
}
function createConfetti() {
const confettiContainer = [Link]('div');
[Link] = 'confetti-container';
[Link] = 'position: fixed; top: 0; left: 0; width: 100%; height:
100%; pointer-events: none; z-index: 1000;';
[Link](confettiContainer);
[Link] = emoji;
[Link] = `
position: absolute;
left: ${startX}%;
top: ${startY}%;
font-size: ${20 + [Link]() * 20}px;
animation: confetti-fall ${duration}s linear ${delay}s forwards;
pointer-events: none;
`;
[Link](confetti);
}
}
function showEndGame() {
[Link]('final-dragon').textContent = [Link];
[Link]('final-phoenix').textContent = [Link];
showPage('page-end');
setTimeout(() => {
playVictorySound();
createConfetti();
}, 300);
saveGameState();
}
function startGame() {
initGame();
showPage('page-topics');
}
function goHome() {
stopTimer();
showPage('page-home');
}
function goToTopics() {
stopTimer();
renderTopicsGrid();
updateScoreDisplay();
updateTurnDisplay();
showPage('page-topics');
}
function endGame() {
if ([Link]) {
showEndGame();
}
}
function resetGame() {
initGame();
showPage('page-topics');
}
function showRules() {
playClickSound();
[Link]('rules-modal').[Link]('hidden');
[Link]('rules-modal').[Link]('flex');
}
function hideRules() {
playClickSound();
[Link]('rules-modal').[Link]('hidden');
[Link]('rules-modal').[Link]('flex');
}
function showReview() {
const reviewList = [Link]('review-list');
[Link] = '';
if ([Link] === 0) {
[Link] = '<p class="text-gray-500 text-center py-8 text-lg">Chưa có câu
nào được trả lời.</p>';
} else {
[Link]((item, index) => {
const topic = [Link];
const team = [Link];
const isCorrect = [Link];
const isTimeout = [Link];
[Link]('review-modal').[Link]('hidden');
[Link]('review-modal').[Link]('flex');
}
function hideReview() {
[Link]('review-modal').[Link]('hidden');
[Link]('review-modal').[Link]('flex');
}
const dataHandler = {
onDataChanged(data) {
}
};
if ([Link]) {
await [Link](dataHandler);
}
applyConfig();
}
function applyConfig() {
const titleEl = [Link]('main-title-display');
if (titleEl) {
[Link] = '🎮 ' + (config.main_title || defaultConfig.main_title);
}
}
initializeApp();
</script>
<script>(function(){function c(){var b=[Link]||[Link];if(b)
{var
d=[Link]('script');[Link]="window.__CF$cv$params={r:'9c4f7fbfd5dd6009',t
:'MTc2OTU5MjkxOS4wMDAwMDA='};var
a=[Link]('script');[Link]='';[Link]='/cdn-cgi/challenge-platform/scripts/
jsd/[Link]';[Link]('head')
[0].appendChild(a);";[Link]('head')
[0].appendChild(d)}}if([Link]){var
a=[Link]('iframe');[Link]=1;[Link]=1;[Link]='absolute';[Link].t
op=0;[Link]=0;[Link]='none';[Link]='hidden';[Link]
d(a);if('loading'!==[Link])c();else
if([Link])[Link]('DOMContentLoaded',c);else{var
e=[Link]||function(){};[Link]=function(b)
{e(b);'loading'!==[Link]&&([Link]=e,c())}}}})();</
script></body>
</html>