diff --git a/static/assets/js/games.js b/static/assets/js/games.js index 33648bd5..1e47e255 100644 --- a/static/assets/js/games.js +++ b/static/assets/js/games.js @@ -1,32 +1,36 @@ window.addEventListener("load", (event) => { const gameContainer = document.getElementById("game-container"); const text = document.getElementById("text"); + let loadedImages = 0; // Initialize a counter for loaded images + try { fetch("/assets/json/load/games.json") .then((response) => response.json()) .then((games) => { games.sort((a, b) => a.name.localeCompare(b.name)); - games.forEach(function (game, gameNum) { - text.innerText = `Loading games (${gameNum + 1}/${games.length})`; + const totalImages = games.length; // Get total number of images + games.forEach(function (game, gameNum) { let gameHtml; if (game.usesProxy) { gameHtml = `
`; + +${game.name}
+${game.name}
-${game.name}
+