Подэтап 5.3 — GameQuest
Browse filesСоздать мини-игры (“Order a coffee”, “At the airport”).
Подключить VoiceTrack внутри игровых сцен.
Сохранять очки и результат.
- components/voice-track.js +28 -17
- data-architecture.html +1 -0
- gamequest-airport.html +197 -0
- gamequest-coffee.html +202 -0
- gamequest.html +134 -0
- index.html +1 -1
- learning-engine.html +1 -0
- progress-report.html +1 -0
- self-talk-journal.html +2 -1
components/voice-track.js
CHANGED
|
@@ -266,7 +266,6 @@ class VoiceTrack extends HTMLElement {
|
|
| 266 |
this.mediaRecorder.stream.getTracks().forEach(track => track.stop());
|
| 267 |
}
|
| 268 |
}
|
| 269 |
-
|
| 270 |
async analyzeRecording() {
|
| 271 |
if (this.audioChunks.length === 0) return;
|
| 272 |
|
|
@@ -276,26 +275,38 @@ class VoiceTrack extends HTMLElement {
|
|
| 276 |
const audioBlob = new Blob(this.audioChunks, { type: 'audio/wav' });
|
| 277 |
|
| 278 |
try {
|
| 279 |
-
// In a real app, you would send to your backend API endpoint
|
| 280 |
-
// const formData = new FormData();
|
| 281 |
-
// formData.append('audio', audioBlob, 'recording.wav');
|
| 282 |
-
// const response = await fetch('/voice/analyze', {
|
| 283 |
-
// method: 'POST',
|
| 284 |
-
// body: formData
|
| 285 |
-
// });
|
| 286 |
-
// this.analysisResult = await response.json();
|
| 287 |
-
|
| 288 |
// Simulate API response for demo
|
| 289 |
await new Promise(resolve => setTimeout(resolve, 1500));
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
|
| 297 |
this.displayResults();
|
| 298 |
-
|
| 299 |
console.error('Error analyzing recording:', error);
|
| 300 |
alert('Error analyzing recording. Please try again.');
|
| 301 |
} finally {
|
|
|
|
| 266 |
this.mediaRecorder.stream.getTracks().forEach(track => track.stop());
|
| 267 |
}
|
| 268 |
}
|
|
|
|
| 269 |
async analyzeRecording() {
|
| 270 |
if (this.audioChunks.length === 0) return;
|
| 271 |
|
|
|
|
| 275 |
const audioBlob = new Blob(this.audioChunks, { type: 'audio/wav' });
|
| 276 |
|
| 277 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
// Simulate API response for demo
|
| 279 |
await new Promise(resolve => setTimeout(resolve, 1500));
|
| 280 |
+
|
| 281 |
+
// Check if we're in a game context
|
| 282 |
+
const isGamePage = window.location.pathname.includes('gamequest');
|
| 283 |
+
|
| 284 |
+
if (isGamePage) {
|
| 285 |
+
// Game-specific analysis with higher scores
|
| 286 |
+
this.analysisResult = {
|
| 287 |
+
pronunciation: Math.floor(Math.random() * 20) + 80,
|
| 288 |
+
confidence: Math.floor(Math.random() * 20) + 80,
|
| 289 |
+
fluency: Math.floor(Math.random() * 20) + 80,
|
| 290 |
+
clarity: Math.floor(Math.random() * 20) + 80
|
| 291 |
+
};
|
| 292 |
+
|
| 293 |
+
// Update game score if on game page
|
| 294 |
+
if (typeof updateScore === 'function') {
|
| 295 |
+
const points = Math.floor(this.analysisResult.confidence / 10);
|
| 296 |
+
updateScore(points);
|
| 297 |
+
}
|
| 298 |
+
} else {
|
| 299 |
+
// Regular analysis
|
| 300 |
+
this.analysisResult = {
|
| 301 |
+
pronunciation: Math.floor(Math.random() * 30) + 70,
|
| 302 |
+
confidence: Math.floor(Math.random() * 30) + 70,
|
| 303 |
+
fluency: Math.floor(Math.random() * 30) + 70,
|
| 304 |
+
clarity: Math.floor(Math.random() * 30) + 70
|
| 305 |
+
};
|
| 306 |
+
}
|
| 307 |
|
| 308 |
this.displayResults();
|
| 309 |
+
} catch (error) {
|
| 310 |
console.error('Error analyzing recording:', error);
|
| 311 |
alert('Error analyzing recording. Please try again.');
|
| 312 |
} finally {
|
data-architecture.html
CHANGED
|
@@ -57,6 +57,7 @@
|
|
| 57 |
<a href="select-role.html" class="hover:text-indigo-400 transition-colors">Roles</a>
|
| 58 |
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 59 |
<a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a>
|
|
|
|
| 60 |
</div>
|
| 61 |
</nav>
|
| 62 |
|
|
|
|
| 57 |
<a href="select-role.html" class="hover:text-indigo-400 transition-colors">Roles</a>
|
| 58 |
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 59 |
<a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a>
|
| 60 |
+
<a href="gamequest.html" class="hover:text-indigo-400 transition-colors">GameQuest</a>
|
| 61 |
</div>
|
| 62 |
</nav>
|
| 63 |
|
gamequest-airport.html
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>At the Airport | QuantumCode</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 10 |
+
<script src="components/voice-track.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
|
| 13 |
+
|
| 14 |
+
body {
|
| 15 |
+
font-family: 'Space Grotesk', sans-serif;
|
| 16 |
+
background-color: #0f172a;
|
| 17 |
+
color: #e2e8f0;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
.gradient-text {
|
| 21 |
+
background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%);
|
| 22 |
+
-webkit-background-clip: text;
|
| 23 |
+
background-clip: text;
|
| 24 |
+
color: transparent;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.glass-card {
|
| 28 |
+
background: rgba(15, 23, 42, 0.7);
|
| 29 |
+
backdrop-filter: blur(10px);
|
| 30 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 31 |
+
border-radius: 1rem;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.scene {
|
| 35 |
+
transition: all 0.3s ease;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.progress-bar {
|
| 39 |
+
height: 8px;
|
| 40 |
+
border-radius: 4px;
|
| 41 |
+
background: rgba(124, 58, 237, 0.2);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.progress-fill {
|
| 45 |
+
height: 100%;
|
| 46 |
+
border-radius: 4px;
|
| 47 |
+
background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%);
|
| 48 |
+
}
|
| 49 |
+
</style>
|
| 50 |
+
</head>
|
| 51 |
+
<body class="min-h-screen">
|
| 52 |
+
<nav class="px-6 py-4 flex justify-between items-center">
|
| 53 |
+
<div class="flex items-center space-x-2">
|
| 54 |
+
<i data-feather="cpu" class="text-indigo-500"></i>
|
| 55 |
+
<span class="text-xl font-bold gradient-text">QuantumCode</span>
|
| 56 |
+
</div>
|
| 57 |
+
<div class="flex items-center space-x-2">
|
| 58 |
+
<a href="i18n-setup.html" class="flex items-center text-sm hover:text-indigo-400 transition-colors">
|
| 59 |
+
<i data-feather="globe" class="w-4 h-4 mr-1"></i>
|
| 60 |
+
<span id="currentLang">EN</span>
|
| 61 |
+
</a>
|
| 62 |
+
</div>
|
| 63 |
+
</nav>
|
| 64 |
+
|
| 65 |
+
<main class="container mx-auto px-4 py-16">
|
| 66 |
+
<section class="max-w-4xl mx-auto">
|
| 67 |
+
<div class="flex justify-between items-center mb-8">
|
| 68 |
+
<h1 class="text-3xl md:text-4xl font-bold gradient-text">At the Airport</h1>
|
| 69 |
+
<div class="text-xl font-medium">
|
| 70 |
+
Score: <span id="currentScore" class="text-indigo-400">0</span>/100
|
| 71 |
+
</div>
|
| 72 |
+
</div>
|
| 73 |
+
|
| 74 |
+
<div class="glass-card p-8 mb-8">
|
| 75 |
+
<div class="scene" id="scene1">
|
| 76 |
+
<h3 class="text-xl font-bold mb-4">Check-in Counter</h3>
|
| 77 |
+
<p class="text-slate-300 mb-6">You're checking in for your flight. The agent asks for your passport and boarding details.</p>
|
| 78 |
+
|
| 79 |
+
<div class="glass-card p-6 mb-6">
|
| 80 |
+
<p class="mb-4">Agent: "Good morning. May I see your passport and boarding pass, please?"</p>
|
| 81 |
+
<voice-track></voice-track>
|
| 82 |
+
<p class="mt-4 text-sm text-slate-400">Try saying: "Here's my passport and boarding pass."</p>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<button id="nextScene1" class="px-6 py-2 bg-indigo-600 hover:bg-indigo-700 rounded-lg font-medium transition-colors">
|
| 86 |
+
Continue to Security
|
| 87 |
+
</button>
|
| 88 |
+
</div>
|
| 89 |
+
|
| 90 |
+
<div class="scene hidden" id="scene2">
|
| 91 |
+
<h3 class="text-xl font-bold mb-4">Security Checkpoint</h3>
|
| 92 |
+
<p class="text-slate-300 mb-6">The security officer needs to check your belongings before you proceed.</p>
|
| 93 |
+
|
| 94 |
+
<div class="glass-card p-6 mb-6">
|
| 95 |
+
<p class="mb-4">Officer: "Please remove your shoes, belt, and any metal objects. Do you have any liquids?"</p>
|
| 96 |
+
<voice-track></voice-track>
|
| 97 |
+
<p class="mt-4 text-sm text-slate-400">Try saying: "No liquids, just these items."</p>
|
| 98 |
+
</div>
|
| 99 |
+
|
| 100 |
+
<button id="nextScene2" class="px-6 py-2 bg-indigo-600 hover:bg-indigo-700 rounded-lg font-medium transition-colors">
|
| 101 |
+
Continue to Gate
|
| 102 |
+
</button>
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
<div class="scene hidden" id="scene3">
|
| 106 |
+
<h3 class="text-xl font-bold mb-4">Boarding Gate</h3>
|
| 107 |
+
<p class="text-slate-300 mb-6">You've reached the boarding gate and need to confirm your seat.</p>
|
| 108 |
+
|
| 109 |
+
<div class="glass-card p-6 mb-6">
|
| 110 |
+
<p class="mb-4">Agent: "Welcome aboard. May I see your boarding pass? Your seat number is 24B."</p>
|
| 111 |
+
<voice-track></voice-track>
|
| 112 |
+
<p class="mt-4 text-sm text-slate-400">Try saying: "Thank you. Which way to seat 24B?"</p>
|
| 113 |
+
</div>
|
| 114 |
+
|
| 115 |
+
<button id="completeGame" class="px-6 py-2 bg-indigo-600 hover:bg-indigo-700 rounded-lg font-medium transition-colors">
|
| 116 |
+
Complete Game
|
| 117 |
+
</button>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<div class="progress-bar w-full mb-2 mt-6">
|
| 121 |
+
<div class="progress-fill" id="progressBar" style="width: 0%"></div>
|
| 122 |
+
</div>
|
| 123 |
+
<div class="text-right text-sm text-slate-400">
|
| 124 |
+
Progress: <span id="progressText">0</span>%
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
|
| 128 |
+
<div class="text-center">
|
| 129 |
+
<a href="gamequest.html" class="inline-flex items-center px-6 py-3 border border-indigo-500 text-indigo-400 hover:bg-indigo-900/50 rounded-full font-medium transition-colors">
|
| 130 |
+
<i data-feather="arrow-left" class="mr-2"></i>
|
| 131 |
+
Back to GameQuest
|
| 132 |
+
</a>
|
| 133 |
+
</div>
|
| 134 |
+
</section>
|
| 135 |
+
</main>
|
| 136 |
+
|
| 137 |
+
<script>
|
| 138 |
+
let currentScore = 0;
|
| 139 |
+
let currentScene = 1;
|
| 140 |
+
let progress = 0;
|
| 141 |
+
|
| 142 |
+
// Scene navigation
|
| 143 |
+
document.getElementById('nextScene1').addEventListener('click', () => {
|
| 144 |
+
document.getElementById('scene1').classList.add('hidden');
|
| 145 |
+
document.getElementById('scene2').classList.remove('hidden');
|
| 146 |
+
currentScene = 2;
|
| 147 |
+
updateScore(30);
|
| 148 |
+
});
|
| 149 |
+
|
| 150 |
+
document.getElementById('nextScene2').addEventListener('click', () => {
|
| 151 |
+
document.getElementById('scene2').classList.add('hidden');
|
| 152 |
+
document.getElementById('scene3').classList.remove('hidden');
|
| 153 |
+
currentScene = 3;
|
| 154 |
+
updateScore(30);
|
| 155 |
+
});
|
| 156 |
+
|
| 157 |
+
document.getElementById('completeGame').addEventListener('click', () => {
|
| 158 |
+
updateScore(40);
|
| 159 |
+
completeGame();
|
| 160 |
+
});
|
| 161 |
+
|
| 162 |
+
// Update score and progress
|
| 163 |
+
function updateScore(points) {
|
| 164 |
+
currentScore += points;
|
| 165 |
+
document.getElementById('currentScore').textContent = currentScore;
|
| 166 |
+
|
| 167 |
+
progress = Math.min(currentScore / 100 * 100, 100);
|
| 168 |
+
document.getElementById('progressBar').style.width = `${progress}%`;
|
| 169 |
+
document.getElementById('progressText').textContent = Math.floor(progress);
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
function completeGame() {
|
| 173 |
+
// Save game stats
|
| 174 |
+
const stats = JSON.parse(localStorage.getItem('gamequestStats')) || {
|
| 175 |
+
gamesPlayed: 0,
|
| 176 |
+
totalScore: 0,
|
| 177 |
+
highScore: 0
|
| 178 |
+
};
|
| 179 |
+
|
| 180 |
+
stats.gamesPlayed += 1;
|
| 181 |
+
stats.totalScore += currentScore;
|
| 182 |
+
if (currentScore > stats.highScore) {
|
| 183 |
+
stats.highScore = currentScore;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
localStorage.setItem('gamequestStats', JSON.stringify(stats));
|
| 187 |
+
alert(`Congratulations! You scored ${currentScore}/100 points.`);
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
// Set initial language
|
| 191 |
+
document.getElementById('currentLang').textContent =
|
| 192 |
+
document.cookie.match('(^|;)\\s*NEXT_LOCALE\\s*=\\s*([^;]+)')?.pop() || 'EN';
|
| 193 |
+
|
| 194 |
+
feather.replace();
|
| 195 |
+
</script>
|
| 196 |
+
</body>
|
| 197 |
+
</html>
|
gamequest-coffee.html
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Order a Coffee | QuantumCode</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 10 |
+
<script src="components/voice-track.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
|
| 13 |
+
|
| 14 |
+
body {
|
| 15 |
+
font-family: 'Space Grotesk', sans-serif;
|
| 16 |
+
background-color: #0f172a;
|
| 17 |
+
color: #e2e8f0;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
.gradient-text {
|
| 21 |
+
background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%);
|
| 22 |
+
-webkit-background-clip: text;
|
| 23 |
+
background-clip: text;
|
| 24 |
+
color: transparent;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.glass-card {
|
| 28 |
+
background: rgba(15, 23, 42, 0.7);
|
| 29 |
+
backdrop-filter: blur(10px);
|
| 30 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 31 |
+
border-radius: 1rem;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.menu-item {
|
| 35 |
+
transition: all 0.2s ease;
|
| 36 |
+
border: 1px solid transparent;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.menu-item:hover {
|
| 40 |
+
border-color: #7c3aed;
|
| 41 |
+
transform: translateY(-2px);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.menu-item.selected {
|
| 45 |
+
border-color: #7c3aed;
|
| 46 |
+
background: rgba(124, 58, 237, 0.1);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.progress-bar {
|
| 50 |
+
height: 8px;
|
| 51 |
+
border-radius: 4px;
|
| 52 |
+
background: rgba(124, 58, 237, 0.2);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
.progress-fill {
|
| 56 |
+
height: 100%;
|
| 57 |
+
border-radius: 4px;
|
| 58 |
+
background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%);
|
| 59 |
+
}
|
| 60 |
+
</style>
|
| 61 |
+
</head>
|
| 62 |
+
<body class="min-h-screen">
|
| 63 |
+
<nav class="px-6 py-4 flex justify-between items-center">
|
| 64 |
+
<div class="flex items-center space-x-2">
|
| 65 |
+
<i data-feather="cpu" class="text-indigo-500"></i>
|
| 66 |
+
<span class="text-xl font-bold gradient-text">QuantumCode</span>
|
| 67 |
+
</div>
|
| 68 |
+
<div class="flex items-center space-x-2">
|
| 69 |
+
<a href="i18n-setup.html" class="flex items-center text-sm hover:text-indigo-400 transition-colors">
|
| 70 |
+
<i data-feather="globe" class="w-4 h-4 mr-1"></i>
|
| 71 |
+
<span id="currentLang">EN</span>
|
| 72 |
+
</a>
|
| 73 |
+
</div>
|
| 74 |
+
</nav>
|
| 75 |
+
|
| 76 |
+
<main class="container mx-auto px-4 py-16">
|
| 77 |
+
<section class="max-w-4xl mx-auto">
|
| 78 |
+
<div class="flex justify-between items-center mb-8">
|
| 79 |
+
<h1 class="text-3xl md:text-4xl font-bold gradient-text">Order a Coffee</h1>
|
| 80 |
+
<div class="text-xl font-medium">
|
| 81 |
+
Score: <span id="currentScore" class="text-indigo-400">0</span>/100
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<div class="glass-card p-8 mb-8">
|
| 86 |
+
<div class="flex flex-col md:flex-row gap-8">
|
| 87 |
+
<div class="md:w-1/3">
|
| 88 |
+
<h3 class="text-xl font-bold mb-4">Café Menu</h3>
|
| 89 |
+
<div class="space-y-3">
|
| 90 |
+
<div class="menu-item glass-card p-4 cursor-pointer" data-item="latte">
|
| 91 |
+
<div class="font-medium">Latte</div>
|
| 92 |
+
<div class="text-sm text-slate-400">Espresso with steamed milk</div>
|
| 93 |
+
</div>
|
| 94 |
+
<div class="menu-item glass-card p-4 cursor-pointer" data-item="cappuccino">
|
| 95 |
+
<div class="font-medium">Cappuccino</div>
|
| 96 |
+
<div class="text-sm text-slate-400">Espresso with foam</div>
|
| 97 |
+
</div>
|
| 98 |
+
<div class="menu-item glass-card p-4 cursor-pointer" data-item="americano">
|
| 99 |
+
<div class="font-medium">Americano</div>
|
| 100 |
+
<div class="text-sm text-slate-400">Espresso with hot water</div>
|
| 101 |
+
</div>
|
| 102 |
+
<div class="menu-item glass-card p-4 cursor-pointer" data-item="mocha">
|
| 103 |
+
<div class="font-medium">Mocha</div>
|
| 104 |
+
<div class="text-sm text-slate-400">Chocolate espresso</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
<div class="md:w-2/3">
|
| 110 |
+
<h3 class="text-xl font-bold mb-4">Your Order</h3>
|
| 111 |
+
<div class="glass-card p-6 mb-6 min-h-32" id="orderDisplay">
|
| 112 |
+
<p class="text-slate-400 italic">Your order will appear here...</p>
|
| 113 |
+
</div>
|
| 114 |
+
|
| 115 |
+
<div class="mb-6">
|
| 116 |
+
<voice-track></voice-track>
|
| 117 |
+
</div>
|
| 118 |
+
|
| 119 |
+
<div class="progress-bar w-full mb-2">
|
| 120 |
+
<div class="progress-fill" id="progressBar" style="width: 0%"></div>
|
| 121 |
+
</div>
|
| 122 |
+
<div class="text-right text-sm text-slate-400">
|
| 123 |
+
Progress: <span id="progressText">0</span>%
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<div class="text-center">
|
| 130 |
+
<a href="gamequest.html" class="inline-flex items-center px-6 py-3 border border-indigo-500 text-indigo-400 hover:bg-indigo-900/50 rounded-full font-medium transition-colors">
|
| 131 |
+
<i data-feather="arrow-left" class="mr-2"></i>
|
| 132 |
+
Back to GameQuest
|
| 133 |
+
</a>
|
| 134 |
+
</div>
|
| 135 |
+
</section>
|
| 136 |
+
</main>
|
| 137 |
+
|
| 138 |
+
<script>
|
| 139 |
+
let currentScore = 0;
|
| 140 |
+
let selectedItem = null;
|
| 141 |
+
let progress = 0;
|
| 142 |
+
|
| 143 |
+
// Menu item selection
|
| 144 |
+
document.querySelectorAll('.menu-item').forEach(item => {
|
| 145 |
+
item.addEventListener('click', function() {
|
| 146 |
+
document.querySelectorAll('.menu-item').forEach(i => i.classList.remove('selected'));
|
| 147 |
+
this.classList.add('selected');
|
| 148 |
+
selectedItem = this.getAttribute('data-item');
|
| 149 |
+
updateOrderDisplay();
|
| 150 |
+
});
|
| 151 |
+
});
|
| 152 |
+
|
| 153 |
+
function updateOrderDisplay() {
|
| 154 |
+
const orderDisplay = document.getElementById('orderDisplay');
|
| 155 |
+
if (selectedItem) {
|
| 156 |
+
orderDisplay.innerHTML = `
|
| 157 |
+
<p>You ordered: <span class="text-indigo-400 font-medium">${selectedItem}</span></p>
|
| 158 |
+
<p class="mt-2">Try saying: <span class="text-slate-300">"I'd like a ${selectedItem}, please"</span></p>
|
| 159 |
+
`;
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
// Update score and progress
|
| 164 |
+
function updateScore(points) {
|
| 165 |
+
currentScore += points;
|
| 166 |
+
document.getElementById('currentScore').textContent = currentScore;
|
| 167 |
+
|
| 168 |
+
progress = Math.min(currentScore / 100 * 100, 100);
|
| 169 |
+
document.getElementById('progressBar').style.width = `${progress}%`;
|
| 170 |
+
document.getElementById('progressText').textContent = Math.floor(progress);
|
| 171 |
+
|
| 172 |
+
if (progress >= 100) {
|
| 173 |
+
completeGame();
|
| 174 |
+
}
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
function completeGame() {
|
| 178 |
+
// Save game stats
|
| 179 |
+
const stats = JSON.parse(localStorage.getItem('gamequestStats')) || {
|
| 180 |
+
gamesPlayed: 0,
|
| 181 |
+
totalScore: 0,
|
| 182 |
+
highScore: 0
|
| 183 |
+
};
|
| 184 |
+
|
| 185 |
+
stats.gamesPlayed += 1;
|
| 186 |
+
stats.totalScore += currentScore;
|
| 187 |
+
if (currentScore > stats.highScore) {
|
| 188 |
+
stats.highScore = currentScore;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
localStorage.setItem('gamequestStats', JSON.stringify(stats));
|
| 192 |
+
alert(`Congratulations! You scored ${currentScore}/100 points.`);
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
// Set initial language
|
| 196 |
+
document.getElementById('currentLang').textContent =
|
| 197 |
+
document.cookie.match('(^|;)\\s*NEXT_LOCALE\\s*=\\s*([^;]+)')?.pop() || 'EN';
|
| 198 |
+
|
| 199 |
+
feather.replace();
|
| 200 |
+
</script>
|
| 201 |
+
</body>
|
| 202 |
+
</html>
|
gamequest.html
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>GameQuest | QuantumCode</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 10 |
+
<script src="components/voice-track.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
|
| 13 |
+
|
| 14 |
+
body {
|
| 15 |
+
font-family: 'Space Grotesk', sans-serif;
|
| 16 |
+
background-color: #0f172a;
|
| 17 |
+
color: #e2e8f0;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
.gradient-text {
|
| 21 |
+
background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%);
|
| 22 |
+
-webkit-background-clip: text;
|
| 23 |
+
background-clip: text;
|
| 24 |
+
color: transparent;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.glass-card {
|
| 28 |
+
background: rgba(15, 23, 42, 0.7);
|
| 29 |
+
backdrop-filter: blur(10px);
|
| 30 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 31 |
+
border-radius: 1rem;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.game-card {
|
| 35 |
+
transition: all 0.3s ease;
|
| 36 |
+
border: 1px solid transparent;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.game-card:hover {
|
| 40 |
+
transform: translateY(-5px);
|
| 41 |
+
border-color: #7c3aed;
|
| 42 |
+
}
|
| 43 |
+
</style>
|
| 44 |
+
</head>
|
| 45 |
+
<body class="min-h-screen">
|
| 46 |
+
<nav class="px-6 py-4 flex justify-between items-center">
|
| 47 |
+
<div class="flex items-center space-x-2">
|
| 48 |
+
<i data-feather="cpu" class="text-indigo-500"></i>
|
| 49 |
+
<span class="text-xl font-bold gradient-text">QuantumCode</span>
|
| 50 |
+
</div>
|
| 51 |
+
<div class="flex items-center space-x-2">
|
| 52 |
+
<a href="i18n-setup.html" class="flex items-center text-sm hover:text-indigo-400 transition-colors">
|
| 53 |
+
<i data-feather="globe" class="w-4 h-4 mr-1"></i>
|
| 54 |
+
<span id="currentLang">EN</span>
|
| 55 |
+
</a>
|
| 56 |
+
</div>
|
| 57 |
+
<div class="hidden md:flex space-x-8">
|
| 58 |
+
<a href="index.html" class="hover:text-indigo-400 transition-colors">Home</a>
|
| 59 |
+
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 60 |
+
<a href="gamequest.html" class="text-indigo-400">GameQuest</a>
|
| 61 |
+
</div>
|
| 62 |
+
</nav>
|
| 63 |
+
|
| 64 |
+
<main class="container mx-auto px-4 py-16">
|
| 65 |
+
<section class="max-w-6xl mx-auto">
|
| 66 |
+
<h1 class="text-4xl md:text-5xl font-bold mb-6">
|
| 67 |
+
<span class="gradient-text">GameQuest</span>
|
| 68 |
+
</h1>
|
| 69 |
+
<p class="text-xl text-slate-300 mb-10">
|
| 70 |
+
Practice real-world scenarios with our interactive mini-games.
|
| 71 |
+
</p>
|
| 72 |
+
|
| 73 |
+
<div class="grid md:grid-cols-2 gap-8 mb-12">
|
| 74 |
+
<a href="gamequest-coffee.html" class="game-card glass-card p-8 text-center">
|
| 75 |
+
<div class="w-16 h-16 rounded-full bg-indigo-900/50 flex items-center justify-center mx-auto mb-4">
|
| 76 |
+
<i data-feather="coffee" class="text-indigo-400"></i>
|
| 77 |
+
</div>
|
| 78 |
+
<h3 class="text-2xl font-bold mb-3">Order a Coffee</h3>
|
| 79 |
+
<p class="text-slate-300">Practice ordering at a café with voice recognition</p>
|
| 80 |
+
</a>
|
| 81 |
+
|
| 82 |
+
<a href="gamequest-airport.html" class="game-card glass-card p-8 text-center">
|
| 83 |
+
<div class="w-16 h-16 rounded-full bg-indigo-900/50 flex items-center justify-center mx-auto mb-4">
|
| 84 |
+
<i data-feather="plane" class="text-indigo-400"></i>
|
| 85 |
+
</div>
|
| 86 |
+
<h3 class="text-2xl font-bold mb-3">At the Airport</h3>
|
| 87 |
+
<p class="text-slate-300">Navigate airport check-in and security</p>
|
| 88 |
+
</a>
|
| 89 |
+
</div>
|
| 90 |
+
|
| 91 |
+
<div class="glass-card p-8">
|
| 92 |
+
<h2 class="text-2xl font-bold mb-6">Your GameQuest Stats</h2>
|
| 93 |
+
<div class="grid md:grid-cols-3 gap-6">
|
| 94 |
+
<div class="text-center">
|
| 95 |
+
<h3 class="text-xl font-bold mb-2">Games Played</h3>
|
| 96 |
+
<div class="text-4xl font-bold gradient-text" id="gamesPlayed">0</div>
|
| 97 |
+
</div>
|
| 98 |
+
<div class="text-center">
|
| 99 |
+
<h3 class="text-xl font-bold mb-2">Total Score</h3>
|
| 100 |
+
<div class="text-4xl font-bold gradient-text" id="totalScore">0</div>
|
| 101 |
+
</div>
|
| 102 |
+
<div class="text-center">
|
| 103 |
+
<h3 class="text-xl font-bold mb-2">Highest Score</h3>
|
| 104 |
+
<div class="text-4xl font-bold gradient-text" id="highScore">0</div>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
</section>
|
| 109 |
+
</main>
|
| 110 |
+
|
| 111 |
+
<script>
|
| 112 |
+
// Load stats from localStorage
|
| 113 |
+
function loadStats() {
|
| 114 |
+
const stats = JSON.parse(localStorage.getItem('gamequestStats')) || {
|
| 115 |
+
gamesPlayed: 0,
|
| 116 |
+
totalScore: 0,
|
| 117 |
+
highScore: 0
|
| 118 |
+
};
|
| 119 |
+
|
| 120 |
+
document.getElementById('gamesPlayed').textContent = stats.gamesPlayed;
|
| 121 |
+
document.getElementById('totalScore').textContent = stats.totalScore;
|
| 122 |
+
document.getElementById('highScore').textContent = stats.highScore;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
loadStats();
|
| 126 |
+
|
| 127 |
+
// Set initial language
|
| 128 |
+
document.getElementById('currentLang').textContent =
|
| 129 |
+
document.cookie.match('(^|;)\\s*NEXT_LOCALE\\s*=\\s*([^;]+)')?.pop() || 'EN';
|
| 130 |
+
|
| 131 |
+
feather.replace();
|
| 132 |
+
</script>
|
| 133 |
+
</body>
|
| 134 |
+
</html>
|
index.html
CHANGED
|
@@ -55,7 +55,7 @@
|
|
| 55 |
<a href="select-role.html" class="hover:text-indigo-400 transition-colors">Roles</a>
|
| 56 |
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 57 |
<a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a>
|
| 58 |
-
<a href="
|
| 59 |
</div>
|
| 60 |
<button class="md:hidden">
|
| 61 |
<i data-feather="menu"></i>
|
|
|
|
| 55 |
<a href="select-role.html" class="hover:text-indigo-400 transition-colors">Roles</a>
|
| 56 |
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 57 |
<a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a>
|
| 58 |
+
<a href="gamequest.html" class="hover:text-indigo-400 transition-colors">GameQuest</a>
|
| 59 |
</div>
|
| 60 |
<button class="md:hidden">
|
| 61 |
<i data-feather="menu"></i>
|
learning-engine.html
CHANGED
|
@@ -64,6 +64,7 @@
|
|
| 64 |
<a href="select-role.html" class="hover:text-indigo-400 transition-colors">Roles</a>
|
| 65 |
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 66 |
<a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a>
|
|
|
|
| 67 |
</div>
|
| 68 |
</nav>
|
| 69 |
|
|
|
|
| 64 |
<a href="select-role.html" class="hover:text-indigo-400 transition-colors">Roles</a>
|
| 65 |
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 66 |
<a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a>
|
| 67 |
+
<a href="gamequest.html" class="hover:text-indigo-400 transition-colors">GameQuest</a>
|
| 68 |
</div>
|
| 69 |
</nav>
|
| 70 |
|
progress-report.html
CHANGED
|
@@ -63,6 +63,7 @@
|
|
| 63 |
<a href="learning-engine.html" class="hover:text-indigo-400 transition-colors">API</a>
|
| 64 |
<a href="progress-report.html" class="text-indigo-400">Progress</a>
|
| 65 |
<a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a>
|
|
|
|
| 66 |
</div>
|
| 67 |
</nav>
|
| 68 |
|
|
|
|
| 63 |
<a href="learning-engine.html" class="hover:text-indigo-400 transition-colors">API</a>
|
| 64 |
<a href="progress-report.html" class="text-indigo-400">Progress</a>
|
| 65 |
<a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a>
|
| 66 |
+
<a href="gamequest.html" class="hover:text-indigo-400 transition-colors">GameQuest</a>
|
| 67 |
</div>
|
| 68 |
</nav>
|
| 69 |
|
self-talk-journal.html
CHANGED
|
@@ -58,7 +58,8 @@
|
|
| 58 |
<a href="index.html" class="hover:text-indigo-400 transition-colors">Home</a>
|
| 59 |
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 60 |
<a href="self-talk-journal.html" class="text-indigo-400">Self-Talk Journal</a>
|
| 61 |
-
|
|
|
|
| 62 |
</nav>
|
| 63 |
|
| 64 |
<main class="container mx-auto px-4 py-16">
|
|
|
|
| 58 |
<a href="index.html" class="hover:text-indigo-400 transition-colors">Home</a>
|
| 59 |
<a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a>
|
| 60 |
<a href="self-talk-journal.html" class="text-indigo-400">Self-Talk Journal</a>
|
| 61 |
+
<a href="gamequest.html" class="hover:text-indigo-400 transition-colors">GameQuest</a>
|
| 62 |
+
</div>
|
| 63 |
</nav>
|
| 64 |
|
| 65 |
<main class="container mx-auto px-4 py-16">
|