random game button

This commit is contained in:
BluePotato102
2023-11-18 08:23:34 -06:00
parent d30ae4689c
commit f602dbf6b7
3 changed files with 24 additions and 2 deletions
+9
View File
@@ -496,6 +496,15 @@ function restoreColorChanges() {
alert("Defaults Restored! Changes will take place upon reload");
}
function randomGame() {
const gameLinks = document.querySelectorAll('#gamesList li');
const randomIndex = Math.floor(Math.random() * gameLinks.length);
const randomGameLink = gameLinks[randomIndex];
window.location.href = randomGameLink.getAttribute('url');
;
}
const preferencesDefaults = {
cloak: true,
cloakUrl: "https://classroom.google.com",