Spaces:
Running
Running
Upload 4 files (#3)
Browse files- Upload 4 files (f34ef9c8f79bfaeb13772bd71057a69430ecd655)
Co-authored-by: Sun Jacques <[email protected]>
- eleven.js +0 -0
- eleven_labs_script.js +1 -1
- game_logic.js +4 -1
- index.html +2 -8
eleven.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
eleven_labs_script.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
|
2 |
function injectElevenLabsWidget() {
|
3 |
const script = document.createElement('script');
|
4 |
-
script.src = '
|
5 |
script.async = true;
|
6 |
script.type = 'text/javascript';
|
7 |
document.head.appendChild(script);
|
|
|
1 |
|
2 |
function injectElevenLabsWidget() {
|
3 |
const script = document.createElement('script');
|
4 |
+
script.src = './eleven.js';
|
5 |
script.async = true;
|
6 |
script.type = 'text/javascript';
|
7 |
document.head.appendChild(script);
|
game_logic.js
CHANGED
@@ -59,6 +59,8 @@ const addStreamMessage = (message, type = 'user') => {
|
|
59 |
|
60 |
if (type === 'system') {
|
61 |
chatLine.innerHTML = `<span class="font-bold text-blue-600">${message}</span>`;
|
|
|
|
|
62 |
} else {
|
63 |
chatLine.innerHTML = `<span class="font-bold">${chatCount}.</span> <span>${message}</span>`;
|
64 |
chatCount++;
|
@@ -159,7 +161,8 @@ async function submitAdvice(adviceText) {
|
|
159 |
feedbackSection.classList.remove('hidden');
|
160 |
guessedWordEl.textContent = data.guessed_word;
|
161 |
guessScoreEl.textContent = `${data.score} / 10`;
|
162 |
-
feedbackTextEl.textContent = data.feedback;
|
|
|
163 |
|
164 |
addStreamMessage(`${data.guessed_word} - Score: ${data.score} / 10`);
|
165 |
guessInput.value = '';
|
|
|
59 |
|
60 |
if (type === 'system') {
|
61 |
chatLine.innerHTML = `<span class="font-bold text-blue-600">${message}</span>`;
|
62 |
+
} else if (type === 'student') {
|
63 |
+
chatLine.innerHTML = `<span class="font-bold text-green-600">${message}</span>`;
|
64 |
} else {
|
65 |
chatLine.innerHTML = `<span class="font-bold">${chatCount}.</span> <span>${message}</span>`;
|
66 |
chatCount++;
|
|
|
161 |
feedbackSection.classList.remove('hidden');
|
162 |
guessedWordEl.textContent = data.guessed_word;
|
163 |
guessScoreEl.textContent = `${data.score} / 10`;
|
164 |
+
// feedbackTextEl.textContent = data.feedback;
|
165 |
+
addStreamMessage(data.feedback, type='student');
|
166 |
|
167 |
addStreamMessage(`${data.guessed_word} - Score: ${data.score} / 10`);
|
168 |
guessInput.value = '';
|
index.html
CHANGED
@@ -33,17 +33,11 @@
|
|
33 |
</style>
|
34 |
</head>
|
35 |
<body class="bg-gradient-to-br from-gray-50 to-gray-100 min-h-screen flex flex-col items-center justify-center relative">
|
36 |
-
<!--
|
37 |
-
<div class="
|
38 |
<img src="./lemot.webp" alt="Lemot Logo" class="h-48 w-auto">
|
39 |
</div>
|
40 |
|
41 |
-
<div id="hints-container" class="absolute top-4 left-4 flex flex-col gap-4">
|
42 |
-
<!-- Hints will be dynamically inserted here -->
|
43 |
-
</div>
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
<!-- Professor Section -->
|
48 |
<div id="large-square" class="mb-10 w-48 h-48 bg-purple-500 flex flex-col items-center justify-center rounded-lg shadow-lg text-white font-bold text-xl">
|
49 |
<span class="iconify" data-icon="mdi:account-tie" data-width="48" data-height="48"></span>
|
|
|
33 |
</style>
|
34 |
</head>
|
35 |
<body class="bg-gradient-to-br from-gray-50 to-gray-100 min-h-screen flex flex-col items-center justify-center relative">
|
36 |
+
<!-- Title -->
|
37 |
+
<div class="flex justify-center items-start mt-4">
|
38 |
<img src="./lemot.webp" alt="Lemot Logo" class="h-48 w-auto">
|
39 |
</div>
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
<!-- Professor Section -->
|
42 |
<div id="large-square" class="mb-10 w-48 h-48 bg-purple-500 flex flex-col items-center justify-center rounded-lg shadow-lg text-white font-bold text-xl">
|
43 |
<span class="iconify" data-icon="mdi:account-tie" data-width="48" data-height="48"></span>
|