From fc7d38e3f1d1736728cb2cd45534704a4ca6ac04 Mon Sep 17 00:00:00 2001 From: x Date: Sat, 24 Jan 2026 11:12:25 +0100 Subject: [PATCH] mono theme, keep it black and simple --- public/s/js/theme.js | 34 +++++++++++++++++----------------- src/index.mjs | 2 +- views/settings.html | 35 ++++++++++++++++------------------- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/public/s/js/theme.js b/public/s/js/theme.js index 318c08f..64975e0 100644 --- a/public/s/js/theme.js +++ b/public/s/js/theme.js @@ -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')) { diff --git a/src/index.mjs b/src/index.mjs index b305ec0..bc547d0 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -69,7 +69,7 @@ process.on('unhandledRejection', err => { req.session = false; if (req.url.pathname.match(/^\/(s|b|t|ca)\//)) return; - req.theme = req.cookies.theme || 'amoled'; + req.theme = 'amoled'; req.fullscreen = req.cookies.fullscreen || 0; if (req.cookies.session) { diff --git a/views/settings.html b/views/settings.html index 8cc9421..1c19b43 100644 --- a/views/settings.html +++ b/views/settings.html @@ -2,19 +2,15 @@

Settings

Site settings

-
-

Themes

- @each(themes as t) - {{ t }} - @endeach -
-
-

Modes

- Current: {{ modes[session.mode] ?? 'sfw' }} - @for(let i = 0; i < modes.length; i++) - {{ modes[i] }} - @endfor -
+ +
+

Modes

+ Current: {{ modes[session.mode] ?? 'sfw' }} + sfw + nsfw + untagged + all +

Account

@@ -31,7 +27,8 @@ - + @@ -39,7 +36,7 @@ - +
{!! session.user !!}
@if(session.avatar)@endif@if(session.avatar)@endif
@@ -55,7 +52,7 @@ @each(sessions as sess) - + {{ sess.kmsi ? '⚓' : '' }}

{{ sess.id }}

@@ -66,9 +63,9 @@

created_at: {{ new Date(sess.created_at * 1e3).toLocaleString("de-DE") }}

{{ sess.last_action }} - - @endeach + + @endeach
-@include(snippets/footer) +@include(snippets/footer) \ No newline at end of file