limepot-xyz/public/scripts/limepot.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-07-04 00:16:49 -06:00
function onload() {
2024-07-13 00:03:34 -06:00
redirect();
sdocument.getElementById("body").style.fontFamily = "system-ui, sans-serif";
2024-07-04 00:16:49 -06:00
}
2024-07-13 00:03:34 -06:00
function toggleTheme() {
// Obtains an array of all <link>
// elements.
// Select your element using indexing.
if (document.getElementById("body").style.fontFamily !== "standardGalactic") {
document.getElementById("body").style.fontFamily = "standardGalactic";
} else {
document.getElementById("body").style.fontFamily = "system-ui, sans-serif";
}
}
2024-07-04 00:16:49 -06:00
function redirect() {
2024-07-13 00:03:34 -06:00
let chromium = /Chrome|Chromium|OPR|Opera|Edge|UC|QQ|Brave/.test(
2024-07-04 00:16:49 -06:00
navigator.userAgent
);
let disclaimer = `<div class="web-disclaimer">`;
2024-07-19 17:40:40 -06:00
if (chromium) window.location.replace("/bsod");
}
// Resizable textarea
const tx = document.getElementsByTagName("textarea");
for (let i = 0; i < tx.length; i++) {
2024-07-13 00:03:34 -06:00
tx[i].setAttribute(
"style",
"height:" + tx[i].scrollHeight + "px;overflow-y:hidden;"
);
tx[i].addEventListener("input", OnInput, false);
}
function OnInput() {
2024-07-13 00:03:34 -06:00
this.style.height = "auto";
this.style.height = this.scrollHeight + "px";
}