Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +22 -3
templates/index.html
CHANGED
@@ -272,14 +272,14 @@
|
|
272 |
statusMessage.style.display = 'block';
|
273 |
setTimeout(() => {
|
274 |
statusText.textContent = 'Submitted Successfully!';
|
275 |
-
//
|
276 |
setTimeout(() => {
|
277 |
-
location.reload();
|
278 |
}, 10000); // 10 seconds delay
|
279 |
}, 6000);
|
280 |
}
|
281 |
|
282 |
-
// Add the "Refresh me" button
|
283 |
let refreshButton = document.createElement("button");
|
284 |
refreshButton.classList.add("refresh-button");
|
285 |
refreshButton.textContent = "Refresh Me";
|
@@ -309,6 +309,25 @@
|
|
309 |
});
|
310 |
}
|
311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
window.onload = function () {
|
313 |
askLoginOrRegister();
|
314 |
};
|
|
|
272 |
statusMessage.style.display = 'block';
|
273 |
setTimeout(() => {
|
274 |
statusText.textContent = 'Submitted Successfully!';
|
275 |
+
// Auto refresh after 10 seconds
|
276 |
setTimeout(() => {
|
277 |
+
location.reload();
|
278 |
}, 10000); // 10 seconds delay
|
279 |
}, 6000);
|
280 |
}
|
281 |
|
282 |
+
// Add the "Refresh me" button
|
283 |
let refreshButton = document.createElement("button");
|
284 |
refreshButton.classList.add("refresh-button");
|
285 |
refreshButton.textContent = "Refresh Me";
|
|
|
309 |
});
|
310 |
}
|
311 |
|
312 |
+
// Listen for "Refresh me" command
|
313 |
+
function listenForRefreshCommand() {
|
314 |
+
speak("Say 'refresh me' to refresh the page.", function () {
|
315 |
+
recognition.start();
|
316 |
+
recognition.onresult = function (event) {
|
317 |
+
let command = event.results[0][0].transcript.trim().toLowerCase();
|
318 |
+
recognition.stop();
|
319 |
+
if (command.includes("refresh me")) {
|
320 |
+
location.reload(); // Refresh the page when "refresh me" is said
|
321 |
+
} else {
|
322 |
+
listenForRefreshCommand();
|
323 |
+
}
|
324 |
+
};
|
325 |
+
});
|
326 |
+
}
|
327 |
+
|
328 |
+
// Start listening for "Refresh me"
|
329 |
+
listenForRefreshCommand();
|
330 |
+
|
331 |
window.onload = function () {
|
332 |
askLoginOrRegister();
|
333 |
};
|