limepot-xyz/public/scripts/limepot.js

37 lines
No EOL
1.1 KiB
JavaScript

function onload() {
redirect()
sdocument.getElementById("body").style.fontFamily = "system-ui, sans-serif";
}
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";
}
}
function redirect() {
let chromium = /Chrome|Chromium|OPR|Opera|Edge|UC|QQ|Brave/.test(
navigator.userAgent
);
let disclaimer = `<div class="web-disclaimer">`;
if (chromium)
window.location.replace("/nochrome");
}
// Resizable textarea
const tx = document.getElementsByTagName("textarea");
for (let i = 0; i < tx.length; i++) {
tx[i].setAttribute("style", "height:" + (tx[i].scrollHeight) + "px;overflow-y:hidden;");
tx[i].addEventListener("input", OnInput, false);
}
function OnInput() {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + "px";
}