minor fixes

This commit is contained in:
sky
2025-08-23 22:39:31 -04:00
parent f99c78c0a8
commit e42a5a524c
9 changed files with 20 additions and 9 deletions

View File

@ -34,6 +34,7 @@
</head> </head>
<body> <body>
<input type="text" class="searchbar" id="gamesearch" placeholder="Type here to search.." /> <input type="text" class="searchbar" id="gamesearch" placeholder="Type here to search.." />
<p id="gameCount">xx games loaded..</p>
<p id="starredHeader">starred apps</p> <p id="starredHeader">starred apps</p>
<div id="starredgames"> <div id="starredgames">
</div> </div>

View File

@ -22,6 +22,7 @@ body {
margin: 0; margin: 0;
border: none; border: none;
font-family: "Mulish", serif; font-family: "Mulish", serif;
transition-duration: 0.5s;
} }
body { body {
animation: 1s ease-out loadIn; animation: 1s ease-out loadIn;

View File

@ -40,7 +40,7 @@
<script> <script>
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
setBackground(); setBackground();
fetch("/data/quotes.json") fetch("/quotes.json")
.then((response) => response.json()) .then((response) => response.json())
.then((data) => { .then((data) => {
const randomQuote = data[Math.floor(Math.random() * data.length)]; const randomQuote = data[Math.floor(Math.random() * data.length)];

View File

@ -48,6 +48,7 @@ async function loadGames() {
starEvent(e); starEvent(e);
}); });
}); });
document.getElementById("gameCount").innerText = `${data.length} apps loaded!`;
document.getElementById("loadingMsg").style.display = "none"; document.getElementById("loadingMsg").style.display = "none";
document.getElementById("allHeader").style.display = "block"; document.getElementById("allHeader").style.display = "block";
starredGames = JSON.parse(localStorage.getItem("selenite.starred") || '[]'); starredGames = JSON.parse(localStorage.getItem("selenite.starred") || '[]');
@ -58,7 +59,7 @@ async function loadGames() {
let newElement = element.cloneNode(true); let newElement = element.cloneNode(true);
document.getElementById("starredgames").appendChild(newElement); document.getElementById("starredgames").appendChild(newElement);
newElement.addEventListener("click", ()=>{ newElement.addEventListener("click", ()=>{
location.href=`/loader.html?title=${newElement.childNodes[1].childNodes[0].innerText}&dir=${newElement.getAttribute("data-target")}&img=${newElement.getAttribute("data-image")}` location.href=`/loader.html?title=${newElement.childNodes[1].childNodes[0].innerText}&dir=${newElement.getAttribute("data-target")}&img=${newElement.getAttribute("data-image")}&type=a`
}); });
}); });
document.querySelectorAll("#starredgames #star").forEach((e) => { document.querySelectorAll("#starredgames #star").forEach((e) => {

View File

@ -40,7 +40,7 @@ async function loadGames() {
gamesElement.appendChild(newElement); gamesElement.appendChild(newElement);
elements.push(newElement); elements.push(newElement);
newElement.addEventListener("click", ()=>{ newElement.addEventListener("click", ()=>{
location.href=`/loader.html?title=${encodeURIComponent(element.name)}&dir=${element.directory}&img=${element.image}` location.href=`/loader.html?title=${encodeURIComponent(element.name)}&dir=${element.directory}&img=${element.image}&type=g`
}); });
star.addEventListener("click", (e) => { star.addEventListener("click", (e) => {
e.preventDefault(); e.preventDefault();
@ -48,6 +48,7 @@ async function loadGames() {
starEvent(e); starEvent(e);
}); });
}); });
document.getElementById("gameCount").innerText = `${data.length} games loaded!`;
document.getElementById("loadingMsg").style.display = "none"; document.getElementById("loadingMsg").style.display = "none";
document.getElementById("allHeader").style.display = "block"; document.getElementById("allHeader").style.display = "block";
starredGames = JSON.parse(localStorage.getItem("selenite.starred") || '[]'); starredGames = JSON.parse(localStorage.getItem("selenite.starred") || '[]');
@ -58,7 +59,7 @@ async function loadGames() {
let newElement = element.cloneNode(true); let newElement = element.cloneNode(true);
document.getElementById("starredgames").appendChild(newElement); document.getElementById("starredgames").appendChild(newElement);
newElement.addEventListener("click", ()=>{ newElement.addEventListener("click", ()=>{
location.href=`/loader.html?title=${newElement.childNodes[1].childNodes[0].innerText}&dir=${newElement.getAttribute("data-target")}&img=${newElement.getAttribute("data-image")}` location.href=`/loader.html?title=${newElement.childNodes[1].childNodes[0].innerText}&dir=${newElement.getAttribute("data-target")}&img=${newElement.getAttribute("data-image")}&type=g`
}); });
}); });
document.querySelectorAll("#starredgames #star").forEach((e) => { document.querySelectorAll("#starredgames #star").forEach((e) => {

View File

@ -23,7 +23,8 @@ function cursor() {
cursor.style.backgroundColor = "var(--color-1)"; cursor.style.backgroundColor = "var(--color-1)";
cursor.style.position = "absolute"; cursor.style.position = "absolute";
cursor.style.borderRadius = "100%"; cursor.style.borderRadius = "100%";
cursor.style.filter = "blur(60px)"; cursor.style.filter = "blur(50px)";
cursor.style.transitionDuration = "0s";
cursor.style.opacity = "1"; cursor.style.opacity = "1";
cursor.style.pointerEvents = "none"; cursor.style.pointerEvents = "none";
document.body.appendChild(cursor); document.body.appendChild(cursor);

View File

@ -21,14 +21,19 @@
location.search.substr(1).split("&").forEach((e)=>{ location.search.substr(1).split("&").forEach((e)=>{
items[e.split("=")[0]] = e.split("=")[1] items[e.split("=")[0]] = e.split("=")[1]
}); });
document.getElementById("gameFrame").setAttribute("src", `/resources/semag/${items.dir}/index.html`); if(items.type == "g") {
document.getElementById("gameImage").setAttribute("src", `/resources/semag/${items.dir}/${items.img}`); items.type = "semag";
} else {
items.type = "sppa";
}
document.getElementById("gameFrame").setAttribute("src", `/resources/${items.type}/${items.dir}/index.html`);
document.getElementById("gameImage").setAttribute("src", `/resources/${items.type}/${items.dir}/${items.img}`);
document.getElementById("gameName").innerText = decodeURIComponent(items.title); document.getElementById("gameName").innerText = decodeURIComponent(items.title);
console.log(items); console.log(items);
} else if(localStorage.getItem("selenite.lastGame")) { } else if(localStorage.getItem("selenite.lastGame")) {
let game = JSON.parse(decodeURIComponent(atob(localStorage.getItem("selenite.lastGame")))); let game = JSON.parse(decodeURIComponent(atob(localStorage.getItem("selenite.lastGame"))));
document.getElementById("gameFrame").setAttribute("src", `/resources/semag/${game[0]}/index.html`); document.getElementById("gameFrame").setAttribute("src", `/resources/${items.type}/${game[0]}/index.html`);
document.getElementById("gameImage").setAttribute("src", `/resources/semag/${game[0]}/${decodeURIComponent(game[1])}`); document.getElementById("gameImage").setAttribute("src", `/resources/${items.type}/${game[0]}/${decodeURIComponent(game[1])}`);
document.getElementById("gameName").innerText = game[2]; document.getElementById("gameName").innerText = game[2];
} }
document.getElementById("fullscreen").addEventListener("click", () => { document.getElementById("fullscreen").addEventListener("click", () => {

View File

@ -34,6 +34,7 @@
</head> </head>
<body> <body>
<input type="text" class="searchbar" id="gamesearch" placeholder="Type here to search.." /> <input type="text" class="searchbar" id="gamesearch" placeholder="Type here to search.." />
<p id="gameCount">xx games loaded..</p>
<p id="starredHeader">starred games</p> <p id="starredHeader">starred games</p>
<div id="starredgames"> <div id="starredgames">
</div> </div>

0
quotes.json Normal file
View File