some fuckery to get dev branch working

This commit is contained in:
sky
2025-06-22 11:53:54 -04:00
parent c34e53111c
commit 5d0a1b87df
95 changed files with 3 additions and 1655 deletions

0
js/all.js Normal file → Executable file
View File

0
js/all.min.js vendored Normal file → Executable file
View File

0
js/analytics.js Normal file → Executable file
View File

0
js/apps.js Normal file → Executable file
View File

0
js/asteroids.js Normal file → Executable file
View File

0
js/bootstrap.css vendored Normal file → Executable file
View File

0
js/bootstrap.min.css vendored Normal file → Executable file
View File

0
js/cloaks.js Normal file → Executable file
View File

0
js/cookie.js Normal file → Executable file
View File

0
js/cookieConsent.css Normal file → Executable file
View File

0
js/cookieConsent.js Normal file → Executable file
View File

0
js/debug.js Normal file → Executable file
View File

0
js/dogeminersave.txt Normal file → Executable file
View File

204
js/games.js Normal file → Executable file
View File

@ -1,204 +1,3 @@
<<<<<<< HEAD
$.getJSON("/data/games.json", function (data) {
if (document.readyState === "complete") {
loadGames(data);
} else {
let areGamesReady = setInterval(() => {
if (document.readyState === "complete") {
loadGames(data);
clearInterval(areGamesReady);
}
}, 50);
}
});
function loadGames(data) {
starredgames = getCookie("starred");
if (!starredgames) {
starredgames = [];
} else {
starredgames = JSON.parse(decodeURIComponent(getCookie("starred")));
}
$("#gamesearch").prop({
placeholder: "Click here to search through our " + data.length + " games!",
});
data.sort(dynamicSort("name"));
gamelist = data;
for (let i = 0; i < data.length; i++) {
let $element = $("<a>")
.attr({
class: "game",
id: data[i].directory,
recommended: data[i].recommended,
// href: "loader.html#" + btoa(encodeURIComponent(JSON.stringify([data[i].directory, data[i].image, data[i].name]))),
href: "semag/" + data[i].directory + "/index.html",
})
.data("recommended", data[i].recommended)
.append(
$("<img>").prop({
src: "semag/" + data[i].directory + "/" + data[i].image,
alt: data[i].name + " logo",
loading: "lazy"
})
)
.append($("<h1>").text(data[i].name))
.append(
$("<img>").prop({
src: "img/star.svg",
alt: "star",
class: "star",
})
);
if (starredgames.includes(data[i].directory)) {
$element.find("img.star").attr("id", "starred");
$element.find("img.star").attr("src", "img/star-fill.svg");
let $pinnedelement = $element.clone();
$("#pinned").append($pinnedelement);
if ($("#pinnedmessage")) {
$("#pinnedmessage").hide();
}
}
$("#games").append($element);
}
$("#games #message").remove();
if ((search = 1)) {
var txt = $("#gamesearch").val();
if (txt == "") {
$("#games .suggest").show();
} else {
$("#games .suggest").hide();
}
$("#games .game").hide();
$("#games .game").each(function () {
if ($(this).text().toUpperCase().indexOf(txt.toUpperCase()) != -1 || $(this).attr("id").toUpperCase().indexOf(txt.toUpperCase()) != -1) {
$(this).show();
}
});
}
// starred games
let starred;
$(document).on("click", "img.star", function (event) {
});
$(document).on("click", ".game", function (event) {
if ($(event.target).is("img.star")) {
event.preventDefault();
event.stopPropagation();
if (!$(event.target).attr("id")) {
$(event.target).prop({ id: "starred" });
$(event.target).prop({ src: "img/star-fill.svg" });
starred = Cookies.get("starred");
if (starred) {
starred = JSON.parse(starred);
} else {
starred = [];
}
starred.push($(this).attr("id"));
Cookies.set("starred", JSON.stringify(starred));
$element = $(this).clone();
$("#pinned").append($element);
$("#pinnedmessage").hide();
temp = $("#pinned")[0].childNodes;
pinnedarray = [...temp];
pinnedarray.sort(dynamicSort("id"));
$("#pinned").empty();
for (let i = 0; i < pinnedarray.length; i++) {
pinnedarraynodes = pinnedarray[i].childNodes;
pinnedarraynodes = [...pinnedarraynodes];
let $element = $("<div>")
.prop({
class: "game",
id: pinnedarray[i].id,
})
.append(
$("<img>").prop({
src: pinnedarraynodes[0].src,
alt: pinnedarraynodes[0].alt,
class: "gameicon",
})
)
.append($("<h1>").text(pinnedarraynodes[1].innerHTML))
.append(
$("<img>").prop({
src: "img/star-fill.svg",
alt: "star",
class: "star",
id: "starred",
})
);
$("#pinned").append($element);
}
} else {
$(event.target).removeAttr("id");
$(event.target).attr("src", "img/star.svg");
$thisdiv = "#" + $(this).attr("id");
$thisdiv = $thisdiv.replace(".", "\\.");
starred = Cookies.get("starred");
starred = JSON.parse(starred);
ourindex = starred.indexOf($(this).attr("id"));
starred.splice(ourindex, 1);
Cookies.set("starred", JSON.stringify(starred));
$("#pinned " + $thisdiv).remove();
if ($("#pinned").is(":empty")) {
$("#pinnedmessage").show();
}
$($thisdiv + " #starred").attr("src", "img/star.svg");
$($thisdiv + " #starred").removeAttr("id");
}
}
});
$(document).on("click", "#game img .star", function (event) {
event.stopPropagation();
$(this).prop({ class: "material-symbols-outlined fill" });
});
}
function redirectGame(dir) {
window.location.href = window.location.origin + "/semag/" + dir + "/index.html";
}
function dynamicSort(property) {
var sortOrder = 1;
if (property[0] === "-") {
sortOrder = -1;
property = property.substr(1);
}
return function (a, b) {
if (sortOrder == -1) {
return b[property].localeCompare(a[property]);
} else {
return a[property].localeCompare(b[property]);
}
};
}
function selectRandomGame() {
redirectGame(gamelist[Math.floor(Math.random() * gamelist.length - 1)].directory);
}
let viewrecommended = 0;
function recommendedGames() {
if (viewrecommended == 0) {
$("#games .game").hide();
$("#games .game").each(function () {
if ($(this).attr("recommended")) {
$(this).show();
}
});
$("#recommend").text("Click to view all games again!");
viewrecommended = 1;
} else {
$("#games .game").hide();
$("#games .game").show();
viewrecommended = 0;
$("#recommend").text("Click to view recommended games!");
}
}
=======
document.addEventListener("DOMContentLoaded", loadGames);
let elements = [];
async function loadGames() {
@ -251,5 +50,4 @@ document.addEventListener("DOMContentLoaded", ()=>{
}
document.getElementById("noResults").style.display = total >= elements.length ? "flex" : "none"
})
})
>>>>>>> c2041b6 (first dev commit)
})

0
js/katamari.js Normal file → Executable file
View File

169
js/main.js Normal file → Executable file
View File

@ -1,169 +1,3 @@
<<<<<<< HEAD
var interval;
document.addEventListener("DOMContentLoaded", function () {
if (localStorage.getItem("theme")) {
localStorage.setItem("selenite.theme", localStorage.getItem("theme"));
localStorage.removeItem("theme");
}
if (localStorage.getItem("selenite.theme")) {
document.body.setAttribute("theme", localStorage.getItem("selenite.theme"));
} else {
document.body.setAttribute("theme", "main");
}
if (document.querySelectorAll("[id=adcontainer]")) {
for (let i = 0; i < document.querySelectorAll("[id=adcontainer]").length; i++) {
if (Math.random() < 0.5 || localStorage.getItem("selenite.adblock") == "true") document.querySelectorAll("[id=adcontainer]")[i].innerHTML = "";
}
}
const iconSetting = document.querySelector("input#discordIcon");
const blockClose = document.querySelector("input#blockClose");
const openBlank = document.getElementById("blank");
const bgTheme = document.querySelector("input#bgTheme");
// if (document.querySelector("widgetbot-crate")) {
// if (localStorage.getItem("selenite.discordIcon") == "true") {
// const widget = document.querySelector("widgetbot-crate");
// widget.setAttribute("style", "display:none");
// }
// }
if (document.querySelector("input#discordIcon")) {
if (localStorage.getItem("selenite.discordIcon") == "true") {
iconSetting.checked = true;
}
iconSetting.addEventListener("click", () => {
localStorage.setItem("selenite.discordIcon", iconSetting.checked);
});
}
if (document.querySelector("input#blockClose")) {
if (localStorage.getItem("selenite.blockClose") == "true") {
blockClose.checked = true;
}
blockClose.addEventListener("click", () => {
localStorage.setItem("selenite.blockClose", blockClose.checked);
});
}
if (document.querySelector("input#tabDisguise")) {
if (localStorage.getItem("selenite.tabDisguise") == "true") {
tabDisguise.checked = true;
}
tabDisguise.addEventListener("click", () => {
localStorage.setItem("selenite.tabDisguise", tabDisguise.checked);
});
}
if (document.querySelector("input#bgTheme")) {
bgTheme.checked = true;
}
document.getElementById("blank").addEventListener("click", () => {
win = window.open();
win.document.body.style.margin = "0";
win.document.body.style.height = "100vh";
html = `
<style>*{margin:0;padding:0;border:none}body,iframe{height:100vh;width:100vw}iframe{height:96vh}header{display:flex;height:4vh;justify-content:center;}button{margin-right:100px;height:100%;aspect-ratio: 1 / 1}#reload{background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z'/%3E%3C/svg%3E");background-size:cover;}#goBack{background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z'/%3E%3C/svg%3E");background-size:cover;}</style><script>
</script><header><button id=goBack></button><button id=reload></button></header><iframe id=selenite></iframe>`;
win.document.querySelector("html").innerHTML = html;
win.eval(`let selenite = document.getElementById("selenite");console.log(selenite);selenite.setAttribute("src", "${location.origin}");console.log(selenite);document.getElementById("goBack").addEventListener("click", function () {selenite.contentDocument.location.href = selenite.contentDocument.location.origin;});document.getElementById("reload").addEventListener("click", function () {selenite.contentDocument.location.href = selenite.contentDocument.location.href;})`);
location.href = "https://google.com";
close();
});
if ($("#panicmode").length > 0) {
$("#panicmode").prop({ href: panicurl });
}
if ($(".seleniteminified").length > 0) {
$.get("https://raw.githubusercontent.com/skysthelimitt/selenite-optimized/main/build/bookmark.txt", function (data) {
$(".seleniteminified").prop({ href: data });
});
$.get("https://raw.githubusercontent.com/car-axle-client/car-axle-client/v10/dist/build.js", function (data) {
$(".caraxle").prop({ href: `javascript:${encodeURI(data)}` });
});
}
});
function setPanicMode() {
if (!$("#panic").val().startsWith("https")) {
document.cookie = "panicurl=https://" + $("#panic").val();
return;
}
document.cookie = "panicurl=" + $("#panic").val();
}
function copyToClipboard(text) {
navigator.clipboard.writeText(text);
alert("Copied text!");
}
function setTheme(theme) {
localStorage.setItem("selenite.theme", theme);
document.body.setAttribute("theme", theme);
if (theme != "custom") {
document.getElementById("customMenu").style.display = "none";
document.body.style = "";
}
}
function setPanicMode() {
if (!$("#panic").val().startsWith("https")) {
document.cookie = "panicurl=https://" + $("#panic").val();
return;
}
document.cookie = "panicurl=" + $("#panic").val();
}
function setPassword() {
localStorage.setItem("selenite.password", enc.encode(document.getElementById("pass").value));
}
function delPassword() {
location.hash = "";
localStorage.removeItem("selenite.passwordAtt");
localStorage.removeItem("selenite.password");
}
$(document).ready(function () {
if (!window.location.href.startsWith("about:")) {
$("#webicon").attr("placeholder", window.location.href.replace(/\/[^\/]*$/, "/"));
}
});
function loadScript(a, b) {
var c = document.createElement("script");
(c.type = "text/javascript"), (c.src = a), (c.onload = b), document.head.appendChild(c);
}
function toast(message, onclick) {
const toast = document.createElement("div");
toast.setAttribute("id", "toast");
console.log(message.time);
toast.innerHTML = `<div class=samerow><h1>${message.title}${message.time ? ` - ${timeAgo(new Date(message.time * 1000))}` : ""}</h1></div><p>${message.message}</p>`;
toast.style.animation = "toastFade 6s";
document.body.appendChild(toast);
if (onclick) {
toast.addEventListener("click", onclick);
toast.style.cursor = "pointer";
}
setTimeout(() => {
toast.remove();
}, 6000);
}
function timeAgo(input) {
const date = input instanceof Date ? input : new Date(input);
const formatter = new Intl.RelativeTimeFormat("en");
const ranges = {
years: 3600 * 24 * 365,
months: 3600 * 24 * 30,
weeks: 3600 * 24 * 7,
days: 3600 * 24,
hours: 3600,
minutes: 60,
seconds: 1,
};
const secondsElapsed = (date.getTime() - Date.now()) / 1000;
for (let key in ranges) {
if (ranges[key] < Math.abs(secondsElapsed)) {
const delta = secondsElapsed / ranges[key];
return formatter.format(Math.round(delta), key);
}
}
}
let cookieConsentScript = document.createElement("script");
cookieConsentScript.src = "/js/cookieConsent.js";
document.head.appendChild(cookieConsentScript);
let cookieConsentStyle = document.createElement("link");
cookieConsentStyle.href = "/js/cookieConsent.css";
cookieConsentStyle.rel = "stylesheet";
document.head.appendChild(cookieConsentStyle);
=======
function setBackground() {
let randomNumbers = [100-Math.abs(Math.floor(Math.random() * 200) - 99), 100-Math.abs(Math.floor(Math.random() * 200) - 99)];
document.body.style.setProperty("--gradient-x", randomNumbers[0] + "%");
@ -375,5 +209,4 @@ document.addEventListener("scroll", ()=>{
// let cookieConsentStyle = document.createElement("link");
// cookieConsentStyle.href = "/js/cookieConsent.css";
// cookieConsentStyle.rel = "stylesheet";
// document.head.appendChild(cookieConsentStyle);
>>>>>>> c2041b6 (first dev commit)
// document.head.appendChild(cookieConsentStyle);

0
js/oldstuff.js Normal file → Executable file
View File

0
js/savedownload.js Normal file → Executable file
View File

0
js/search.js Normal file → Executable file
View File

0
js/themes.js Normal file → Executable file
View File

0
js/ultimatetabcloak.js Normal file → Executable file
View File

0
js/uploaddownload.js Normal file → Executable file
View File

0
js/widget.js Normal file → Executable file
View File