Skip to content

Commit 8dae023

Browse files
committed
fix: flashbang issue
* authored by https://github.com/Chiroyce1
1 parent 9e3dcf7 commit 8dae023

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<script>
7+
(function () {
8+
var saved;
9+
try { saved = localStorage.getItem("theme"); } catch (e) {}
10+
var prefersDark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
11+
document.documentElement.dataset.theme = saved || (prefersDark ? "dark" : "light");
12+
})();
13+
</script>
614
<title>threadlocked · webring</title>
715
<style>
816
:root {
@@ -330,11 +338,7 @@ <h1>thread<span class="ring">locked</span></h1>
330338
try { localStorage.setItem("theme", theme); } catch (e) {}
331339
}
332340

333-
var saved;
334-
try { saved = localStorage.getItem("theme"); } catch (e) {}
335-
var prefersDark = window.matchMedia &&
336-
window.matchMedia("(prefers-color-scheme: dark)").matches;
337-
apply(saved || (prefersDark ? "dark" : "light"));
341+
apply(root.dataset.theme || "light");
338342

339343
btn.addEventListener("click", function () {
340344
apply(root.dataset.theme === "dark" ? "light" : "dark");

webring.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
"gh": "0xmukesh",
55
"url": "https://0xmukesh.github.io"
66
},
7+
{
8+
"name": "rohith",
9+
"gh": "rv178",
10+
"url": "https://rohith.net"
11+
},
12+
{
13+
"name": "namish",
14+
"gh": "namishh",
15+
"url": "https://namishh.com"
16+
},
17+
{
18+
"name": "pranav",
19+
"gh": "pranavu-coder",
20+
"url": "https://pranavu.dev/"
21+
},
722
{
823
"name": "sahil_gulihar",
924
"gh": "sahil-gulihar",
@@ -109,11 +124,6 @@
109124
"gh": "kinetictactic",
110125
"url": "https://github.com/KineticTactic"
111126
},
112-
{
113-
"name": "namish",
114-
"gh": "namishh",
115-
"url": "https://namishh.com"
116-
},
117127
{
118128
"name": "sarthak",
119129
"gh": "Sarthak-Sidhant",
@@ -154,16 +164,6 @@
154164
"gh": "funinkina",
155165
"url": "https://funinkina.co.in"
156166
},
157-
{
158-
"name": "rohith",
159-
"gh": "rv178",
160-
"url": "https://rohith.net"
161-
},
162-
{
163-
"name": "pranav",
164-
"gh": "pranavu-coder",
165-
"url": "https://pranavu.dev/"
166-
},
167167
{
168168
"name": "angad",
169169
"gh": "angadbasandrai",

0 commit comments

Comments
 (0)