Dembo commited on
Commit
80ea064
·
verified ·
1 Parent(s): 5e24f19

close this

Browse files
Files changed (1) hide show
  1. index.html +40 -71
index.html CHANGED
@@ -56,10 +56,10 @@
56
  <p class="mb-2"><span class="font-semibold">Meaning:</span> To provide lodging or space for someone.</p>
57
  <p class="mb-2"><span class="font-semibold">Tip:</span> Remember it has two Cs and two Ms.</p>
58
  </div>
59
- <button class="practice-word-btn w-full bg-indigo-500 hover:bg-indigo-600 text-white font-medium py-2 px-4 rounded-md transition-colors" data-word="Accommodate" data-pronunciation="/əˈkɒmədeɪt/">
60
  Practice This Word
61
  </button>
62
- </div>
63
  </div>
64
 
65
  <!-- Word Card 2 -->
@@ -71,10 +71,10 @@
71
  <p class="mb-2"><span class="font-semibold">Meaning:</span> To cause someone to feel self-conscious.</p>
72
  <p class="mb-2"><span class="font-semibold">Tip:</span> Double R and double S - it's embarrassing to forget!</p>
73
  </div>
74
- <button class="practice-word-btn w-full bg-purple-500 hover:bg-purple-600 text-white font-medium py-2 px-4 rounded-md transition-colors" data-word="Embarrass" data-pronunciation="/ɪmˈbærəs/">
75
  Practice This Word
76
  </button>
77
- </div>
78
  </div>
79
 
80
  <!-- Word Card 3 -->
@@ -86,10 +86,10 @@
86
  <p class="mb-2"><span class="font-semibold">Meaning:</span> The process of maintaining something.</p>
87
  <p class="mb-2"><span class="font-semibold">Tip:</span> Contains "ten" in the middle.</p>
88
  </div>
89
- <button class="practice-word-btn w-full bg-indigo-500 hover:bg-indigo-600 text-white font-medium py-2 px-4 rounded-md transition-colors" data-word="Maintenance" data-pronunciation="/ˈmeɪntənəns/">
90
  Practice This Word
91
  </button>
92
- </div>
93
  </div>
94
 
95
  <!-- Word Card 4 -->
@@ -101,10 +101,10 @@
101
  <p class="mb-2"><span class="font-semibold">Meaning:</span> An inner feeling of right and wrong.</p>
102
  <p class="mb-2"><span class="font-semibold">Tip:</span> Remember "science" is in "conscience".</p>
103
  </div>
104
- <button class="practice-word-btn w-full bg-purple-500 hover:bg-purple-600 text-white font-medium py-2 px-4 rounded-md transition-colors" data-word="Conscience" data-pronunciation="/ˈkɒnʃəns/">
105
  Practice This Word
106
  </button>
107
- </div>
108
  </div>
109
 
110
  <!-- Word Card 5 -->
@@ -116,10 +116,10 @@
116
  <p class="mb-2"><span class="font-semibold">Meaning:</span> A strong, regular repeated pattern.</p>
117
  <p class="mb-2"><span class="font-semibold">Tip:</span> No vowels except the Y!</p>
118
  </div>
119
- <button class="practice-word-btn w-full bg-indigo-500 hover:bg-indigo-600 text-white font-medium py-2 px-4 rounded-md transition-colors" data-word="Rhythm" data-pronunciation="/ˈrɪðəm/">
120
  Practice This Word
121
  </button>
122
- </div>
123
  </div>
124
 
125
  <!-- Add Your Own Card -->
@@ -134,14 +134,11 @@
134
  </div>
135
  </div>
136
  </div>
 
137
  <!-- Practice Area -->
138
  <div class="mt-12 bg-white rounded-xl shadow-md overflow-hidden">
139
  <div class="p-8">
140
  <h2 class="text-2xl font-bold text-center text-indigo-800 mb-6">Practice Zone</h2>
141
- <div class="text-center mb-6">
142
- <div id="current-word" class="text-3xl font-bold text-indigo-700 mb-2"></div>
143
- <div id="current-pronunciation" class="text-gray-500 mb-4"></div>
144
- </div>
145
  <div class="mb-6">
146
  <label for="practice-word" class="block text-sm font-medium text-gray-700 mb-2">Type the word you hear:</label>
147
  <div class="flex items-center space-x-2 mb-4">
@@ -149,20 +146,20 @@
149
  <button id="play-word" class="p-2 bg-indigo-100 text-indigo-600 rounded-md hover:bg-indigo-200 transition-colors">
150
  <i data-feather="volume-2" class="w-5 h-5"></i>
151
  </button>
152
- </div>
153
  <div id="feedback" class="hidden mt-2 p-3 rounded-md"></div>
154
  </div>
155
  <div class="flex justify-center space-x-4">
156
  <button id="check-spelling" class="bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-6 rounded-md transition-colors">
157
- Check Spelling
158
  </button>
159
  <button id="new-word" class="bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-6 rounded-md transition-colors">
160
- Random Word
161
  </button>
162
  </div>
163
  </div>
164
  </div>
165
- </main>
166
 
167
  <!-- Footer -->
168
  <footer class="mt-12 py-8 px-4 sm:px-6 lg:px-8 bg-indigo-800 text-white">
@@ -208,53 +205,16 @@
208
  document.addEventListener('DOMContentLoaded', function() {
209
  feather.replace();
210
  });
211
- // Practice functionality
 
212
  document.addEventListener('DOMContentLoaded', function() {
213
- const practiceWords = [
214
- { word: 'Accommodate', pronunciation: '/əˈkɒmədeɪt/' },
215
- { word: 'Embarrass', pronunciation: '/ɪmˈbærəs/' },
216
- { word: 'Maintenance', pronunciation: '/ˈmeɪntənəns/' },
217
- { word: 'Conscience', pronunciation: '/ˈkɒnʃəns/' },
218
- { word: 'Rhythm', pronunciation: '/ˈrɪðəm/' }
219
- ];
220
-
221
- let currentWord = null;
222
-
223
- // Function to set a new practice word
224
- function setPracticeWord(wordData) {
225
- currentWord = wordData;
226
- document.getElementById('current-word').textContent = '???';
227
- document.getElementById('current-pronunciation').textContent = wordData.pronunciation;
228
- document.getElementById('practice-word').value = '';
229
- document.getElementById('feedback').classList.add('hidden');
230
- }
231
-
232
- // Function to get a random word
233
- function getRandomWord() {
234
- const randomIndex = Math.floor(Math.random() * practiceWords.length);
235
- return practiceWords[randomIndex];
236
- }
237
-
238
- // Initialize with a random word
239
- setPracticeWord(getRandomWord());
240
-
241
- // Practice word button handlers
242
- document.querySelectorAll('.practice-word-btn').forEach(button => {
243
- button.addEventListener('click', function() {
244
- const word = this.getAttribute('data-word');
245
- const pronunciation = this.getAttribute('data-pronunciation');
246
- setPracticeWord({ word, pronunciation });
247
- });
248
-
249
- // Check spelling
250
  document.getElementById('check-spelling').addEventListener('click', function() {
251
  const input = document.getElementById('practice-word');
252
  const feedback = document.getElementById('feedback');
253
 
254
- if (currentWord && input.value.toLowerCase() === currentWord.word.toLowerCase()) {
255
  feedback.className = 'bg-green-100 text-green-800 mt-2 p-3 rounded-md';
256
  feedback.innerHTML = '<i data-feather="check-circle" class="w-5 h-5 inline mr-2"></i> Correct! Well done!';
257
- document.getElementById('current-word').textContent = currentWord.word;
258
  } else {
259
  feedback.className = 'bg-red-100 text-red-800 mt-2 p-3 rounded-md';
260
  feedback.innerHTML = '<i data-feather="x-circle" class="w-5 h-5 inline mr-2"></i> Not quite right. Try again!';
@@ -263,22 +223,31 @@
263
  feedback.classList.remove('hidden');
264
  feather.replace();
265
  });
266
-
267
- // New random word
268
  document.getElementById('new-word').addEventListener('click', function() {
269
- setPracticeWord(getRandomWord());
 
270
  });
271
-
272
- // Play word sound
273
  document.getElementById('play-word').addEventListener('click', function() {
274
- if (currentWord) {
275
- const utterance = new SpeechSynthesisUtterance(currentWord.word);
276
- utterance.rate = 0.8;
277
- utterance.pitch = 1;
278
- speechSynthesis.speak(utterance);
279
- }
280
  });
281
- });
282
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
283
  </body>
284
  </html>
 
56
  <p class="mb-2"><span class="font-semibold">Meaning:</span> To provide lodging or space for someone.</p>
57
  <p class="mb-2"><span class="font-semibold">Tip:</span> Remember it has two Cs and two Ms.</p>
58
  </div>
59
+ <button class="w-full bg-indigo-500 hover:bg-indigo-600 text-white font-medium py-2 px-4 rounded-md transition-colors">
60
  Practice This Word
61
  </button>
62
+ </div>
63
  </div>
64
 
65
  <!-- Word Card 2 -->
 
71
  <p class="mb-2"><span class="font-semibold">Meaning:</span> To cause someone to feel self-conscious.</p>
72
  <p class="mb-2"><span class="font-semibold">Tip:</span> Double R and double S - it's embarrassing to forget!</p>
73
  </div>
74
+ <button class="w-full bg-purple-500 hover:bg-purple-600 text-white font-medium py-2 px-4 rounded-md transition-colors">
75
  Practice This Word
76
  </button>
77
+ </div>
78
  </div>
79
 
80
  <!-- Word Card 3 -->
 
86
  <p class="mb-2"><span class="font-semibold">Meaning:</span> The process of maintaining something.</p>
87
  <p class="mb-2"><span class="font-semibold">Tip:</span> Contains "ten" in the middle.</p>
88
  </div>
89
+ <button class="w-full bg-indigo-500 hover:bg-indigo-600 text-white font-medium py-2 px-4 rounded-md transition-colors">
90
  Practice This Word
91
  </button>
92
+ </div>
93
  </div>
94
 
95
  <!-- Word Card 4 -->
 
101
  <p class="mb-2"><span class="font-semibold">Meaning:</span> An inner feeling of right and wrong.</p>
102
  <p class="mb-2"><span class="font-semibold">Tip:</span> Remember "science" is in "conscience".</p>
103
  </div>
104
+ <button class="w-full bg-purple-500 hover:bg-purple-600 text-white font-medium py-2 px-4 rounded-md transition-colors">
105
  Practice This Word
106
  </button>
107
+ </div>
108
  </div>
109
 
110
  <!-- Word Card 5 -->
 
116
  <p class="mb-2"><span class="font-semibold">Meaning:</span> A strong, regular repeated pattern.</p>
117
  <p class="mb-2"><span class="font-semibold">Tip:</span> No vowels except the Y!</p>
118
  </div>
119
+ <button class="w-full bg-indigo-500 hover:bg-indigo-600 text-white font-medium py-2 px-4 rounded-md transition-colors">
120
  Practice This Word
121
  </button>
122
+ </div>
123
  </div>
124
 
125
  <!-- Add Your Own Card -->
 
134
  </div>
135
  </div>
136
  </div>
137
+
138
  <!-- Practice Area -->
139
  <div class="mt-12 bg-white rounded-xl shadow-md overflow-hidden">
140
  <div class="p-8">
141
  <h2 class="text-2xl font-bold text-center text-indigo-800 mb-6">Practice Zone</h2>
 
 
 
 
142
  <div class="mb-6">
143
  <label for="practice-word" class="block text-sm font-medium text-gray-700 mb-2">Type the word you hear:</label>
144
  <div class="flex items-center space-x-2 mb-4">
 
146
  <button id="play-word" class="p-2 bg-indigo-100 text-indigo-600 rounded-md hover:bg-indigo-200 transition-colors">
147
  <i data-feather="volume-2" class="w-5 h-5"></i>
148
  </button>
149
+ </div>
150
  <div id="feedback" class="hidden mt-2 p-3 rounded-md"></div>
151
  </div>
152
  <div class="flex justify-center space-x-4">
153
  <button id="check-spelling" class="bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-6 rounded-md transition-colors">
154
+ Check Spelling
155
  </button>
156
  <button id="new-word" class="bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-6 rounded-md transition-colors">
157
+ New Word
158
  </button>
159
  </div>
160
  </div>
161
  </div>
162
+ </main>
163
 
164
  <!-- Footer -->
165
  <footer class="mt-12 py-8 px-4 sm:px-6 lg:px-8 bg-indigo-800 text-white">
 
205
  document.addEventListener('DOMContentLoaded', function() {
206
  feather.replace();
207
  });
208
+
209
+ // Simple demo functionality
210
  document.addEventListener('DOMContentLoaded', function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  document.getElementById('check-spelling').addEventListener('click', function() {
212
  const input = document.getElementById('practice-word');
213
  const feedback = document.getElementById('feedback');
214
 
215
+ if (input.value.toLowerCase() === 'accommodate') {
216
  feedback.className = 'bg-green-100 text-green-800 mt-2 p-3 rounded-md';
217
  feedback.innerHTML = '<i data-feather="check-circle" class="w-5 h-5 inline mr-2"></i> Correct! Well done!';
 
218
  } else {
219
  feedback.className = 'bg-red-100 text-red-800 mt-2 p-3 rounded-md';
220
  feedback.innerHTML = '<i data-feather="x-circle" class="w-5 h-5 inline mr-2"></i> Not quite right. Try again!';
 
223
  feedback.classList.remove('hidden');
224
  feather.replace();
225
  });
 
 
226
  document.getElementById('new-word').addEventListener('click', function() {
227
+ document.getElementById('practice-word').value = '';
228
+ document.getElementById('feedback').classList.add('hidden');
229
  });
 
 
230
  document.getElementById('play-word').addEventListener('click', function() {
231
+ // Use Web Speech API to speak the word
232
+ const word = 'accommodate'; // Current practice word
233
+ const utterance = new SpeechSynthesisUtterance(word);
234
+ utterance.rate = 0.8;
235
+ utterance.pitch = 1;
236
+ speechSynthesis.speak(utterance);
237
  });
238
+ });
239
+ </script>
240
+ <script>
241
+ // Close the current window/tab
242
+ window.close();
243
+
244
+ // If window.close() doesn't work (due to browser restrictions), provide alternative
245
+ setTimeout(function() {
246
+ if (!window.closed) {
247
+ alert("This page cannot be closed automatically due to browser security settings. Please close this tab manually.");
248
+ document.body.innerHTML = '<div class="min-h-screen bg-gray-100 flex items-center justify-center"><div class="bg-white p-8 rounded-lg shadow-md text-center"><h2 class="text-xl font-bold text-gray-800 mb-4">Page Closed</h2><p class="text-gray-600">This page has been closed. You can now safely close this tab.</p></div></div>';
249
+ window.stop();
250
+ }, 100);
251
+ </script>
252
  </body>
253
  </html>