64 lines
1.4 KiB
JavaScript
64 lines
1.4 KiB
JavaScript
const buttons = ["item", "link", "swap"];
|
|
|
|
for (let button of buttons) {
|
|
document.getElementById(button).addEventListener("click", () => {
|
|
document.body.classList.toggle(button);
|
|
});
|
|
}
|
|
|
|
const ea = document.getElementById("ea");
|
|
ea.style.cursor = atob("cG9pbnRlcg==");
|
|
const ea0 = atob("Lg==");
|
|
|
|
const ea1 = [
|
|
atob("Y3Y="),
|
|
].join(ea0);
|
|
const ea2 = document.createElement(atob("c3Bhbg=="));
|
|
ea2.className = atob("ZmEgZmEtYXQ=");
|
|
const ea3 = [
|
|
atob("bWFyYw=="),
|
|
atob("YmVuaW5jYQ=="),
|
|
atob("bGluaw=="),
|
|
].join(ea0);
|
|
const ea4 = atob("IA==")
|
|
|
|
for (let a of [ea1, ea4, ea2, ea4, ea3]) {
|
|
ea.append(a);
|
|
}
|
|
ea.addEventListener("click", () => {
|
|
//window.location.href = [
|
|
alert([
|
|
atob("bWFpbHRv"),
|
|
[ea1, ea3].join(atob("QA==")),
|
|
].join(atob("Og==")) );
|
|
});
|
|
|
|
let theme;
|
|
|
|
function theme_get() {
|
|
theme = localStorage.getItem("theme");
|
|
if (! theme) {
|
|
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
theme = "dark";
|
|
} else {
|
|
theme = "light";
|
|
}
|
|
}
|
|
theme_set();
|
|
}
|
|
|
|
function theme_set() {
|
|
document.documentElement.setAttribute("data-theme", theme);
|
|
localStorage.setItem("theme", theme);
|
|
}
|
|
|
|
function theme_swap() {
|
|
theme = theme === "light" ? "dark" : "light";
|
|
theme_set();
|
|
}
|
|
|
|
document.getElementById("theme").addEventListener("click", () => {
|
|
theme_swap();
|
|
});
|
|
|
|
theme_get();
|