|
9 | 9 | <link rel="stylesheet" href="../css/basic.css" />
|
10 | 10 | <link rel="shortcut icon" href="../assets/images/Arito_favicon.png" type="image/x-icon" />
|
11 | 11 | <link rel="stylesheet" href="../css/main.css" />
|
| 12 | + <style> |
| 13 | + |
| 14 | + .dark-mode-toggle { |
| 15 | + background-color: #333; |
| 16 | + color: #fff; |
| 17 | + border: none; |
| 18 | + padding: 10px 20px; |
| 19 | + font-size: 16px; |
| 20 | + cursor: pointer; |
| 21 | + border-radius: 5px; |
| 22 | + transition: background-color 0.3s, color 0.3s; |
| 23 | + } |
| 24 | + |
| 25 | + .dark-mode-toggle:hover { |
| 26 | + background-color: #555; |
| 27 | + } |
| 28 | + |
| 29 | + .dark-mode .dark-mode-toggle { |
| 30 | + background-color: #fff; |
| 31 | + color: #333; |
| 32 | + } |
| 33 | + |
| 34 | + .dark-mode .dark-mode-toggle:hover { |
| 35 | + background-color: #ddd; |
| 36 | + } |
| 37 | + .dark-mode body { |
| 38 | + background-color: #121212; |
| 39 | + color:red; |
| 40 | + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); |
| 41 | + } |
| 42 | + |
| 43 | + .dark-mode .test_page { |
| 44 | + background-color: #1e1e1e; |
| 45 | + background-size: 180%; |
| 46 | + color: red; |
| 47 | + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); |
| 48 | + } |
| 49 | + |
| 50 | + .dark-mode .timer { |
| 51 | + font-size: 26px; |
| 52 | + color: #ffcc00; |
| 53 | + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); |
| 54 | + } |
| 55 | + |
| 56 | + /* Add more dark mode styles as needed */ |
| 57 | + </style> |
12 | 58 | <body>
|
13 | 59 |
|
14 | 60 |
|
15 | 61 | <div class="result_page">
|
16 | 62 | <div class="front_results_page">
|
17 | 63 | <header>
|
18 | 64 | <h1>Result 🧐</h1>
|
| 65 | + |
| 66 | + |
19 | 67 | </header>
|
20 | 68 | <div class="results_text_div">
|
21 | 69 |
|
@@ -87,8 +135,10 @@ <h1>Result 🧐</h1>
|
87 | 135 | <header>
|
88 | 136 | <h1 class="test_title"></h1>
|
89 | 137 | <h2 class="question_details">Question: <span class="q_number"></span>/<span class="total_qs"></span> </h2>
|
90 |
| - </header> |
91 |
| - |
| 138 | + |
| 139 | + <div class="timer">Time Left: <span id="time">00:00</span></div> |
| 140 | + <button id="dark-mode-toggle">Toggle Dark Mode</button> |
| 141 | + </header> |
92 | 142 | <div class="question_container">
|
93 | 143 | <button class="prev_question_btn">‹</button>
|
94 | 144 | <div class="question_div">
|
@@ -197,7 +247,35 @@ <h1>Fill them!</h1>
|
197 | 247 | <audio src="../assets/audio/final_question.mp3" class="final_question">
|
198 | 248 | <audio src="../assets/audio/click.mp3" class="click_sound">
|
199 | 249 | <audio src="../assets/audio/test_page_bg_music.mp3" class="test_page_bg_music">
|
200 |
| - |
| 250 | + <script> |
| 251 | + document.getElementById('dark-mode-toggle').addEventListener('click', function() { |
| 252 | + document.body.classList.toggle('dark-mode'); |
| 253 | + }); |
| 254 | + function startTimer(duration, display) { |
| 255 | + let timer = duration, minutes, seconds; |
| 256 | + setInterval(function () { |
| 257 | + minutes = parseInt(timer / 60, 10); |
| 258 | + seconds = parseInt(timer % 60, 10); |
| 259 | + |
| 260 | + minutes = minutes < 10 ? "0" + minutes : minutes; |
| 261 | + seconds = seconds < 10 ? "0" + seconds : seconds; |
| 262 | + |
| 263 | + display.textContent = minutes + ":" + seconds; |
| 264 | + |
| 265 | + if (--timer < 0) { |
| 266 | + timer = 0; |
| 267 | + alert("Time's up!"); |
| 268 | + // You can add any additional actions here, like submitting the test automatically |
| 269 | + } |
| 270 | + }, 1000); |
| 271 | + } |
| 272 | + |
| 273 | + window.onload = function () { |
| 274 | + const timeLimit = 60 * 10; // 10 minutes |
| 275 | + const display = document.querySelector('#time'); |
| 276 | + startTimer(timeLimit, display); |
| 277 | + }; |
| 278 | + </script> |
201 | 279 | </body>
|
202 | 280 | <script src="../js/main.js"></script>
|
203 | 281 | <script src="../js/basic.js"></script>
|
|
0 commit comments