From 201c26046539d6e0b9ddd42b5e12f49c5de76c99 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:09:29 +0200 Subject: [PATCH 1/4] fix(webui): make sidebar sticky as intended also a bit of language-specific width adjustment --- static/webui/index.html | 2 +- static/webui/style.css | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/static/webui/index.html b/static/webui/index.html index 6c62867e..4c96ef43 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -75,7 +75,7 @@ -
+

diff --git a/static/webui/style.css b/static/webui/style.css index 05677dd7..b5abd6fd 100644 --- a/static/webui/style.css +++ b/static/webui/style.css @@ -4,9 +4,20 @@ } body.logged-in #sidebar { - position: sticky; - top: 5rem; - margin-right: 3rem; + position: fixed; + } + + body.logged-in #main-content { + width: 100%; + margin-left: 7rem; + } + + body.logged-in:has([data-lang=de].active) #main-content { + margin-left: 8rem; + } + + body.logged-in:has([data-lang=zh].active) #main-content { + margin-left: 6rem; } body:not(.logged-in) #sidebar { -- 2.47.2 From fc756c91ad91029f60dd9a5a355ee89776dd9db4 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:11:26 +0200 Subject: [PATCH 2/4] don't require .logged-in to apply w-100 --- static/webui/index.html | 2 +- static/webui/style.css | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/static/webui/index.html b/static/webui/index.html index 4c96ef43..c228a9ef 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -75,7 +75,7 @@
-
+

diff --git a/static/webui/style.css b/static/webui/style.css index b5abd6fd..5da218e6 100644 --- a/static/webui/style.css +++ b/static/webui/style.css @@ -8,7 +8,6 @@ } body.logged-in #main-content { - width: 100%; margin-left: 7rem; } -- 2.47.2 From 4964c4cb203a0d027eb05eff02307b31328968af Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:20:38 +0200 Subject: [PATCH 3/4] reset scroll when clicking on a sidebar link --- static/webui/script.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/webui/script.js b/static/webui/script.js index 9948247c..f648809c 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -2738,3 +2738,9 @@ function handleValenceBonusChange(event) { }); }); } + +document.querySelectorAll("#sidebar .nav-link").forEach(function (elm) { + elm.addEventListener("click", function () { + window.scrollTo(0, 0); + }); +}); -- 2.47.2 From 9e7baf323929316304c22c3c5abbad70d5eeae08 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:20:42 +0200 Subject: [PATCH 4/4] prettier --- static/webui/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/webui/style.css b/static/webui/style.css index 5da218e6..becce85d 100644 --- a/static/webui/style.css +++ b/static/webui/style.css @@ -11,11 +11,11 @@ margin-left: 7rem; } - body.logged-in:has([data-lang=de].active) #main-content { + body.logged-in:has([data-lang="de"].active) #main-content { margin-left: 8rem; } - body.logged-in:has([data-lang=zh].active) #main-content { + body.logged-in:has([data-lang="zh"].active) #main-content { margin-left: 6rem; } -- 2.47.2