diff options
| author | Physcik <mynameisgennadiy@vk.com> | 2025-12-26 15:40:32 +0500 |
|---|---|---|
| committer | Physcik <mynameisgennadiy@vk.com> | 2025-12-26 15:40:32 +0500 |
| commit | 4612cba3d9c7c44a665f4d111ca9a230df14f2ae (patch) | |
| tree | a6546afd168a698918937029ef6531241067329b /static | |
| parent | facc11896f7219645144385637d57c39e107c6c4 (diff) | |
theme persistance
Diffstat (limited to 'static')
| -rw-r--r-- | static/common.css | 10 | ||||
| -rw-r--r-- | static/common.js | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/static/common.css b/static/common.css index a5c74dc..a69065c 100644 --- a/static/common.css +++ b/static/common.css @@ -53,7 +53,6 @@ body { a { color: var(--colorscheme-red); - text-decoration: none; font-weight: bold; } @@ -126,6 +125,11 @@ a { color: var(--colorscheme-red); } +#content > h2 { + font-size: 30px; + color: var(--colorscheme-red); +} + #content > .code { border: 2px solid var(--colorscheme-cyan); border-radius: 10px; @@ -158,6 +162,10 @@ body.light { text-shadow: 1px 1px 2px var(--colorscheme-gray); } +#content.light > h2 { + text-shadow: 1px 1px 2px var(--colorscheme-gray); +} + #content > ul { padding-left: 0px; font-style: normal; diff --git a/static/common.js b/static/common.js index e3566b1..a7dc3a5 100644 --- a/static/common.js +++ b/static/common.js @@ -1,7 +1,10 @@ -var isLightMode = false; +function setMode() { + if (localStorage.getItem("theme") == "light") + setLightMode(); +} function ToggleMode() { - if (isLightMode) + if (localStorage.getItem("theme") == "light") setDarkMode(); else setLightMode(); @@ -9,14 +12,14 @@ function ToggleMode() { function setLightMode() { swapClasses("dark", "light"); - isLightMode = true; + localStorage.setItem("theme", "light"); document.getElementById("toggleIcon").src = "static/toggle.svg" document.getElementById("homeIcon").src = "static/home_dark.svg" } function setDarkMode() { swapClasses("light", "dark"); - isLightMode = false; + localStorage.setItem("theme", "dark"); document.getElementById("toggleIcon").src = "static/toggle_dark.svg" document.getElementById("homeIcon").src = "static/home.svg" } |
