Skip to content

Commit

Permalink
Prettified Code!
Browse files Browse the repository at this point in the history
  • Loading branch information
RedNotSus authored and actions-user committed Jan 11, 2025
1 parent 1b3289a commit 2b0c77d
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions static/assets/js/packs.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
window.addEventListener("load", (event) => {
const gameContainer = document.getElementById("game-container");
fetch("/assets/json/load/packs.json")
.then((response) => response.json())
.then((apps) => {
apps.sort((a, b) => a.name.localeCompare(b.name));
apps.forEach(function (game) {
let gameHtml;
gameHtml = `<div class="game">
const gameContainer = document.getElementById("game-container");
fetch("/assets/json/load/packs.json")
.then((response) => response.json())
.then((apps) => {
apps.sort((a, b) => a.name.localeCompare(b.name));
apps.forEach(function (game) {
let gameHtml;
gameHtml = `<div class="game">
<a onclick="${
game.alert ? `alert('${game.alert}'); ` : ""
}window.location.href='${game.url}';">
<img loading="eager" src="${game.image}">
<p class="text">${game.name}</p>
</a>
</div>`;
gameContainer.insertAdjacentHTML("beforeend", gameHtml);
});

let searchbar = document.getElementById("searchbar");
if (searchbar)
searchbar.placeholder = `Click here to search through our ${apps.length} packs!`;
gameContainer.insertAdjacentHTML("beforeend", gameHtml);
});
});

let searchbar = document.getElementById("searchbar");
if (searchbar)
searchbar.placeholder = `Click here to search through our ${apps.length} packs!`;
});
});

0 comments on commit 2b0c77d

Please sign in to comment.