-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
445 lines (379 loc) · 14.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flash!</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&display=swap" rel="stylesheet">
<link rel="icon" type="image/png" href="3.ico">
<style>
body {
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
height: 100vh;
margin: 0;
background: #1b1b1b url('blur1.jpg') no-repeat center center;
background-size: cover;
font-family: 'Poppins', sans-serif;
overflow: hidden;
}
.cont {
position: relative;
width: 430px;
max-height: 90vh;
}
.container {
position: relative;
width: 420px;
max-height: 80vh;
background: rgba(33, 33, 33, 0.9); /* Darker ash color */
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 15px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
padding: 20px;
color: white;
text-align: center;
overflow: auto;
z-index: 1;
}
.button-container {
display: none; /* Hide buttons initially */
}
/* Style for the glowing circle */
.glowing-circle {
position: fixed; /* Fixed position to keep it at the bottom middle */
bottom: 20px; /* Distance from the bottom of the viewport */
left: 50%; /* Center horizontally */
transform: translateX(-50%); /* Center horizontally by translating */
width: 8px; /* Diameter of the circle */
height: 8px; /* Diameter of the circle */
background-color: #4395ff; /* Neon green color */
border-radius: 50%; /* Make it a circle */
z-index: 2; /* Make sure it's on top */
}
.note-tab {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 15px;
padding: 15px;
margin-bottom: 15px;
font-family: 'Space Mono', monospace;
color: #b0b0b0;
text-align: center; /* Center align text */
font-size: 0.9em;
position: relative; /* Ensure correct positioning */
}
.note-tab strong {
color: #a5c4ff; /* Different color for the "Note" text */
}
.container img {
width: 150px; /* Adjust as needed */
height: auto;
margin-bottom: 10px;
filter: invert(200%) sepia(100%) saturate(100%) hue-rotate(180deg); /* White color effect */
}
hr {
border: none;
border-top: 1px solid rgba(255, 255, 255, 0.2); /* Subtle grey line */
margin-bottom: 10px;
}
input[type="file"] {
margin-bottom: 15px;
padding: 8px;
border: none;
border-radius: 5px;
background: #444444; /* Subtle background */
color: #b0b0b0; /* Subtle text */
font-size: 14px; /* Reduced size */
display: block;
margin: 0 auto;
}
.randomize-container,
.button-container,
#word,
#meaning,
#example {
display: none; /* Initially hidden */
}
.randomize-container {
display: flex;
align-items: center;
justify-content: center;
margin: 15px 0;
}
.randomize-container input[type="checkbox"] {
margin-right: 8px;
}
.randomize-container span {
font-size: 14px;
color: #b0b0b0; /* Grey text */
}
#word {
margin: 15px 0;
padding: 8px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.15);
border: 1px solid rgba(255, 255, 255, 0.3);
font-size: 1.5em; /* Adjusted size */
}
#meaning {
margin: 15px 0;
padding: 8px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.1); /* Lighter background */
border: 1px solid rgba(255, 255, 255, 0.2);
font-size: 1.2em; /* Smaller font size */
color: #b0b0b0; /* Grey color */
display: none; /* Initially hidden */
animation: fadeIn 0.5s ease-in-out;
}
#example {
margin: 15px 0;
padding: 8px;
font-size: 1.2em; /* Matching font size */
color: #d0d0d0; /* Lighter grey color */
display: none; /* Initially hidden */
font-family: 'Space Mono', monospace; /* Use Space Mono font */
text-align: left; /* Left-align text */
animation: fadeIn 0.5s ease-in-out;
}
.button-container {
margin-top: 15px;
display: flex;
justify-content: center; /* Center align buttons */
gap: 10px; /* Space between buttons */
}
button {
background-color: #3498db;
color: white;
font-size: 14px; /* Reduced size */
padding: 8px 15px;
margin: 5px;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s, transform 0.3s;
}
button:hover {
background-color: #2980b9;
transform: scale(1.05);
}
button:disabled {
background-color: #95a5a6;
cursor: not-allowed;
}
button:disabled:hover {
background-color: #95a5a6;
transform: none;
}
.footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15px;
font-size: 12px; /* Reduced size */
color: #b0b0b0; /* Grey text */
}
/* Apple-like animation for showing meaning */
@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes moveLeftRight {
0%, 100% { transform: translateX(0); }
50% { transform: translateX(5px); } /* Reduced movement to avoid shaking */
}
/* Typing effect for example text */
@keyframes typing {
from { width: 0; }
to { width: 100%; }
}
@keyframes blink-caret {
from, to { border-color: transparent; }
50% { border-color: #b0b0b0; }
}
.typing-effect {
display: inline-block;
white-space: nowrap;
overflow: hidden;
border-right: 2px solid #b0b0b0; /* Cursor effect */
animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}
@media (max-width: 768px) {
.container {
width: 90%;
max-height: none;
height: auto;
}
#word {
font-size: 1.2em;
}
#meaning {
font-size: 1em;
}
#example {
font-size: 1em;
}
.button-container {
flex-direction: column;
}
button {
width: 100%;
margin: 10px 0;
}
}
</style>
</head>
<body>
<div class="cont">
<div class="container">
<img src="toefl.svg" alt="TOEFL Visualizer">
<hr>
</div>
<br>
<div class="container">
<!-- <img src="toefl.svg" alt="TOEFL Visualizer"> -->
<hr>
<input type="file" id="fileInput" accept=".txt">
<label class="randomize-container">
<input type="checkbox" id="randomizeCheckbox">
<span>Randomize words</span>
</label>
<div id="word"></div>
<div id="meaning"></div>
<div id="example" class="example-container"></div> <!-- Added example box with animation -->
<div class="button-container">
<button id="nextButton" disabled>Next</button>
<button id="showMeaningButton" disabled>Show Meaning</button>
<button id="stopButton" disabled>Stop</button>
</div>
<br>
<div id="noteTab" class="note-tab">
<strong>Note:</strong> Upload text file format : word ; meaning ; example
</div>
<hr>
<div class="footer">
<span id="attemptedQuestions">Questions Attempted: 0</span>
<span id="correctQuestions">Correct Answers: 0</span>
</div>
<!-- <div class="glowing-circle"></div> -->
</div>
<br>
<div class="container">
<div id="noteTab" class="note-tab">
<a href="https://testready.ets.org/other-resources"><strong>(A) </strong></a>
<a href="https://www.ets.org/toefl/institutions/ibt/about/content-structure.html#accordion-1c49b2eb62-item-8a52b15774"><strong>(B) |</strong></a>
<a href="https://liuxue.koolearn.com/toefl/"><strong>Reading</strong></a>
<a href="https://liuxue.koolearn.com/toefl/"><strong>Listening</strong></a>
<a href="https://liuxue.koolearn.com/toefl/"><strong>Speaking</strong></a>
<a href="https://liuxue.koolearn.com/toefl/"><strong>Writing</strong></a>
</div>
</div>
</div>
<script>
let wordList = [];
let currentIndex = 0;
let randomized = false;
const fileInput = document.getElementById('fileInput');
const nextButton = document.getElementById('nextButton');
const showMeaningButton = document.getElementById('showMeaningButton');
const stopButton = document.getElementById('stopButton');
const wordElement = document.getElementById('word');
const meaningElement = document.getElementById('meaning');
const exampleElement = document.getElementById('example');
const noteTab = document.getElementById('noteTab');
const randomizeCheckbox = document.getElementById('randomizeCheckbox');
const attemptedQuestionsElement = document.getElementById('attemptedQuestions');
const correctQuestionsElement = document.getElementById('correctQuestions');
fileInput.addEventListener('change', function(event) {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
const content = e.target.result;
wordList = content.trim().split('\n').map(line => {
const [word, meaning, example] = line.split(';');
return { word: word.trim(), meaning: meaning.trim(), example: example ? example.trim() : '' };
});
if (randomizeCheckbox.checked) {
wordList = wordList.sort(() => Math.random() - 0.5);
randomized = true;
}
noteTab.style.display = 'none'; // Hide note tab after file upload
wordElement.style.display = 'block';
showMeaningButton.disabled = false;
nextButton.disabled = false;
stopButton.disabled = false;
randomizeCheckbox.style.display = 'none'; // Hide checkbox after file upload
document.querySelector('.button-container').style.display = 'flex'; // Show buttons
fileInput.style.display = 'none'; // Hide file input box after upload
displayNextWord();
};
reader.readAsText(file);
}
});
nextButton.addEventListener('click', function() {
displayNextWord();
});
showMeaningButton.addEventListener('click', function() {
if (currentIndex > 0) {
const wordItem = wordList[currentIndex - 1];
meaningElement.innerText = wordItem.meaning;
meaningElement.style.display = wordItem.meaning ? 'block' : 'none';
exampleElement.innerHTML = ''; // Clear previous example text
exampleElement.style.display = wordItem.example ? 'block' : 'none';
if (wordItem.example) {
// Typing effect
const exampleText = wordItem.example;
let index = 0;
exampleElement.innerHTML = ''; // Clear previous example
const typingEffect = setInterval(() => {
exampleElement.innerHTML += exampleText[index];
index++;
if (index === exampleText.length) {
clearInterval(typingEffect);
}
}, 50); // Adjust typing speed here
}
updateStats(false);
}
});
stopButton.addEventListener('click', function() {
// Implement stop functionality if needed
});
function displayNextWord() {
if (currentIndex < wordList.length) {
wordElement.innerText = wordList[currentIndex].word;
meaningElement.innerText = ''; // Clear previous meaning
exampleElement.innerHTML = ''; // Clear previous example
currentIndex++;
nextButton.disabled = currentIndex >= wordList.length;
showMeaningButton.disabled = currentIndex === 0;
updateStats(true);
}
}
function updateStats(attempt) {
if (attempt) {
const attempted = parseInt(attemptedQuestionsElement.textContent.split(': ')[1]);
attemptedQuestionsElement.textContent = `Questions Attempted: ${attempted + 1}`;
}
// Implement correctAnswers logic if needed
}
</script>
</body>
</html>