-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
38 lines (27 loc) · 952 Bytes
/
Copy pathscript.js
File metadata and controls
38 lines (27 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
console.log("VERSION 2026-06-13 TEST");
window.addEventListener("DOMContentLoaded", () => {
const card = document.querySelector(".card");
const toggle = document.getElementById("theme-toggle");
if (card) {
requestAnimationFrame(() => {
card.classList.add("visible");
});
}
if (!toggle) {
console.error("Theme toggle button not found");
return;
}
const savedTheme = localStorage.getItem("theme") || "dark";
document.documentElement.setAttribute("data-theme", savedTheme);
toggle.textContent = savedTheme === "dark" ? "☀️" : "🌙";
toggle.addEventListener("click", () => {
const current =
document.documentElement.getAttribute("data-theme");
const next =
current === "dark" ? "light" : "dark";
document.documentElement.setAttribute("data-theme", next);
localStorage.setItem("theme", next);
toggle.textContent =
next === "dark" ? "☀️" : "🌙";
});
});