Skip to content

Commit

Permalink
Update!
Browse files Browse the repository at this point in the history
  • Loading branch information
Mac-Web committed Dec 14, 2024
1 parent 1a33b2c commit 82b6a50
Show file tree
Hide file tree
Showing 6 changed files with 870 additions and 379 deletions.
36 changes: 36 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ function sortStuff(targetArray, key) {
finalGames.push(item.name);
});
arrangeBoxes(finalGames, finalArrayIds);
} else if (key === "direction") {
let gameList = document.getElementById("list").querySelectorAll(".game");
gameList = [...gameList].reverse();
let finalArrayIds = [];
let finalGames = [];
gameList.forEach((item) => {
finalArrayIds.push(item.getAttribute("id").slice(4));
finalGames.push(item.innerHTML);
});
arrangeBoxes(finalGames, finalArrayIds);
}
}

Expand Down Expand Up @@ -233,6 +243,17 @@ function filterStuff(colorArray, color) {
});
secondArray = finalArray;
arrangeBoxes(finalArray, finalArrayIds);
} else if (color === "download") {
let finalArray = [];
let finalArrayIds = [];
colorArray.forEach((item) => {
if (item.download) {
finalArray.push(item.name);
finalArrayIds.push(item.id);
}
});
secondArray = finalArray;
arrangeBoxes(finalArray, finalArrayIds);
} else {
let finalArrayIds = [];
let finalArrayNames = [];
Expand Down Expand Up @@ -394,6 +415,21 @@ function gotIt() {
}

function search() {
let searchInput = document.getElementById("searchInput");
const searchClear = document.getElementById("search-clear");
if (searchInput.value.trim() !== "") {
searchClear.style.display = "flex";
searchClear.addEventListener("click", () => {
searchInput.value = "";
searchClear.style.display = "none";
var list = document.getElementById("list");
var items = list.getElementsByTagName("a");
for (var i = 0; i < items.length; i++) {
items[i].style.display = "flex";
}
searchInput.focus();
});
}
var searchTerm = document.getElementById("searchInput").value.toLowerCase();
var list = document.getElementById("list");
var items = list.getElementsByTagName("a");
Expand Down
Loading

0 comments on commit 82b6a50

Please sign in to comment.