From 76d825f9c5b31b8e465e8cd55210b1d9d546e96a Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" <48434875+JonnyBro@users.noreply.github.com> Date: Mon, 24 Feb 2025 18:53:27 +0500 Subject: [PATCH] feat: simple theme selector --- components/course_card_orig.html | 58 -------------------------------- components/footer.html | 1 + components/navbar.html | 33 +++++++++++------- views/admin.ejs | 3 ++ views/index.ejs | 3 ++ views/key.ejs | 5 +++ views/stats.ejs | 6 ++++ views/upload.ejs | 5 +++ 8 files changed, 43 insertions(+), 71 deletions(-) delete mode 100644 components/course_card_orig.html diff --git a/components/course_card_orig.html b/components/course_card_orig.html deleted file mode 100644 index 305af7a..0000000 --- a/components/course_card_orig.html +++ /dev/null @@ -1,58 +0,0 @@ -
-
-
- -
- -
-
-
- {elementcount} -
-
-
-
-
-
-
-
-

{coursename}

-
-
-
- - {coursecode} -
-
-
- -
-
-
- - {fdate} -
-
-
- {likecount} - - / - {dislikecount} - -
-
- -
-
-
-
-
\ No newline at end of file diff --git a/components/footer.html b/components/footer.html index d561e9f..d473e78 100644 --- a/components/footer.html +++ b/components/footer.html @@ -1,6 +1,7 @@ \ No newline at end of file diff --git a/components/navbar.html b/components/navbar.html index 83dc577..5f995f0 100644 --- a/components/navbar.html +++ b/components/navbar.html @@ -22,6 +22,11 @@ Our Discord + <% if (user) { %> <%= user.personaname %> Upload @@ -48,11 +53,11 @@ Our Discord - + <% if (user) { %> <%= user.personaname %> Upload @@ -64,21 +69,23 @@ Admin <% } %> - + document.documentElement.setAttribute("data-theme", localStorage.getItem("theme")); + }); + + if (localStorage.getItem("theme") === "black") document.getElementById("themeSelector").checked = "checked"; + else document.getElementById("themeSelector").checked = null; + \ No newline at end of file diff --git a/views/admin.ejs b/views/admin.ejs index 8b2f2ab..06b9e90 100644 --- a/views/admin.ejs +++ b/views/admin.ejs @@ -25,6 +25,9 @@ diff --git a/views/stats.ejs b/views/stats.ejs index 0c3e522..de42734 100644 --- a/views/stats.ejs +++ b/views/stats.ejs @@ -24,10 +24,16 @@ -ms-overflow-style: none; } + + <% include ../components/navbar.html %> +
diff --git a/views/upload.ejs b/views/upload.ejs index 4df1b06..a49d6bc 100644 --- a/views/upload.ejs +++ b/views/upload.ejs @@ -24,6 +24,11 @@ -ms-overflow-style: none; } + +