mono theme, keep it black and simple

This commit is contained in:
x
2026-01-24 11:12:25 +01:00
parent 2229f32dd3
commit fc7d38e3f1
3 changed files with 34 additions and 37 deletions

View File

@@ -23,14 +23,14 @@ const Cookie = {
const themes = [...themecontainer.querySelectorAll("li > a")].map(t => t.innerText.toLowerCase());
if (acttheme !== document.documentElement.getAttribute("theme") && themes.includes(acttheme))
document.documentElement.setAttribute("theme", acttheme);
[...themecontainer.querySelectorAll("li > a")].forEach(t => t.addEventListener("click", e => {
e.preventDefault();
const _theme = e.target.innerText.toLowerCase();
document.documentElement.setAttribute("theme", _theme);
document.querySelector("#themes > a").setAttribute("content", _theme);
Cookie.set("theme", _theme, { path: "/", days: 360 });
return false;
}));
// [...themecontainer.querySelectorAll("li > a")].forEach(t => t.addEventListener("click", e => {
// e.preventDefault();
// const _theme = e.target.innerText.toLowerCase();
// document.documentElement.setAttribute("theme", _theme);
// document.querySelector("#themes > a").setAttribute("content", _theme);
// Cookie.set("theme", _theme, { path: "/", days: 360 });
// return false;
// }));
document.addEventListener("keydown", e => {
if (e.target.tagName === "INPUT" || e.target.tagName === "TEXTAREA")
@@ -38,15 +38,15 @@ const Cookie = {
const acttheme = Cookie.get('theme') ?? "w0bm";
const themes = [...themecontainer.querySelectorAll("li > a")].map(t => t.innerText.toLowerCase());
const k = e.key;
if (k === "t") {
e.preventDefault();
let i = themes.indexOf(acttheme);
if (++i >= themes.length)
i = 0;
document.documentElement.setAttribute("theme", themes[i]);
document.querySelector("#themes > a").setAttribute("content", themes[i]);
Cookie.set("theme", themes[i], { path: "/", days: 360 });
}
// if (k === "t") {
// e.preventDefault();
// let i = themes.indexOf(acttheme);
// if (++i >= themes.length)
// i = 0;
// document.documentElement.setAttribute("theme", themes[i]);
// document.querySelector("#themes > a").setAttribute("content", themes[i]);
// Cookie.set("theme", themes[i], { path: "/", days: 360 });
// }
});
if (tbuttonfull = document.querySelector('svg#a_tfull')) {