From 0605271327f2974bf806776ea3850c83e99e7577 Mon Sep 17 00:00:00 2001 From: sky Date: Thu, 11 Jun 2026 23:04:06 -0400 Subject: [PATCH] oh wow i was meant to push this a long time ago --- css/pages.css | 8 ++--- css/settings.css | 26 ++++++++++++-- index.html | 8 ++--- js/loader.js | 23 ++++++++++++- profile.html | 58 ------------------------------- projects_opt.html | 43 ----------------------- settings.html | 88 ++++++++++++++++++++++++++++++++++++++++++++++- 7 files changed, 141 insertions(+), 113 deletions(-) delete mode 100755 profile.html delete mode 100755 projects_opt.html diff --git a/css/pages.css b/css/pages.css index 62b2cdb..6c6c2d7 100755 --- a/css/pages.css +++ b/css/pages.css @@ -42,7 +42,7 @@ body { overflow-y: hidden; top: 0; } -input[type=text], input[type=password] { +input { width: 70%; border-style: solid; border-width: 2px; @@ -58,13 +58,13 @@ input[type=text], input[type=password] { font-size: 20px; text-shadow: var(--color-1) 0 0 10px; } -input[type=text]:focus, input[type=password]:focus { +input:focus { filter:brightness(1.25) !important; } -input[type=text]:hover, input[type=password]:hover { +input:hover { filter:brightness(1.1); } -input[type=text]::placeholder, input[type=password]::placeholder { +input::placeholder { color: color-mix(in srgb, var(--text-color) 20%, #00000000 80%); text-shadow: color-mix(in srgb, var(--text-color) 40%, #00000000 60%) 0 0 10px; } diff --git a/css/settings.css b/css/settings.css index a24ae80..b07f995 100644 --- a/css/settings.css +++ b/css/settings.css @@ -1,6 +1,6 @@ section { min-width: 20%; - height: 400px; + height: 420px; padding: 8px; margin: 16px; background-color: color-mix(in srgb, var(--color-2) 40%, #00000000 60%); @@ -27,6 +27,28 @@ sections { margin: 6px; } +#hiddenGamesList { + width: min(280px, 90%); + height: 200px; + overflow-y: auto; + border: 1px solid color-mix(in srgb, var(--color-1) 50%, #00000000 50%); + border-radius: 12px; + padding: 8px; + margin: 8px 0; +} + +.hidden-game-row { + display: flex; + align-items: center; + gap: 8px; + margin: 4px 0; + width: 100%; +} + +#hiddenGamesSearch { + width: min(280px, 90%); +} + @-moz-document url-prefix() { section { backdrop-filter: blur(0); @@ -36,4 +58,4 @@ sections { body[fast] section { background-color: color-mix(in srgb, var(--color-2) 70%, #000000 30%); backdrop-filter: blur(0); -} \ No newline at end of file +} diff --git a/index.html b/index.html index 788f125..ebfae5e 100755 --- a/index.html +++ b/index.html @@ -137,7 +137,7 @@ let index = 0; let welcome = document.querySelector("welcome"); - let blur = document.getElementById("blur"); + // let blur = document.getElementById("blur"); // TODO: finish hideAll(); @@ -147,11 +147,11 @@ function hideAll() { welcome.remove(); - blur.remove(); + // blur.remove(); } function finish() { welcome.style.opacity = "0"; - blur.style.opacity = "0"; + // blur.style.opacity = "0"; setTimeout(() => { hideAll(); document.cookie = "selenite.welcomeFinished=true"; @@ -315,7 +315,7 @@ -
+ diff --git a/js/loader.js b/js/loader.js index 3ae5125..ed6e505 100755 --- a/js/loader.js +++ b/js/loader.js @@ -7,6 +7,15 @@ let pageData; let starredGames = []; let globalPlays = null; +function getHiddenGames() { + try { + const parsed = JSON.parse(localStorage.getItem("selenite.hiddenGames") || "[]"); + return parsed; + } catch { + return []; + } +} + async function loadGames() { if (type == "g") pageData = { path: "/resources/games-tagged.json", prefix: "semag", type: "g" }; else if (type == "a") pageData = { path: "/resources/apps.json", prefix: "sppa", type: "a" }; @@ -22,10 +31,18 @@ async function loadGames() { const gamesFragment = document.createDocumentFragment(); const topFragment = document.createDocumentFragment(); + const hiddenGames = pageData.type === "g" ? getHiddenGames() : []; + const hiddenSet = new Set(hiddenGames); + starredGames = JSON.parse(localStorage.getItem("selenite.starred") || "[]"); + if (hiddenGames.length > 0) { + starredGames = starredGames.filter((game) => !hiddenSet.has(game)); + localStorage.setItem("selenite.starred", JSON.stringify(starredGames)); + } const starredSet = new Set(starredGames); data.forEach((element) => { + if (hiddenSet.has(element.directory)) return; const isStarred = starredSet.has(element.directory); const newElement = document.createElement("a"); newElement.dataset.target = element.directory; @@ -98,7 +115,11 @@ async function loadGames() { gamesElement.appendChild(gamesFragment); if (topGElement) topGElement.appendChild(topFragment); - document.getElementById("gameCount").innerText = `${data.length} games loaded!`; + const visibleGameCount = elements.length; + const hiddenCount = hiddenGames.length; + document.getElementById("gameCount").innerText = hiddenCount > 0 + ? `${visibleGameCount} games loaded (${hiddenCount} hidden)` + : `${visibleGameCount} games loaded!`; document.getElementById("loadingMsg").style.display = "none"; document.getElementById("allHeader").style.display = "block"; const topHeader = document.getElementById("topHeader"); diff --git a/profile.html b/profile.html deleted file mode 100755 index 5e76b19..0000000 --- a/profile.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - {{ name }}'s Profile | Selenite - - - - -
- -
-

{{ name }}

-

/u/{{ username }}

-
{{ badges }}
-
- -

Joined {{ join_date }}

-

Last online {{ online_time }}

-
-
-
-

About Me

-

{{ about }}

-
- - diff --git a/projects_opt.html b/projects_opt.html deleted file mode 100755 index 8fe2179..0000000 --- a/projects_opt.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - Projects | Selenite - - - - - - - - - - -

xx games loaded..

-

starred games

-
-

top games

-
-

all games

-
-

games loading..

-

nothing was found! try a new search query.

-
- - diff --git a/settings.html b/settings.html index f945e2c..5806795 100755 --- a/settings.html +++ b/settings.html @@ -131,7 +131,8 @@ } else { localStorage.setItem("selenite.disableCDN", "true") } - }) + }); + initHiddenGameSettings(); function generatePallete(color) { let theme = {}; let chromaColor = chroma(color); @@ -145,6 +146,85 @@ return theme; } }); + + function getHiddenGames() { + try { + const parsed = JSON.parse(localStorage.getItem("selenite.hiddenGames") || "[]"); + return parsed; + } catch { + return []; + } + } + + function setHiddenGames(games) { + localStorage.setItem("selenite.hiddenGames", JSON.stringify(games)); + } + + function updateHiddenGamesCount(total) { + const hiddenCount = getHiddenGames().length; + const countEl = document.getElementById("hiddenGamesCount"); + countEl.innerText = `${hiddenCount} hidden${total ? ` / ${total} total` : ""}`; + } + + function renderHiddenGameList(games, hiddenSet, filter = "") { + const list = document.getElementById("hiddenGamesList"); + list.innerHTML = ""; + + const input = filter.trim().toUpperCase(); + const shown = games.filter((game) => game.name.toUpperCase().includes(input)); + + if (shown.length === 0) { + const empty = document.createElement("p"); + empty.innerText = "no games matched your search"; + list.appendChild(empty); + return; + } + + shown.forEach((game) => { + const row = document.createElement("label"); + row.className = "hidden-game-row"; + + const checkbox = document.createElement("input"); + checkbox.type = "checkbox"; + checkbox.checked = hiddenSet.has(game.directory); + checkbox.addEventListener("change", () => { + const next = new Set(getHiddenGames()); + if (checkbox.checked) next.add(game.directory); + else next.delete(game.directory); + const hidden = [...next].sort(); + setHiddenGames(hidden); + updateHiddenGamesCount(games.length); + }); + + const text = document.createElement("span"); + text.innerText = game.name; + + row.appendChild(checkbox); + row.appendChild(text); + list.appendChild(row); + }); + } + + async function initHiddenGameSettings() { + const searchInput = document.getElementById("hiddenGamesSearch"); + let games = []; + try { + games = await (await fetch("/resources/games-tagged.json")).json(); + } catch { + document.getElementById("hiddenGamesList").innerHTML = "

failed to load games list

"; + return; + } + + games.sort((a, b) => a.name.localeCompare(b.name)); + + renderHiddenGameList(games, new Set(getHiddenGames())); + updateHiddenGamesCount(games.length); + + searchInput.addEventListener("input", () => { + renderHiddenGameList(games, new Set(getHiddenGames()), searchInput.value); + }); + } + function wipeData() { if(prompt("Wiping your data means you will lose all progress in every game, and every setting you have selected.\nAre you sure you would like to continue?\n\nType \"please wipe my data\" to continue.") == "please wipe my data") { localStorage.clear(); @@ -254,6 +334,12 @@ +
+

hidden games

+

0 hidden

+ +
+