Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +741 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: bpmf-tw
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,741 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Zhuyin Bopomofo Learning App</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Noto Sans TC', sans-serif;
|
| 14 |
+
background-color: #f8f9fa;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
.zhuyin-char {
|
| 18 |
+
font-size: 4rem;
|
| 19 |
+
line-height: 1;
|
| 20 |
+
color: #3b82f6;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.lesson-card:hover {
|
| 24 |
+
transform: translateY(-5px);
|
| 25 |
+
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.character-card {
|
| 29 |
+
transition: all 0.3s ease;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.character-card:hover {
|
| 33 |
+
transform: scale(1.05);
|
| 34 |
+
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.progress-bar {
|
| 38 |
+
height: 8px;
|
| 39 |
+
border-radius: 4px;
|
| 40 |
+
background-color: #e5e7eb;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.progress-fill {
|
| 44 |
+
height: 100%;
|
| 45 |
+
border-radius: 4px;
|
| 46 |
+
background-color: #10b981;
|
| 47 |
+
transition: width 0.3s ease;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.correct-answer {
|
| 51 |
+
animation: correctPulse 0.5s;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.wrong-answer {
|
| 55 |
+
animation: wrongShake 0.5s;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
@keyframes correctPulse {
|
| 59 |
+
0% { transform: scale(1); }
|
| 60 |
+
50% { transform: scale(1.1); }
|
| 61 |
+
100% { transform: scale(1); }
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
@keyframes wrongShake {
|
| 65 |
+
0%, 100% { transform: translateX(0); }
|
| 66 |
+
20%, 60% { transform: translateX(-5px); }
|
| 67 |
+
40%, 80% { transform: translateX(5px); }
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
.tab-active {
|
| 71 |
+
border-bottom: 3px solid #3b82f6;
|
| 72 |
+
color: #3b82f6;
|
| 73 |
+
font-weight: bold;
|
| 74 |
+
}
|
| 75 |
+
</style>
|
| 76 |
+
</head>
|
| 77 |
+
<body class="min-h-screen">
|
| 78 |
+
<div class="container mx-auto px-4 py-8 max-w-6xl">
|
| 79 |
+
<!-- Header -->
|
| 80 |
+
<header class="text-center mb-12">
|
| 81 |
+
<h1 class="text-4xl font-bold text-gray-800 mb-2">Zhuyin Bopomofo Learning App</h1>
|
| 82 |
+
<p class="text-lg text-gray-600">Master the phonetic system for learning Mandarin Chinese</p>
|
| 83 |
+
</header>
|
| 84 |
+
|
| 85 |
+
<!-- Main Content -->
|
| 86 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
|
| 87 |
+
<!-- Tabs Navigation -->
|
| 88 |
+
<div class="flex border-b border-gray-200">
|
| 89 |
+
<button id="lessons-tab" class="flex-1 py-4 px-6 text-center font-medium text-gray-700 hover:text-blue-500 focus:outline-none tab-active">
|
| 90 |
+
<i class="fas fa-book-open mr-2"></i> Lessons
|
| 91 |
+
</button>
|
| 92 |
+
<button id="practice-tab" class="flex-1 py-4 px-6 text-center font-medium text-gray-700 hover:text-blue-500 focus:outline-none">
|
| 93 |
+
<i class="fas fa-pencil-alt mr-2"></i> Practice
|
| 94 |
+
</button>
|
| 95 |
+
<button id="progress-tab" class="flex-1 py-4 px-6 text-center font-medium text-gray-700 hover:text-blue-500 focus:outline-none">
|
| 96 |
+
<i class="fas fa-chart-line mr-2"></i> Progress
|
| 97 |
+
</button>
|
| 98 |
+
</div>
|
| 99 |
+
|
| 100 |
+
<!-- Tab Content -->
|
| 101 |
+
<div class="p-6">
|
| 102 |
+
<!-- Lessons Tab Content -->
|
| 103 |
+
<div id="lessons-content">
|
| 104 |
+
<h2 class="text-2xl font-bold text-gray-800 mb-6">Zhuyin Lessons</h2>
|
| 105 |
+
|
| 106 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 107 |
+
<!-- Lesson 1: Initials -->
|
| 108 |
+
<div class="lesson-card bg-white border border-gray-200 rounded-lg p-6 shadow-sm transition duration-300 cursor-pointer" onclick="loadLesson('initials')">
|
| 109 |
+
<div class="flex items-center mb-4">
|
| 110 |
+
<div class="bg-blue-100 p-3 rounded-full mr-4">
|
| 111 |
+
<i class="fas fa-volume-up text-blue-500 text-xl"></i>
|
| 112 |
+
</div>
|
| 113 |
+
<h3 class="text-xl font-semibold text-gray-800">Initial Consonants</h3>
|
| 114 |
+
</div>
|
| 115 |
+
<p class="text-gray-600 mb-4">Learn the 21 initial consonant sounds in Zhuyin.</p>
|
| 116 |
+
<div class="flex justify-between items-center">
|
| 117 |
+
<span class="text-sm text-gray-500">21 characters</span>
|
| 118 |
+
<span class="text-sm font-medium text-blue-500">Start Lesson →</span>
|
| 119 |
+
</div>
|
| 120 |
+
</div>
|
| 121 |
+
|
| 122 |
+
<!-- Lesson 2: Medials -->
|
| 123 |
+
<div class="lesson-card bg-white border border-gray-200 rounded-lg p-6 shadow-sm transition duration-300 cursor-pointer" onclick="loadLesson('medials')">
|
| 124 |
+
<div class="flex items-center mb-4">
|
| 125 |
+
<div class="bg-green-100 p-3 rounded-full mr-4">
|
| 126 |
+
<i class="fas fa-comment text-green-500 text-xl"></i>
|
| 127 |
+
</div>
|
| 128 |
+
<h3 class="text-xl font-semibold text-gray-800">Medial Vowels</h3>
|
| 129 |
+
</div>
|
| 130 |
+
<p class="text-gray-600 mb-4">Master the 3 medial vowel sounds that combine with initials.</p>
|
| 131 |
+
<div class="flex justify-between items-center">
|
| 132 |
+
<span class="text-sm text-gray-500">3 characters</span>
|
| 133 |
+
<span class="text-sm font-medium text-blue-500">Start Lesson →</span>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
|
| 137 |
+
<!-- Lesson 3: Finals -->
|
| 138 |
+
<div class="lesson-card bg-white border border-gray-200 rounded-lg p-6 shadow-sm transition duration-300 cursor-pointer" onclick="loadLesson('finals')">
|
| 139 |
+
<div class="flex items-center mb-4">
|
| 140 |
+
<div class="bg-purple-100 p-3 rounded-full mr-4">
|
| 141 |
+
<i class="fas fa-spell-check text-purple-500 text-xl"></i>
|
| 142 |
+
</div>
|
| 143 |
+
<h3 class="text-xl font-semibold text-gray-800">Final Sounds</h3>
|
| 144 |
+
</div>
|
| 145 |
+
<p class="text-gray-600 mb-4">Learn the 13 final sounds that complete Zhuyin syllables.</p>
|
| 146 |
+
<div class="flex justify-between items-center">
|
| 147 |
+
<span class="text-sm text-gray-500">13 characters</span>
|
| 148 |
+
<span class="text-sm font-medium text-blue-500">Start Lesson →</span>
|
| 149 |
+
</div>
|
| 150 |
+
</div>
|
| 151 |
+
|
| 152 |
+
<!-- Lesson 4: Tones -->
|
| 153 |
+
<div class="lesson-card bg-white border border-gray-200 rounded-lg p-6 shadow-sm transition duration-300 cursor-pointer" onclick="loadLesson('tones')">
|
| 154 |
+
<div class="flex items-center mb-4">
|
| 155 |
+
<div class="bg-yellow-100 p-3 rounded-full mr-4">
|
| 156 |
+
<i class="fas fa-music text-yellow-500 text-xl"></i>
|
| 157 |
+
</div>
|
| 158 |
+
<h3 class="text-xl font-semibold text-gray-800">Tones</h3>
|
| 159 |
+
</div>
|
| 160 |
+
<p class="text-gray-600 mb-4">Understand the 4 tones and neutral tone in Mandarin.</p>
|
| 161 |
+
<div class="flex justify-between items-center">
|
| 162 |
+
<span class="text-sm text-gray-500">5 tone marks</span>
|
| 163 |
+
<span class="text-sm font-medium text-blue-500">Start Lesson →</span>
|
| 164 |
+
</div>
|
| 165 |
+
</div>
|
| 166 |
+
|
| 167 |
+
<!-- Lesson 5: Combined -->
|
| 168 |
+
<div class="lesson-card bg-white border border-gray-200 rounded-lg p-6 shadow-sm transition duration-300 cursor-pointer" onclick="loadLesson('combined')">
|
| 169 |
+
<div class="flex items-center mb-4">
|
| 170 |
+
<div class="bg-red-100 p-3 rounded-full mr-4">
|
| 171 |
+
<i class="fas fa-random text-red-500 text-xl"></i>
|
| 172 |
+
</div>
|
| 173 |
+
<h3 class="text-xl font-semibold text-gray-800">Combined Sounds</h3>
|
| 174 |
+
</div>
|
| 175 |
+
<p class="text-gray-600 mb-4">Practice combining initials, medials and finals.</p>
|
| 176 |
+
<div class="flex justify-between items-center">
|
| 177 |
+
<span class="text-sm text-gray-500">All characters</span>
|
| 178 |
+
<span class="text-sm font-medium text-blue-500">Start Lesson →</span>
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
|
| 183 |
+
<!-- Lesson Detail View (hidden by default) -->
|
| 184 |
+
<div id="lesson-detail" class="hidden mt-8">
|
| 185 |
+
<div class="flex justify-between items-center mb-6">
|
| 186 |
+
<h2 id="lesson-title" class="text-2xl font-bold text-gray-800"></h2>
|
| 187 |
+
<button onclick="backToLessons()" class="flex items-center text-blue-500 hover:text-blue-700">
|
| 188 |
+
<i class="fas fa-arrow-left mr-2"></i> Back to Lessons
|
| 189 |
+
</button>
|
| 190 |
+
</div>
|
| 191 |
+
|
| 192 |
+
<div id="lesson-description" class="mb-6 text-gray-700"></div>
|
| 193 |
+
|
| 194 |
+
<div id="lesson-characters" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4"></div>
|
| 195 |
+
</div>
|
| 196 |
+
</div>
|
| 197 |
+
|
| 198 |
+
<!-- Practice Tab Content -->
|
| 199 |
+
<div id="practice-content" class="hidden">
|
| 200 |
+
<h2 class="text-2xl font-bold text-gray-800 mb-6">Practice Zhuyin Characters</h2>
|
| 201 |
+
|
| 202 |
+
<div class="bg-blue-50 rounded-lg p-6 mb-8">
|
| 203 |
+
<div class="flex flex-col md:flex-row items-center">
|
| 204 |
+
<div class="md:w-1/2 mb-4 md:mb-0">
|
| 205 |
+
<h3 class="text-xl font-semibold text-gray-800 mb-2">Test Your Knowledge</h3>
|
| 206 |
+
<p class="text-gray-600">Listen to the pronunciation and select the correct Zhuyin character.</p>
|
| 207 |
+
</div>
|
| 208 |
+
<div class="md:w-1/2 flex justify-end">
|
| 209 |
+
<button id="start-practice" class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-6 rounded-lg transition duration-300 flex items-center">
|
| 210 |
+
<i class="fas fa-play mr-2"></i> Start Practice
|
| 211 |
+
</button>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<div id="practice-session" class="hidden">
|
| 217 |
+
<div class="bg-white border border-gray-200 rounded-lg p-6 shadow-sm mb-6">
|
| 218 |
+
<div class="flex justify-between items-center mb-4">
|
| 219 |
+
<span id="progress-text" class="text-sm font-medium text-gray-500">Question 1 of 10</span>
|
| 220 |
+
<div class="w-32 bg-gray-200 rounded-full h-2.5">
|
| 221 |
+
<div id="progress-bar" class="bg-blue-600 h-2.5 rounded-full" style="width: 10%"></div>
|
| 222 |
+
</div>
|
| 223 |
+
</div>
|
| 224 |
+
|
| 225 |
+
<div class="text-center py-8">
|
| 226 |
+
<button id="play-sound" class="bg-green-500 hover:bg-green-600 text-white font-medium py-3 px-8 rounded-full transition duration-300 flex items-center mx-auto">
|
| 227 |
+
<i class="fas fa-volume-up mr-2"></i> Play Sound
|
| 228 |
+
</button>
|
| 229 |
+
<p class="text-gray-500 mt-4">Listen to the pronunciation and select the correct character below.</p>
|
| 230 |
+
</div>
|
| 231 |
+
|
| 232 |
+
<div id="answer-options" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4 mt-6"></div>
|
| 233 |
+
</div>
|
| 234 |
+
|
| 235 |
+
<div id="feedback" class="hidden">
|
| 236 |
+
<div id="correct-feedback" class="bg-green-50 border border-green-200 rounded-lg p-4 mb-4 hidden">
|
| 237 |
+
<div class="flex items-center">
|
| 238 |
+
<div class="bg-green-100 p-2 rounded-full mr-3">
|
| 239 |
+
<i class="fas fa-check text-green-500"></i>
|
| 240 |
+
</div>
|
| 241 |
+
<div>
|
| 242 |
+
<h4 class="font-medium text-green-800">Correct!</h4>
|
| 243 |
+
<p class="text-green-600 text-sm">Good job! That was the right answer.</p>
|
| 244 |
+
</div>
|
| 245 |
+
</div>
|
| 246 |
+
</div>
|
| 247 |
+
|
| 248 |
+
<div id="wrong-feedback" class="bg-red-50 border border-red-200 rounded-lg p-4 mb-4 hidden">
|
| 249 |
+
<div class="flex items-center">
|
| 250 |
+
<div class="bg-red-100 p-2 rounded-full mr-3">
|
| 251 |
+
<i class="fas fa-times text-red-500"></i>
|
| 252 |
+
</div>
|
| 253 |
+
<div>
|
| 254 |
+
<h4 class="font-medium text-red-800">Incorrect</h4>
|
| 255 |
+
<p id="correct-answer-text" class="text-red-600 text-sm">The correct answer was: ㄅ (b)</p>
|
| 256 |
+
</div>
|
| 257 |
+
</div>
|
| 258 |
+
</div>
|
| 259 |
+
|
| 260 |
+
<button id="next-question" class="w-full bg-blue-500 hover:bg-blue-600 text-white font-medium py-3 px-6 rounded-lg transition duration-300">
|
| 261 |
+
Next Question <i class="fas fa-arrow-right ml-2"></i>
|
| 262 |
+
</button>
|
| 263 |
+
</div>
|
| 264 |
+
</div>
|
| 265 |
+
|
| 266 |
+
<div id="practice-results" class="hidden">
|
| 267 |
+
<div class="bg-white border border-gray-200 rounded-lg p-6 shadow-sm">
|
| 268 |
+
<div class="text-center mb-6">
|
| 269 |
+
<div class="w-24 h-24 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 270 |
+
<i class="fas fa-trophy text-green-500 text-4xl"></i>
|
| 271 |
+
</div>
|
| 272 |
+
<h3 class="text-2xl font-bold text-gray-800 mb-2">Practice Complete!</h3>
|
| 273 |
+
<p id="results-score" class="text-xl text-gray-600">You scored 8 out of 10</p>
|
| 274 |
+
</div>
|
| 275 |
+
|
| 276 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
|
| 277 |
+
<div class="bg-blue-50 rounded-lg p-4">
|
| 278 |
+
<h4 class="font-medium text-gray-800 mb-2">Correct Answers</h4>
|
| 279 |
+
<div class="flex items-center">
|
| 280 |
+
<div class="text-3xl font-bold text-blue-500 mr-3" id="correct-count">8</div>
|
| 281 |
+
<div class="progress-bar w-full">
|
| 282 |
+
<div class="progress-fill" style="width: 80%"></div>
|
| 283 |
+
</div>
|
| 284 |
+
</div>
|
| 285 |
+
</div>
|
| 286 |
+
|
| 287 |
+
<div class="bg-red-50 rounded-lg p-4">
|
| 288 |
+
<h4 class="font-medium text-gray-800 mb-2">Incorrect Answers</h4>
|
| 289 |
+
<div class="flex items-center">
|
| 290 |
+
<div class="text-3xl font-bold text-red-500 mr-3" id="incorrect-count">2</div>
|
| 291 |
+
<div class="progress-bar w-full">
|
| 292 |
+
<div class="progress-fill bg-red-500" style="width: 20%"></div>
|
| 293 |
+
</div>
|
| 294 |
+
</div>
|
| 295 |
+
</div>
|
| 296 |
+
</div>
|
| 297 |
+
|
| 298 |
+
<div class="flex flex-col sm:flex-row gap-4">
|
| 299 |
+
<button onclick="restartPractice()" class="flex-1 bg-blue-500 hover:bg-blue-600 text-white font-medium py-3 px-6 rounded-lg transition duration-300">
|
| 300 |
+
<i class="fas fa-redo mr-2"></i> Try Again
|
| 301 |
+
</button>
|
| 302 |
+
<button onclick="backToLessons()" class="flex-1 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-3 px-6 rounded-lg transition duration-300">
|
| 303 |
+
<i class="fas fa-book-open mr-2"></i> Back to Lessons
|
| 304 |
+
</button>
|
| 305 |
+
</div>
|
| 306 |
+
</div>
|
| 307 |
+
</div>
|
| 308 |
+
</div>
|
| 309 |
+
|
| 310 |
+
<!-- Progress Tab Content -->
|
| 311 |
+
<div id="progress-content" class="hidden">
|
| 312 |
+
<h2 class="text-2xl font-bold text-gray-800 mb-6">Your Learning Progress</h2>
|
| 313 |
+
|
| 314 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
|
| 315 |
+
<div class="bg-white border border-gray-200 rounded-lg p-6 shadow-sm">
|
| 316 |
+
<h3 class="text-lg font-semibold text-gray-800 mb-4">Overall Progress</h3>
|
| 317 |
+
<div class="flex items-center mb-2">
|
| 318 |
+
<div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mr-4">
|
| 319 |
+
<i class="fas fa-chart-pie text-blue-500"></i>
|
| 320 |
+
</div>
|
| 321 |
+
<div class="flex-1">
|
| 322 |
+
<div class="flex justify-between mb-1">
|
| 323 |
+
<span class="text-sm font-medium text-gray-600">Characters Learned</span>
|
| 324 |
+
<span id="learned-percent" class="text-sm font-medium text-gray-600">25%</span>
|
| 325 |
+
</div>
|
| 326 |
+
<div class="progress-bar">
|
| 327 |
+
<div id="overall-progress" class="progress-fill" style="width: 25%"></div>
|
| 328 |
+
</div>
|
| 329 |
+
</div>
|
| 330 |
+
</div>
|
| 331 |
+
</div>
|
| 332 |
+
|
| 333 |
+
<div class="bg-white border border-gray-200 rounded-lg p-6 shadow-sm">
|
| 334 |
+
<h3 class="text-lg font-semibold text-gray-800 mb-4">Practice Accuracy</h3>
|
| 335 |
+
<div class="flex items-center mb-2">
|
| 336 |
+
<div class="w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mr-4">
|
| 337 |
+
<i class="fas fa-check-circle text-green-500"></i>
|
| 338 |
+
</div>
|
| 339 |
+
<div class="flex-1">
|
| 340 |
+
<div class="flex justify-between mb-1">
|
| 341 |
+
<span class="text-sm font-medium text-gray-600">Correct Answers</span>
|
| 342 |
+
<span id="accuracy-percent" class="text-sm font-medium text-gray-600">75%</span>
|
| 343 |
+
</div>
|
| 344 |
+
<div class="progress-bar">
|
| 345 |
+
<div id="accuracy-progress" class="progress-fill bg-green-500" style="width: 75%"></div>
|
| 346 |
+
</div>
|
| 347 |
+
</div>
|
| 348 |
+
</div>
|
| 349 |
+
</div>
|
| 350 |
+
</div>
|
| 351 |
+
|
| 352 |
+
<div class="bg-white border border-gray-200 rounded-lg p-6 shadow-sm">
|
| 353 |
+
<h3 class="text-lg font-semibold text-gray-800 mb-4">Lesson Completion</h3>
|
| 354 |
+
|
| 355 |
+
<div class="space-y-4">
|
| 356 |
+
<!-- Initials Progress -->
|
| 357 |
+
<div>
|
| 358 |
+
<div class="flex justify-between mb-1">
|
| 359 |
+
<span class="font-medium text-gray-700">Initial Consonants</span>
|
| 360 |
+
<span class="text-sm font-medium text-gray-600">8/21</span>
|
| 361 |
+
</div>
|
| 362 |
+
<div class="progress-bar">
|
| 363 |
+
<div class="progress-fill" style="width: 38%"></div>
|
| 364 |
+
</div>
|
| 365 |
+
</div>
|
| 366 |
+
|
| 367 |
+
<!-- Medials Progress -->
|
| 368 |
+
<div>
|
| 369 |
+
<div class="flex justify-between mb-1">
|
| 370 |
+
<span class="font-medium text-gray-700">Medial Vowels</span>
|
| 371 |
+
<span class="text-sm font-medium text-gray-600">1/3</span>
|
| 372 |
+
</div>
|
| 373 |
+
<div class="progress-bar">
|
| 374 |
+
<div class="progress-fill" style="width: 33%"></div>
|
| 375 |
+
</div>
|
| 376 |
+
</div>
|
| 377 |
+
|
| 378 |
+
<!-- Finals Progress -->
|
| 379 |
+
<div>
|
| 380 |
+
<div class="flex justify-between mb-1">
|
| 381 |
+
<span class="font-medium text-gray-700">Final Sounds</span>
|
| 382 |
+
<span class="text-sm font-medium text-gray-600">4/13</span>
|
| 383 |
+
</div>
|
| 384 |
+
<div class="progress-bar">
|
| 385 |
+
<div class="progress-fill" style="width: 31%"></div>
|
| 386 |
+
</div>
|
| 387 |
+
</div>
|
| 388 |
+
|
| 389 |
+
<!-- Tones Progress -->
|
| 390 |
+
<div>
|
| 391 |
+
<div class="flex justify-between mb-1">
|
| 392 |
+
<span class="font-medium text-gray-700">Tones</span>
|
| 393 |
+
<span class="text-sm font-medium text-gray-600">2/5</span>
|
| 394 |
+
</div>
|
| 395 |
+
<div class="progress-bar">
|
| 396 |
+
<div class="progress-fill" style="width: 40%"></div>
|
| 397 |
+
</div>
|
| 398 |
+
</div>
|
| 399 |
+
</div>
|
| 400 |
+
</div>
|
| 401 |
+
</div>
|
| 402 |
+
</div>
|
| 403 |
+
</div>
|
| 404 |
+
</div>
|
| 405 |
+
|
| 406 |
+
<script>
|
| 407 |
+
// Zhuyin character data
|
| 408 |
+
const zhuyinData = {
|
| 409 |
+
initials: {
|
| 410 |
+
title: "Initial Consonants",
|
| 411 |
+
description: "Initial consonants are the starting sounds of Zhuyin syllables. There are 21 initial consonants in total.",
|
| 412 |
+
characters: [
|
| 413 |
+
{ char: "ㄅ", pinyin: "b", example: "八 (bā)" },
|
| 414 |
+
{ char: "ㄆ", pinyin: "p", example: "怕 (pà)" },
|
| 415 |
+
{ char: "ㄇ", pinyin: "m", example: "媽 (mā)" },
|
| 416 |
+
{ char: "ㄈ", pinyin: "f", example: "發 (fā)" },
|
| 417 |
+
{ char: "ㄉ", pinyin: "d", example: "大 (dà)" },
|
| 418 |
+
{ char: "ㄊ", pinyin: "t", example: "他 (tā)" },
|
| 419 |
+
{ char: "ㄋ", pinyin: "n", example: "你 (nǐ)" },
|
| 420 |
+
{ char: "ㄌ", pinyin: "l", example: "來 (lái)" },
|
| 421 |
+
{ char: "ㄍ", pinyin: "g", example: "哥 (gē)" },
|
| 422 |
+
{ char: "ㄎ", pinyin: "k", example: "看 (kàn)" },
|
| 423 |
+
{ char: "ㄏ", pinyin: "h", example: "好 (hǎo)" },
|
| 424 |
+
{ char: "ㄐ", pinyin: "j", example: "家 (jiā)" },
|
| 425 |
+
{ char: "ㄑ", pinyin: "q", example: "七 (qī)" },
|
| 426 |
+
{ char: "ㄒ", pinyin: "x", example: "西 (xī)" },
|
| 427 |
+
{ char: "ㄓ", pinyin: "zh", example: "這 (zhè)" },
|
| 428 |
+
{ char: "ㄔ", pinyin: "ch", example: "吃 (chī)" },
|
| 429 |
+
{ char: "ㄕ", pinyin: "sh", example: "是 (shì)" },
|
| 430 |
+
{ char: "ㄖ", pinyin: "r", example: "日 (rì)" },
|
| 431 |
+
{ char: "ㄗ", pinyin: "z", example: "在 (zài)" },
|
| 432 |
+
{ char: "ㄘ", pinyin: "c", example: "菜 (cài)" },
|
| 433 |
+
{ char: "ㄙ", pinyin: "s", example: "三 (sān)" }
|
| 434 |
+
]
|
| 435 |
+
},
|
| 436 |
+
medials: {
|
| 437 |
+
title: "Medial Vowels",
|
| 438 |
+
description: "Medial vowels are the middle sounds that combine with initial consonants. There are 3 medial vowels.",
|
| 439 |
+
characters: [
|
| 440 |
+
{ char: "ㄧ", pinyin: "i/y", example: "一 (yī)" },
|
| 441 |
+
{ char: "ㄨ", pinyin: "u/w", example: "五 (wǔ)" },
|
| 442 |
+
{ char: "ㄩ", pinyin: "ü/yu", example: "魚 (yú)" }
|
| 443 |
+
]
|
| 444 |
+
},
|
| 445 |
+
finals: {
|
| 446 |
+
title: "Final Sounds",
|
| 447 |
+
description: "Final sounds complete the Zhuyin syllables. There are 13 final sounds.",
|
| 448 |
+
characters: [
|
| 449 |
+
{ char: "ㄚ", pinyin: "a", example: "阿 (ā)" },
|
| 450 |
+
{ char: "ㄛ", pinyin: "o", example: "喔 (ō)" },
|
| 451 |
+
{ char: "ㄜ", pinyin: "e", example: "餓 (è)" },
|
| 452 |
+
{ char: "ㄝ", pinyin: "ê", example: "誒 (ê̄)" },
|
| 453 |
+
{ char: "ㄞ", pinyin: "ai", example: "愛 (ài)" },
|
| 454 |
+
{ char: "ㄟ", pinyin: "ei", example: "飛 (fēi)" },
|
| 455 |
+
{ char: "ㄠ", pinyin: "ao", example: "好 (hǎo)" },
|
| 456 |
+
{ char: "ㄡ", pinyin: "ou", example: "歐 (ōu)" },
|
| 457 |
+
{ char: "ㄢ", pinyin: "an", example: "安 (ān)" },
|
| 458 |
+
{ char: "ㄣ", pinyin: "en", example: "恩 (ēn)" },
|
| 459 |
+
{ char: "ㄤ", pinyin: "ang", example: "昂 (áng)" },
|
| 460 |
+
{ char: "ㄥ", pinyin: "eng", example: "冷 (lěng)" },
|
| 461 |
+
{ char: "ㄦ", pinyin: "er", example: "兒 (ér)" }
|
| 462 |
+
]
|
| 463 |
+
},
|
| 464 |
+
tones: {
|
| 465 |
+
title: "Tones",
|
| 466 |
+
description: "Mandarin Chinese has 4 main tones and 1 neutral tone. These are marked with tone marks in Zhuyin.",
|
| 467 |
+
characters: [
|
| 468 |
+
{ char: "ˉ", pinyin: "1st tone", example: "高平調 (high level)" },
|
| 469 |
+
{ char: "ˊ", pinyin: "2nd tone", example: "上升調 (rising)" },
|
| 470 |
+
{ char: "ˇ", pinyin: "3rd tone", example: "降升調 (falling-rising)" },
|
| 471 |
+
{ char: "ˋ", pinyin: "4th tone", example: "下降調 (falling)" },
|
| 472 |
+
{ char: "˙", pinyin: "neutral", example: "輕聲 (light)" }
|
| 473 |
+
]
|
| 474 |
+
},
|
| 475 |
+
combined: {
|
| 476 |
+
title: "Combined Sounds",
|
| 477 |
+
description: "Practice combining initials, medials and finals to form complete syllables.",
|
| 478 |
+
characters: [
|
| 479 |
+
{ char: "ㄅㄚ", pinyin: "ba", example: "八 (bā)" },
|
| 480 |
+
{ char: "ㄆㄠ", pinyin: "pao", example: "跑 (pǎo)" },
|
| 481 |
+
{ char: "ㄇㄧ", pinyin: "mi", example: "米 (mǐ)" },
|
| 482 |
+
{ char: "ㄈㄨ", pinyin: "fu", example: "服 (fú)" },
|
| 483 |
+
{ char: "ㄉㄧㄠ", pinyin: "diao", example: "掉 (diào)" },
|
| 484 |
+
{ char: "ㄊㄧㄢ", pinyin: "tian", example: "天 (tiān)" },
|
| 485 |
+
{ char: "ㄋㄩ", pinyin: "nü", example: "女 (nǚ)" },
|
| 486 |
+
{ char: "ㄌㄧㄤ", pinyin: "liang", example: "兩 (liǎng)" },
|
| 487 |
+
{ char: "ㄍㄨㄛ", pinyin: "guo", example: "國 (guó)" },
|
| 488 |
+
{ char: "ㄎㄨㄞ", pinyin: "kuai", example: "快 (kuài)" },
|
| 489 |
+
{ char: "ㄏㄜ", pinyin: "he", example: "和 (hé)" },
|
| 490 |
+
{ char: "ㄐㄧㄝ", pinyin: "jie", example: "姐 (jiě)" },
|
| 491 |
+
{ char: "ㄑㄩㄥ", pinyin: "qiong", example: "窮 (qióng)" },
|
| 492 |
+
{ char: "ㄒㄩㄝ", pinyin: "xue", example: "學 (xué)" },
|
| 493 |
+
{ char: "ㄓㄨㄤ", pinyin: "zhuang", example: "裝 (zhuāng)" },
|
| 494 |
+
{ char: "ㄔㄨㄣ", pinyin: "chun", example: "春 (chūn)" },
|
| 495 |
+
{ char: "ㄕㄨㄟ", pinyin: "shui", example: "水 (shuǐ)" },
|
| 496 |
+
{ char: "ㄖㄣ", pinyin: "ren", example: "人 (rén)" },
|
| 497 |
+
{ char: "ㄗㄞ", pinyin: "zai", example: "在 (zài)" },
|
| 498 |
+
{ char: "ㄘㄨㄣ", pinyin: "cun", example: "村 (cūn)" },
|
| 499 |
+
{ char: "ㄙㄨㄥ", pinyin: "song", example: "送 (sòng)" }
|
| 500 |
+
]
|
| 501 |
+
}
|
| 502 |
+
};
|
| 503 |
+
|
| 504 |
+
// Practice questions
|
| 505 |
+
const practiceQuestions = [
|
| 506 |
+
{ char: "ㄅ", pinyin: "b", audio: "b" },
|
| 507 |
+
{ char: "ㄆ", pinyin: "p", audio: "p" },
|
| 508 |
+
{ char: "ㄇ", pinyin: "m", audio: "m" },
|
| 509 |
+
{ char: "ㄈ", pinyin: "f", audio: "f" },
|
| 510 |
+
{ char: "ㄉ", pinyin: "d", audio: "d" },
|
| 511 |
+
{ char: "ㄊ", pinyin: "t", audio: "t" },
|
| 512 |
+
{ char: "ㄋ", pinyin: "n", audio: "n" },
|
| 513 |
+
{ char: "ㄌ", pinyin: "l", audio: "l" },
|
| 514 |
+
{ char: "ㄍ", pinyin: "g", audio: "g" },
|
| 515 |
+
{ char: "ㄎ", pinyin: "k", audio: "k" },
|
| 516 |
+
{ char: "ㄏ", pinyin: "h", audio: "h" },
|
| 517 |
+
{ char: "ㄐ", pinyin: "j", audio: "j" },
|
| 518 |
+
{ char: "ㄑ", pinyin: "q", audio: "q" },
|
| 519 |
+
{ char: "ㄒ", pinyin: "x", audio: "x" },
|
| 520 |
+
{ char: "ㄓ", pinyin: "zh", audio: "zh" },
|
| 521 |
+
{ char: "ㄔ", pinyin: "ch", audio: "ch" },
|
| 522 |
+
{ char: "ㄕ", pinyin: "sh", audio: "sh" },
|
| 523 |
+
{ char: "ㄖ", pinyin: "r", audio: "r" },
|
| 524 |
+
{ char: "ㄗ", pinyin: "z", audio: "z" },
|
| 525 |
+
{ char: "ㄘ", pinyin: "c", audio: "c" },
|
| 526 |
+
{ char: "ㄙ", pinyin: "s", audio: "s" },
|
| 527 |
+
{ char: "ㄧ", pinyin: "i/y", audio: "i" },
|
| 528 |
+
{ char: "ㄨ", pinyin: "u/w", audio: "u" },
|
| 529 |
+
{ char: "ㄩ", pinyin: "ü/yu", audio: "ü" },
|
| 530 |
+
{ char: "ㄚ", pinyin: "a", audio: "a" },
|
| 531 |
+
{ char: "ㄛ", pinyin: "o", audio: "o" },
|
| 532 |
+
{ char: "ㄜ", pinyin: "e", audio: "e" },
|
| 533 |
+
{ char: "ㄝ", pinyin: "ê", audio: "ê" },
|
| 534 |
+
{ char: "ㄞ", pinyin: "ai", audio: "ai" },
|
| 535 |
+
{ char: "ㄟ", pinyin: "ei", audio: "ei" },
|
| 536 |
+
{ char: "ㄠ", pinyin: "ao", audio: "ao" },
|
| 537 |
+
{ char: "ㄡ", pinyin: "ou", audio: "ou" },
|
| 538 |
+
{ char: "ㄢ", pinyin: "an", audio: "an" },
|
| 539 |
+
{ char: "ㄣ", pinyin: "en", audio: "en" },
|
| 540 |
+
{ char: "ㄤ", pinyin: "ang", audio: "ang" },
|
| 541 |
+
{ char: "ㄥ", pinyin: "eng", audio: "eng" },
|
| 542 |
+
{ char: "ㄦ", pinyin: "er", audio: "er" }
|
| 543 |
+
];
|
| 544 |
+
|
| 545 |
+
// Tab switching functionality
|
| 546 |
+
document.getElementById('lessons-tab').addEventListener('click', () => {
|
| 547 |
+
switchTab('lessons');
|
| 548 |
+
});
|
| 549 |
+
|
| 550 |
+
document.getElementById('practice-tab').addEventListener('click', () => {
|
| 551 |
+
switchTab('practice');
|
| 552 |
+
});
|
| 553 |
+
|
| 554 |
+
document.getElementById('progress-tab').addEventListener('click', () => {
|
| 555 |
+
switchTab('progress');
|
| 556 |
+
});
|
| 557 |
+
|
| 558 |
+
function switchTab(tabName) {
|
| 559 |
+
// Hide all tab contents
|
| 560 |
+
document.getElementById('lessons-content').classList.add('hidden');
|
| 561 |
+
document.getElementById('practice-content').classList.add('hidden');
|
| 562 |
+
document.getElementById('progress-content').classList.add('hidden');
|
| 563 |
+
|
| 564 |
+
// Remove active class from all tabs
|
| 565 |
+
document.getElementById('lessons-tab').classList.remove('tab-active');
|
| 566 |
+
document.getElementById('practice-tab').classList.remove('tab-active');
|
| 567 |
+
document.getElementById('progress-tab').classList.remove('tab-active');
|
| 568 |
+
|
| 569 |
+
// Show selected tab content and add active class
|
| 570 |
+
document.getElementById(`${tabName}-content`).classList.remove('hidden');
|
| 571 |
+
document.getElementById(`${tabName}-tab`).classList.add('tab-active');
|
| 572 |
+
}
|
| 573 |
+
|
| 574 |
+
// Lesson loading functionality
|
| 575 |
+
function loadLesson(lessonType) {
|
| 576 |
+
const lesson = zhuyinData[lessonType];
|
| 577 |
+
|
| 578 |
+
// Hide lessons list and show lesson detail
|
| 579 |
+
document.getElementById('lessons-content').querySelector('.grid').classList.add('hidden');
|
| 580 |
+
document.getElementById('lesson-detail').classList.remove('hidden');
|
| 581 |
+
|
| 582 |
+
// Set lesson title and description
|
| 583 |
+
document.getElementById('lesson-title').textContent = lesson.title;
|
| 584 |
+
document.getElementById('lesson-description').textContent = lesson.description;
|
| 585 |
+
|
| 586 |
+
// Clear previous characters
|
| 587 |
+
const charactersContainer = document.getElementById('lesson-characters');
|
| 588 |
+
charactersContainer.innerHTML = '';
|
| 589 |
+
|
| 590 |
+
// Add characters to the lesson
|
| 591 |
+
lesson.characters.forEach(charData => {
|
| 592 |
+
const charElement = document.createElement('div');
|
| 593 |
+
charElement.className = 'character-card bg-white border border-gray-200 rounded-lg p-4 text-center cursor-pointer hover:shadow-md';
|
| 594 |
+
charElement.innerHTML = `
|
| 595 |
+
<div class="zhuyin-char mb-2">${charData.char}</div>
|
| 596 |
+
<div class="text-gray-700 font-medium">${charData.pinyin}</div>
|
| 597 |
+
<div class="text-sm text-gray-500 mt-1">${charData.example}</div>
|
| 598 |
+
`;
|
| 599 |
+
charElement.addEventListener('click', () => {
|
| 600 |
+
// In a real app, this would play the sound
|
| 601 |
+
console.log(`Playing sound for ${charData.char}`);
|
| 602 |
+
});
|
| 603 |
+
charactersContainer.appendChild(charElement);
|
| 604 |
+
});
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
function backToLessons() {
|
| 608 |
+
// Show lessons list and hide lesson detail
|
| 609 |
+
document.getElementById('lessons-content').querySelector('.grid').classList.remove('hidden');
|
| 610 |
+
document.getElementById('lesson-detail').classList.add('hidden');
|
| 611 |
+
}
|
| 612 |
+
|
| 613 |
+
// Practice session functionality
|
| 614 |
+
let currentQuestion = 0;
|
| 615 |
+
let correctAnswers = 0;
|
| 616 |
+
let questions = [];
|
| 617 |
+
let currentCorrectAnswer = '';
|
| 618 |
+
|
| 619 |
+
document.getElementById('start-practice').addEventListener('click', startPractice);
|
| 620 |
+
|
| 621 |
+
function startPractice() {
|
| 622 |
+
// Hide start button and show practice session
|
| 623 |
+
document.getElementById('start-practice').classList.add('hidden');
|
| 624 |
+
document.getElementById('practice-session').classList.remove('hidden');
|
| 625 |
+
|
| 626 |
+
// Reset counters
|
| 627 |
+
currentQuestion = 0;
|
| 628 |
+
correctAnswers = 0;
|
| 629 |
+
|
| 630 |
+
// Create a shuffled list of 10 questions
|
| 631 |
+
questions = [...practiceQuestions].sort(() => 0.5 - Math.random()).slice(0, 10);
|
| 632 |
+
|
| 633 |
+
// Load first question
|
| 634 |
+
loadQuestion();
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
function loadQuestion() {
|
| 638 |
+
// Update progress
|
| 639 |
+
document.getElementById('progress-text').textContent = `Question ${currentQuestion + 1} of ${questions.length}`;
|
| 640 |
+
document.getElementById('progress-bar').style.width = `${(currentQuestion / questions.length) * 100}%`;
|
| 641 |
+
|
| 642 |
+
// Get current question
|
| 643 |
+
const question = questions[currentQuestion];
|
| 644 |
+
currentCorrectAnswer = question.char;
|
| 645 |
+
|
| 646 |
+
// Clear previous options and feedback
|
| 647 |
+
document.getElementById('answer-options').innerHTML = '';
|
| 648 |
+
document.getElementById('feedback').classList.add('hidden');
|
| 649 |
+
document.getElementById('correct-feedback').classList.add('hidden');
|
| 650 |
+
document.getElementById('wrong-feedback').classList.add('hidden');
|
| 651 |
+
|
| 652 |
+
// Create answer options (current question + 3 random others)
|
| 653 |
+
const options = [question];
|
| 654 |
+
const otherOptions = practiceQuestions.filter(q => q.char !== question.char);
|
| 655 |
+
|
| 656 |
+
// Shuffle and pick 3 random options
|
| 657 |
+
const shuffledOthers = [...otherOptions].sort(() => 0.5 - Math.random()).slice(0, 3);
|
| 658 |
+
options.push(...shuffledOthers);
|
| 659 |
+
|
| 660 |
+
// Shuffle the options again
|
| 661 |
+
const shuffledOptions = options.sort(() => 0.5 - Math.random());
|
| 662 |
+
|
| 663 |
+
// Create option buttons
|
| 664 |
+
shuffledOptions.forEach(option => {
|
| 665 |
+
const optionButton = document.createElement('button');
|
| 666 |
+
optionButton.className = 'bg-white border border-gray-200 rounded-lg p-4 text-center hover:bg-gray-50 focus:outline-none';
|
| 667 |
+
optionButton.innerHTML = `
|
| 668 |
+
<div class="zhuyin-char">${option.char}</div>
|
| 669 |
+
<div class="text-sm text-gray-500">${option.pinyin}</div>
|
| 670 |
+
`;
|
| 671 |
+
optionButton.addEventListener('click', () => checkAnswer(option.char));
|
| 672 |
+
document.getElementById('answer-options').appendChild(optionButton);
|
| 673 |
+
});
|
| 674 |
+
|
| 675 |
+
// Set up play sound button
|
| 676 |
+
document.getElementById('play-sound').addEventListener('click', () => {
|
| 677 |
+
// In a real app, this would play the sound for the current question
|
| 678 |
+
console.log(`Playing sound for ${question.char}`);
|
| 679 |
+
});
|
| 680 |
+
}
|
| 681 |
+
|
| 682 |
+
function checkAnswer(selectedChar) {
|
| 683 |
+
// Disable all answer options
|
| 684 |
+
const options = document.getElementById('answer-options').querySelectorAll('button');
|
| 685 |
+
options.forEach(option => {
|
| 686 |
+
option.disabled = true;
|
| 687 |
+
if (option.textContent.includes(currentCorrectAnswer)) {
|
| 688 |
+
option.classList.add('bg-green-100', 'border-green-300');
|
| 689 |
+
}
|
| 690 |
+
|
| 691 |
+
if (option.textContent.includes(selectedChar) && selectedChar !== currentCorrectAnswer) {
|
| 692 |
+
option.classList.add('bg-red-100', 'border-red-300');
|
| 693 |
+
}
|
| 694 |
+
});
|
| 695 |
+
|
| 696 |
+
// Show feedback
|
| 697 |
+
document.getElementById('feedback').classList.remove('hidden');
|
| 698 |
+
|
| 699 |
+
if (selectedChar === currentCorrectAnswer) {
|
| 700 |
+
correctAnswers++;
|
| 701 |
+
document.getElementById('correct-feedback').classList.remove('hidden');
|
| 702 |
+
} else {
|
| 703 |
+
document.getElementById('correct-answer-text').textContent = `The correct answer was: ${currentCorrectAnswer}`;
|
| 704 |
+
document.getElementById('wrong-feedback').classList.remove('hidden');
|
| 705 |
+
}
|
| 706 |
+
}
|
| 707 |
+
|
| 708 |
+
document.getElementById('next-question').addEventListener('click', () => {
|
| 709 |
+
currentQuestion++;
|
| 710 |
+
|
| 711 |
+
if (currentQuestion < questions.length) {
|
| 712 |
+
loadQuestion();
|
| 713 |
+
} else {
|
| 714 |
+
// Practice session complete, show results
|
| 715 |
+
showResults();
|
| 716 |
+
}
|
| 717 |
+
});
|
| 718 |
+
|
| 719 |
+
function showResults() {
|
| 720 |
+
document.getElementById('practice-session').classList.add('hidden');
|
| 721 |
+
document.getElementById('practice-results').classList.remove('hidden');
|
| 722 |
+
|
| 723 |
+
document.getElementById('results-score').textContent = `You scored ${correctAnswers} out of ${questions.length}`;
|
| 724 |
+
document.getElementById('correct-count').textContent = correctAnswers;
|
| 725 |
+
document.getElementById('incorrect-count').textContent = questions.length - correctAnswers;
|
| 726 |
+
|
| 727 |
+
// Update progress bars
|
| 728 |
+
document.querySelector('#practice-results .progress-fill').style.width = `${(correctAnswers / questions.length) * 100}%`;
|
| 729 |
+
document.querySelector('#practice-results .bg-red-50 .progress-fill').style.width = `${((questions.length - correctAnswers) / questions.length) * 100}%`;
|
| 730 |
+
}
|
| 731 |
+
|
| 732 |
+
function restartPractice() {
|
| 733 |
+
document.getElementById('practice-results').classList.add('hidden');
|
| 734 |
+
startPractice();
|
| 735 |
+
}
|
| 736 |
+
|
| 737 |
+
// Initialize the app with lessons tab
|
| 738 |
+
switchTab('lessons');
|
| 739 |
+
</script>
|
| 740 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=MarcusCorvus/bpmf-tw" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 741 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Create an app that teaches all of the Zhuyin bopomogo characters. Include all the consonants and vowels. You may separate them into different lessons to make it easier to learn. Then include a practice portion where the sound of a character is played and the student will have to respond by choosing the correct character.
|