niri 1.9 → 2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/js/darklight-mode.js +26 -25
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0ab1bf9c291d23a9d571463a6741b65eeb796497ae5af84f8b36984059889c3
|
4
|
+
data.tar.gz: 9ff1462ee5b5f4ea8fa5d68dddbd2e456ee928df7d12b0a823d969a6567c3eae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a89078a2ac221200ce40cb6da4644617d07b36613ccfadb271c54cdf0ec71bc3c42f12dd52cf6d121d974b6a8f1ffa2135d1cf0668aa45ab303a28b732a3e9e4
|
7
|
+
data.tar.gz: aaf29855476d2a07908252c6232d633ab3c7aaf3fd3c93925d7193c1a21d617f7b36a22aaf5373d0dbf43104121127abd2ba817f28eaacebb3210dcc399cd3ae
|
data/assets/js/darklight-mode.js
CHANGED
@@ -1,30 +1,31 @@
|
|
1
1
|
document.addEventListener("DOMContentLoaded", function () {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
const toggleButton = document.getElementById("toggle-button");
|
3
|
+
const themeIcon = document.getElementById("theme-icon");
|
4
|
+
const currentTheme = localStorage.getItem("theme");
|
5
|
+
|
6
|
+
// Set default theme to Dark Mode
|
7
|
+
if (!currentTheme) {
|
8
|
+
document.documentElement.classList.add("is-dark");
|
9
|
+
localStorage.setItem("theme", "dark");
|
10
|
+
} else if (currentTheme === "dark") {
|
11
|
+
document.documentElement.classList.add("is-dark");
|
12
|
+
} else {
|
13
|
+
document.documentElement.classList.remove("is-dark");
|
14
|
+
}
|
15
|
+
|
16
|
+
function updateIcon() {
|
17
|
+
if (document.documentElement.classList.contains("is-dark")) {
|
18
|
+
themeIcon.classList.replace("fa-moon", "fa-sun");
|
12
19
|
} else {
|
13
|
-
|
20
|
+
themeIcon.classList.replace("fa-sun", "fa-moon");
|
14
21
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
|
24
|
-
// Perbarui ikon sesuai mode awal
|
25
|
-
updateIcon();
|
26
|
-
|
27
|
-
toggleButton.addEventListener("click", () => {
|
22
|
+
}
|
23
|
+
|
24
|
+
// Perbarui ikon sesuai mode awal
|
25
|
+
updateIcon();
|
26
|
+
|
27
|
+
toggleButton.addEventListener("click", () => {
|
28
|
+
requestAnimationFrame(() => {
|
28
29
|
document.documentElement.classList.toggle("is-dark");
|
29
30
|
if (document.documentElement.classList.contains("is-dark")) {
|
30
31
|
localStorage.setItem("theme", "dark");
|
@@ -34,4 +35,4 @@ document.addEventListener("DOMContentLoaded", function () {
|
|
34
35
|
updateIcon();
|
35
36
|
});
|
36
37
|
});
|
37
|
-
|
38
|
+
});
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: niri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '2.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rokhimin Wahid
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-01 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: jekyll
|