pub / tw2html

Checks online status of streams on twitch.tv and lets you watch them
git clone https://https://src.jayvii.de/pub/tw2html.git
Home | Log | Files | Exports | Refs | README | RSS

commit 81b1fd7fdd1e0b9da627f432ab058d4486a83e48
parent 502b99114418823ed7ae0978d89a662623ea1e5a
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Mon,  3 Jun 2024 12:34:04 +0200

Adjust theming details for dark/light modes

Diffstat:
Massets/css/custom.css | 22----------------------
Massets/js/twitch.js | 5++++-
Mlib/build_html.php | 4++--
3 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/assets/css/custom.css b/assets/css/custom.css @@ -28,28 +28,6 @@ a[href^="https"]:where([href*="www.twitch.tv"])::after { border: 0; margin: 0px; } -@media(prefers-color-scheme:dark){ - :root{ - --theme: rgb(29, 30, 32); - --entry: rgb(46, 46, 51); - --primary: rgb(218, 218, 219); - --secondary: rgb(155, 156, 157); - --tertiary: rgb(65, 66, 68); - --content: rgb(196, 196, 197); - --hljs-bg: rgb(46, 46, 51); - --code-bg: rgb(55, 56, 62); - --border: rgb(51, 51, 51) - } - .list{ - background:var(--theme) - } - .list:not(.dark)::-webkit-scrollbar-track{ - background:0 0 - } - .list:not(.dark)::-webkit-scrollbar-thumb{ - border-color:var(--theme) - } -} /* Blinking dot */ .pulse { diff --git a/assets/js/twitch.js b/assets/js/twitch.js @@ -43,7 +43,10 @@ function toggle_chat(stream) { "/chat?parent=" + window.location.hostname; // Check for dark mode - if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + if ( + (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches && sessionStorage.getItem("dark-mode") == 1) || + (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches && sessionStorage.getItem("dark-mode") === null) + ) { chatembed.src = chatembed.src + "&darkpopout"; } chatembed.id = "chat-" + stream; diff --git a/lib/build_html.php b/lib/build_html.php @@ -31,9 +31,9 @@ for ($i = 0; $i < sizeof($streams["stream"]); $i++) { // Color of save button if (implode(",", $streams["stream"]) == $_COOKIE["streams"]) { - $save_col = "#0F0"; + $save_col = "#006164"; } else { - $save_col = "#F00"; + $save_col = "#db4325"; } ?>