a few fixes, new game
1
bit-planes/05b55dd4ac5dfd6b612d7a81923abb23.svg
Normal file
After Width: | Height: | Size: 12 KiB |
1
bit-planes/083bfcfa18e5c5ca335fcdb525011740.svg
Normal file
After Width: | Height: | Size: 16 KiB |
1
bit-planes/0f81679330324b675c4c8d0e7f204f43.svg
Normal file
After Width: | Height: | Size: 22 KiB |
1
bit-planes/187385325a0ecd47149469b48e71e390.svg
Normal file
After Width: | Height: | Size: 13 KiB |
1
bit-planes/27ca16619680d41cd7fc9b521ba99b69.svg
Normal file
After Width: | Height: | Size: 54 KiB |
1
bit-planes/375aed5f67144a7cc4573d4bdb45d415.svg
Normal file
After Width: | Height: | Size: 18 KiB |
1
bit-planes/7615745eed53fe195a20523ea5415db7.svg
Normal file
After Width: | Height: | Size: 50 KiB |
1
bit-planes/7ce62f3b427d2e9c35234618ffa957d1.svg
Normal file
After Width: | Height: | Size: 24 KiB |
1
bit-planes/88afda9805de2898ba809d7a95dad66b.svg
Normal file
After Width: | Height: | Size: 10 KiB |
1
bit-planes/8a2f9fe2f680d7212a3c8ccdaa1b1be9.svg
Normal file
After Width: | Height: | Size: 16 KiB |
1
bit-planes/9fa96a6d5530f0b96c521a1facc01934.svg
Normal file
After Width: | Height: | Size: 9.2 KiB |
1
bit-planes/a2cecf1b8952d304a6b783135a7e4a2a.svg
Normal file
After Width: | Height: | Size: 11 KiB |
1
bit-planes/bc50f82af4a96914bc2268699f1c9760.svg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
bit-planes/bitplanes.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
1
bit-planes/d05bb93fed7c4efcd74b1209b20d1341.svg
Normal file
After Width: | Height: | Size: 17 KiB |
1
bit-planes/dda3b76e5f5d5ada75f7ed77a029c45d.svg
Normal file
After Width: | Height: | Size: 7.9 KiB |
1
bit-planes/e38779734ef72069a74dc27428ce036b.svg
Normal file
After Width: | Height: | Size: 13 KiB |
1
bit-planes/e6f45c5d0ad8e1b1a7a607a78897f56b.svg
Normal file
After Width: | Height: | Size: 9.8 KiB |
1
bit-planes/ea9ab4eafa32d808a21401f86824b120.svg
Normal file
After Width: | Height: | Size: 30 KiB |
1
bit-planes/ece21c104322781c96226d8acc53490f.svg
Normal file
After Width: | Height: | Size: 7.9 KiB |
112
bit-planes/index.html
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Cormorant+Garamond&display=swap" rel="stylesheet">
|
||||||
|
<title>Bit Planes</title>
|
||||||
|
<link href="styles.css?d7118c4f7ffc03840b96" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<section class="welcome">
|
||||||
|
<!-- <div class="ribbon right green">-->
|
||||||
|
<!-- <a href="https://github.com/antonmedv/bit-planes" tabindex="-1">Fork me on GitHub</a>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<h1>
|
||||||
|
<i class="logo"></i>
|
||||||
|
Bit Planes
|
||||||
|
<i class="logo"></i>
|
||||||
|
</h1>
|
||||||
|
<p>
|
||||||
|
<strong>Controls:</strong><br>
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Arrows <kbd>↑</kbd><kbd>↓</kbd> — thrust level.</li>
|
||||||
|
<li>Arrows <kbd>←</kbd><kbd>→</kbd> — elevator controls.</li>
|
||||||
|
<li><kbd>Space</kbd> — fire a gun. <kbd>X</kbd> — deploy a missile.</li>
|
||||||
|
<li><kbd>C</kbd> — catapult / parachute and get new plane at the barn.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<form id="game">
|
||||||
|
<label>
|
||||||
|
<input type="text" name="nickname" placeholder="Nickname">
|
||||||
|
</label>
|
||||||
|
<p>
|
||||||
|
<strong>Game mode:</strong>
|
||||||
|
</p>
|
||||||
|
<div class="game-modes">
|
||||||
|
<div>
|
||||||
|
<label title="Everyone against everyone."><input type="radio" name="mode" value="death-match" checked autofocus> Death match</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label title="Fight between teams."><input type="radio" name="mode" value="teams"> Teams</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label title="One on one duel."><input type="radio" name="mode" value="duel"> Duel</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label title="Survive with a waives of enemies."><input type="radio" name="mode" value="survival"> Survival</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="action">
|
||||||
|
<button class="btn">‣ Start</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="stats"></div>
|
||||||
|
<canvas class="demo"></canvas>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<div class="ui">
|
||||||
|
<div class="cockpit">
|
||||||
|
<div class="missile-capacity">
|
||||||
|
<div class="missile"></div>
|
||||||
|
<div class="missile"></div>
|
||||||
|
</div>
|
||||||
|
<div class="thrust">
|
||||||
|
<div class="thrust-level"></div>
|
||||||
|
</div>
|
||||||
|
<div class="ammo-capacity">
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
<div class="ammo"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<canvas class="minimap"></canvas>
|
||||||
|
<div class="log"></div>
|
||||||
|
</div>
|
||||||
|
<canvas id="canvas"></canvas>
|
||||||
|
|
||||||
|
<!-- Yandex.Metrika counter -->
|
||||||
|
<script type="text/javascript" >
|
||||||
|
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
||||||
|
m[i].l=1*new Date();
|
||||||
|
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
||||||
|
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
||||||
|
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
||||||
|
|
||||||
|
ym(94977381, "init", {
|
||||||
|
clickmap:true,
|
||||||
|
trackLinks:true,
|
||||||
|
accurateTrackBounce:true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<noscript><div><img src="https://mc.yandex.ru/watch/94977381" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||||
|
<!-- /Yandex.Metrika counter -->
|
||||||
|
|
||||||
|
<script type="text/javascript" src="index.js?d7118c4f7ffc03840b96"></script></body>
|
||||||
|
</html>
|
1
bit-planes/index.js
Normal file
419
bit-planes/styles.css
Normal file
@ -1179,5 +1179,10 @@
|
|||||||
"name": "Minecraft Classic",
|
"name": "Minecraft Classic",
|
||||||
"directory": "mcclassic",
|
"directory": "mcclassic",
|
||||||
"image": "assets/textures/previews/2.png"
|
"image": "assets/textures/previews/2.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Bit Planes",
|
||||||
|
"directory": "bit-planes",
|
||||||
|
"image": "bitplanes.png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
17
index.html
@ -11,7 +11,22 @@
|
|||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.9.0/cdn/themes/dark.css" />
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.9.0/cdn/themes/dark.css" />
|
||||||
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.9.0/cdn/shoelace-autoloader.js"></script>
|
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.9.0/cdn/shoelace-autoloader.js"></script>
|
||||||
|
|
||||||
|
<script type="application/ld+json">
|
||||||
|
{
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "WebSite",
|
||||||
|
"url": "https://selenite.cc",
|
||||||
|
"potentialAction": {
|
||||||
|
"@type": "SearchAction",
|
||||||
|
"target": {
|
||||||
|
"@type": "EntryPoint",
|
||||||
|
"urlTemplate": "https://selenite.cc/projects.html?q={search_term_string}"
|
||||||
|
},
|
||||||
|
"query-input": "required name=search_term_string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<!-- initialize my stuff -->
|
<!-- initialize my stuff -->
|
||||||
<script src="/js/all.js"></script>
|
<script src="/js/all.js"></script>
|
||||||
|
319
js/games.js
@ -1,175 +1,192 @@
|
|||||||
$.getJSON("/games.json", function (data) {
|
$.getJSON("/games.json", function (data) {
|
||||||
if (document.readyState === "complete") {
|
if (document.readyState === "complete") {
|
||||||
loadGames(data);
|
loadGames(data);
|
||||||
} else {
|
} else {
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
let areGamesReady = setInterval(() => {
|
||||||
loadGames(data);
|
if (document.readyState === "complete") {
|
||||||
});
|
loadGames(data);
|
||||||
|
clearInterval(areGamesReady);
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function loadGames(data) {
|
function loadGames(data) {
|
||||||
starredgames = getCookie("starred");
|
starredgames = getCookie("starred");
|
||||||
if (starredgames == "") {
|
if (starredgames == "") {
|
||||||
starredgames = [];
|
starredgames = [];
|
||||||
} else {
|
} else {
|
||||||
starredgames = JSON.parse(starredgames);
|
starredgames = JSON.parse(starredgames);
|
||||||
}
|
}
|
||||||
console.log(starredgames);
|
$("#gamesearch").prop({
|
||||||
$("#gamesearch").prop({
|
placeholder: "Click here to search through our " + data.length + " games!",
|
||||||
placeholder: "Click here to search through our " + data.length + " games!",
|
});
|
||||||
});
|
data.sort(dynamicSort("name"));
|
||||||
data.sort(dynamicSort("name"));
|
gamelist = data;
|
||||||
gamelist = data;
|
for (let i = 0; i < data.length; i++) {
|
||||||
for (let i = 0; i < data.length; i++) {
|
let $element = $("<div>")
|
||||||
let $element = $("<div>")
|
.attr({
|
||||||
.attr({
|
class: "game",
|
||||||
class: "game",
|
id: data[i].directory,
|
||||||
id: data[i].directory,
|
recommended: data[i].recommended,
|
||||||
recommended: data[i].recommended
|
})
|
||||||
})
|
.data("recommended", data[i].recommended)
|
||||||
.data("recommended", data[i].recommended)
|
.append(
|
||||||
.append(
|
$("<img>").prop({
|
||||||
$("<img>").prop({
|
src: data[i].directory + "/" + data[i].image,
|
||||||
src: data[i].directory + "/" + data[i].image,
|
alt: data[i].name + " logo",
|
||||||
alt: data[i].name + " logo",
|
})
|
||||||
})
|
)
|
||||||
)
|
.append($("<h1>").text(data[i].name))
|
||||||
.append($("<h1>").text(data[i].name))
|
.append(
|
||||||
.append(
|
$("<img>").prop({
|
||||||
$("<img>").prop({
|
src: "img/star.svg",
|
||||||
src: "img/star.svg",
|
alt: "star",
|
||||||
alt: "star",
|
class: "star",
|
||||||
class: "star",
|
})
|
||||||
})
|
);
|
||||||
);
|
|
||||||
|
|
||||||
if (starredgames.includes(data[i].directory)) {
|
if (starredgames.includes(data[i].directory)) {
|
||||||
$element.find("img.star").attr("id", "starred");
|
$element.find("img.star").attr("id", "starred");
|
||||||
$element.find("img.star").attr("src", "img/star-fill.svg");
|
$element.find("img.star").attr("src", "img/star-fill.svg");
|
||||||
let $pinnedelement = $element.clone();
|
let $pinnedelement = $element.clone();
|
||||||
$("#pinned").append($pinnedelement);
|
$("#pinned").append($pinnedelement);
|
||||||
if ($("#pinnedmessage")) {
|
if ($("#pinnedmessage")) {
|
||||||
$("#pinnedmessage").hide();
|
$("#pinnedmessage").hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#games").append($element);
|
$("#games").append($element);
|
||||||
}
|
}
|
||||||
$("#games #message").remove();
|
$("#games #message").remove();
|
||||||
|
|
||||||
// starred games
|
if ((search = 1)) {
|
||||||
let starred;
|
var txt = $("#gamesearch").val();
|
||||||
$(document).on("click", ".game", function (event) {
|
if (txt == "") {
|
||||||
if ($(event.target).is("img.star")) {
|
$("#games .suggest").show();
|
||||||
if (!$(event.target).attr("id")) {
|
} else {
|
||||||
$(event.target).prop({ id: "starred" });
|
$("#games .suggest").hide();
|
||||||
$(event.target).prop({ src: "img/star-fill.svg" });
|
}
|
||||||
starred = Cookies.get("starred");
|
$("#games .game").hide();
|
||||||
if (starred) {
|
$("#games .game").each(function () {
|
||||||
starred = JSON.parse(starred);
|
if ($(this).text().toUpperCase().indexOf(txt.toUpperCase()) != -1 || $(this).attr("id").toUpperCase().indexOf(txt.toUpperCase()) != -1) {
|
||||||
} else {
|
$(this).show();
|
||||||
starred = [];
|
}
|
||||||
}
|
});
|
||||||
starred.push($(this).attr("id"));
|
}
|
||||||
Cookies.set("starred", JSON.stringify(starred));
|
|
||||||
$element = $(this).clone();
|
// starred games
|
||||||
$("#pinned").append($element);
|
let starred;
|
||||||
$("#pinnedmessage").hide();
|
$(document).on("click", ".game", function (event) {
|
||||||
temp = $("#pinned")[0].childNodes;
|
if ($(event.target).is("img.star")) {
|
||||||
pinnedarray = [...temp];
|
if (!$(event.target).attr("id")) {
|
||||||
pinnedarray.sort(dynamicSort("id"));
|
$(event.target).prop({ id: "starred" });
|
||||||
$("#pinned").empty();
|
$(event.target).prop({ src: "img/star-fill.svg" });
|
||||||
for (let i = 0; i < pinnedarray.length; i++) {
|
starred = Cookies.get("starred");
|
||||||
pinnedarraynodes = pinnedarray[i].childNodes;
|
if (starred) {
|
||||||
pinnedarraynodes = [...pinnedarraynodes];
|
starred = JSON.parse(starred);
|
||||||
let $element = $("<div>")
|
} else {
|
||||||
.prop({
|
starred = [];
|
||||||
class: "game",
|
}
|
||||||
id: pinnedarray[i].id,
|
starred.push($(this).attr("id"));
|
||||||
})
|
Cookies.set("starred", JSON.stringify(starred));
|
||||||
.append(
|
$element = $(this).clone();
|
||||||
$("<img>").prop({
|
$("#pinned").append($element);
|
||||||
src: pinnedarraynodes[0].src,
|
$("#pinnedmessage").hide();
|
||||||
alt: pinnedarraynodes[0].alt,
|
temp = $("#pinned")[0].childNodes;
|
||||||
class: "gameicon",
|
pinnedarray = [...temp];
|
||||||
})
|
pinnedarray.sort(dynamicSort("id"));
|
||||||
)
|
$("#pinned").empty();
|
||||||
.append($("<h1>").text(pinnedarraynodes[1].innerHTML))
|
for (let i = 0; i < pinnedarray.length; i++) {
|
||||||
.append(
|
pinnedarraynodes = pinnedarray[i].childNodes;
|
||||||
$("<img>").prop({
|
pinnedarraynodes = [...pinnedarraynodes];
|
||||||
src: "img/star-fill.svg",
|
let $element = $("<div>")
|
||||||
alt: "star",
|
.prop({
|
||||||
class: "star",
|
class: "game",
|
||||||
id: "starred",
|
id: pinnedarray[i].id,
|
||||||
})
|
})
|
||||||
);
|
.append(
|
||||||
$("#pinned").append($element);
|
$("<img>").prop({
|
||||||
}
|
src: pinnedarraynodes[0].src,
|
||||||
} else {
|
alt: pinnedarraynodes[0].alt,
|
||||||
$(event.target).removeAttr("id");
|
class: "gameicon",
|
||||||
$(event.target).attr("src", "img/star.svg");
|
})
|
||||||
$thisdiv = "#" + $(this).attr("id");
|
)
|
||||||
$thisdiv = $thisdiv.replace(".", "\\.");
|
.append($("<h1>").text(pinnedarraynodes[1].innerHTML))
|
||||||
starred = Cookies.get("starred");
|
.append(
|
||||||
starred = JSON.parse(starred);
|
$("<img>").prop({
|
||||||
ourindex = starred.indexOf($(this).attr("id"));
|
src: "img/star-fill.svg",
|
||||||
starred.splice(ourindex, 1);
|
alt: "star",
|
||||||
Cookies.set("starred", JSON.stringify(starred));
|
class: "star",
|
||||||
$("#pinned " + $thisdiv).remove();
|
id: "starred",
|
||||||
if ($("#pinned").is(":empty")) {
|
})
|
||||||
$("#pinnedmessage").show();
|
);
|
||||||
}
|
$("#pinned").append($element);
|
||||||
$($thisdiv + " #starred").attr("src", "img/star.svg");
|
}
|
||||||
$($thisdiv + " #starred").removeAttr("id");
|
} else {
|
||||||
}
|
$(event.target).removeAttr("id");
|
||||||
} else {
|
$(event.target).attr("src", "img/star.svg");
|
||||||
redirectGame($(this).attr("id"));
|
$thisdiv = "#" + $(this).attr("id");
|
||||||
}
|
$thisdiv = $thisdiv.replace(".", "\\.");
|
||||||
});
|
starred = Cookies.get("starred");
|
||||||
$(document).on("click", "#game img .star", function (event) {
|
starred = JSON.parse(starred);
|
||||||
$(this).prop({ class: "material-symbols-outlined fill" });
|
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");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
redirectGame($(this).attr("id"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(document).on("click", "#game img .star", function (event) {
|
||||||
|
$(this).prop({ class: "material-symbols-outlined fill" });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function redirectGame(dir) {
|
function redirectGame(dir) {
|
||||||
window.location.href = window.location.origin + "/" + dir + "/index.html";
|
window.location.href = window.location.origin + "/" + dir + "/index.html";
|
||||||
}
|
}
|
||||||
function dynamicSort(property) {
|
function dynamicSort(property) {
|
||||||
var sortOrder = 1;
|
var sortOrder = 1;
|
||||||
|
|
||||||
if (property[0] === "-") {
|
if (property[0] === "-") {
|
||||||
sortOrder = -1;
|
sortOrder = -1;
|
||||||
property = property.substr(1);
|
property = property.substr(1);
|
||||||
}
|
}
|
||||||
return function (a, b) {
|
return function (a, b) {
|
||||||
if (sortOrder == -1) {
|
if (sortOrder == -1) {
|
||||||
return b[property].localeCompare(a[property]);
|
return b[property].localeCompare(a[property]);
|
||||||
} else {
|
} else {
|
||||||
return a[property].localeCompare(b[property]);
|
return a[property].localeCompare(b[property]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectRandomGame() {
|
function selectRandomGame() {
|
||||||
redirectGame(gamelist[Math.floor(Math.random() * gamelist.length - 1)].directory);
|
redirectGame(gamelist[Math.floor(Math.random() * gamelist.length - 1)].directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
let viewrecommended = 0;
|
let viewrecommended = 0;
|
||||||
function recommendedGames() {
|
function recommendedGames() {
|
||||||
if(viewrecommended == 0) {
|
if (viewrecommended == 0) {
|
||||||
$("#games .game").hide();
|
$("#games .game").hide();
|
||||||
$("#games .game").each(function () {
|
$("#games .game").each(function () {
|
||||||
if ($(this).attr("recommended")) {
|
if ($(this).attr("recommended")) {
|
||||||
$(this).show();
|
$(this).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#recommend").text("Click to view all games again!");
|
$("#recommend").text("Click to view all games again!");
|
||||||
viewrecommended = 1;
|
viewrecommended = 1;
|
||||||
} else {
|
} else {
|
||||||
$("#games .game").hide();
|
$("#games .game").hide();
|
||||||
$("#games .game").show();
|
$("#games .game").show();
|
||||||
viewrecommended = 0;
|
viewrecommended = 0;
|
||||||
$("#recommend").text("Click to view recommended games!");
|
$("#recommend").text("Click to view recommended games!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,10 @@ function copyToClipboard(text) {
|
|||||||
function setTheme(theme) {
|
function setTheme(theme) {
|
||||||
localStorage.setItem("selenite.theme", theme);
|
localStorage.setItem("selenite.theme", theme);
|
||||||
document.body.setAttribute("theme", theme);
|
document.body.setAttribute("theme", theme);
|
||||||
|
if(theme != "custom") {
|
||||||
|
document.getElementById("customMenu").style.display = "none";
|
||||||
|
document.body.style = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function setPanicMode() {
|
function setPanicMode() {
|
||||||
if (!$("#panic").val().startsWith("https")) {
|
if (!$("#panic").val().startsWith("https")) {
|
||||||
@ -100,10 +104,6 @@ function setPanicMode() {
|
|||||||
}
|
}
|
||||||
document.cookie = "panicurl=" + $("#panic").val();
|
document.cookie = "panicurl=" + $("#panic").val();
|
||||||
}
|
}
|
||||||
function customTheme() {
|
|
||||||
const customMenu = document.querySelector("#customMenu");
|
|
||||||
customMenu.removeAttribute("display");
|
|
||||||
}
|
|
||||||
if (location.hostname.includes(".vercel.app") && (location.hostname.includes("selenite-beta") || location.hostname.includes("space-lovers") || location.hostname.includes("school-education"))) {
|
if (location.hostname.includes(".vercel.app") && (location.hostname.includes("selenite-beta") || location.hostname.includes("space-lovers") || location.hostname.includes("school-education"))) {
|
||||||
alert("IMPORTANT:\nVercel links will be taken offline eventually. Please move to a new link. You can find these in the Discord at discord.gg/7jyufnwJNf, or you can try a few of the ones listed\nselenite.cc\nselenite.pages.dev\nselenite.skysthelimit.dev\nall-about-science.onrender.com");
|
alert("IMPORTANT:\nVercel links will be taken offline eventually. Please move to a new link. You can find these in the Discord at discord.gg/7jyufnwJNf, or you can try a few of the ones listed\nselenite.cc\nselenite.pages.dev\nselenite.skysthelimit.dev\nall-about-science.onrender.com");
|
||||||
}
|
}
|
||||||
|
44
js/search.js
@ -1,16 +1,30 @@
|
|||||||
$(document).ready(function () {
|
function searchGames() {
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
let urlParams = new URLSearchParams(window.location.search);
|
||||||
|
let q = urlParams.get("q");
|
||||||
|
if (q) {
|
||||||
|
document.getElementById("gamesearch").value = q;
|
||||||
|
searchGames();
|
||||||
|
urlParams.delete("q");
|
||||||
|
window.history.replaceState({}, document.title, location.pathname);
|
||||||
|
}
|
||||||
$("#gamesearch").on("input propertychange paste", function () {
|
$("#gamesearch").on("input propertychange paste", function () {
|
||||||
var txt = $("#gamesearch").val();
|
searchGames();
|
||||||
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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
@ -108,15 +108,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="customMenu" style="display: none;">
|
<div id="customMenu" style="display: none;">
|
||||||
<p>Input BG Color</p>
|
<p>Input BG Color</p>
|
||||||
<input type="color" id="inputbg" value="#ffffff" />
|
<input type="color" id="inputbg"/>
|
||||||
<p>Input Border Color</p>
|
<p>Input Border Color</p>
|
||||||
<input type="color" id="inputborder" value="#ffffff" />
|
<input type="color" id="inputborder"/>
|
||||||
<p>UI Background Color</p>
|
<p>UI Background Color</p>
|
||||||
<input type="color" id="uibg" value="#ffffff" />
|
<input type="color" id="uibg"/>
|
||||||
<p>Text Color</p>
|
<p>Text Color</p>
|
||||||
<input type="color" id="textcolor" value="#ffffff" />
|
<input type="color" id="textcolor"/>
|
||||||
<p>Background</p>
|
<p>Background</p>
|
||||||
<input type="color" id="bg" value="#ffffff" />
|
<input type="color" id="bg"/>
|
||||||
<p>or select an image (click enter to set)</p>
|
<p>or select an image (click enter to set)</p>
|
||||||
<input type="text" id="bgimg" placeholder="https://selenite.cc/" /><br />
|
<input type="text" id="bgimg" placeholder="https://selenite.cc/" /><br />
|
||||||
<!-- --inputbg: #000000;
|
<!-- --inputbg: #000000;
|
||||||
|
@ -5,6 +5,13 @@ body {
|
|||||||
--textcolor: #000;
|
--textcolor: #000;
|
||||||
--bg: #000000;
|
--bg: #000000;
|
||||||
}
|
}
|
||||||
|
body[theme=custom] {
|
||||||
|
--inputbg: #3c096c;
|
||||||
|
--inputborder: #5a189a;
|
||||||
|
--uibg: #240046;
|
||||||
|
--textcolor: #fff;
|
||||||
|
--bg: #10002b;
|
||||||
|
}
|
||||||
body[theme=main] {
|
body[theme=main] {
|
||||||
--inputbg: #3c096c;
|
--inputbg: #3c096c;
|
||||||
--inputborder: #5a189a;
|
--inputborder: #5a189a;
|
||||||
|