diff --git a/index.html b/index.html index cc37031..677ed71 100644 --- a/index.html +++ b/index.html @@ -56,21 +56,21 @@
-
- @@ -89,4 +89,4 @@ - \ No newline at end of file + diff --git a/js/darkmode.js b/js/darkmode.js index f7ba5d4..f2e50f4 100644 --- a/js/darkmode.js +++ b/js/darkmode.js @@ -1,21 +1,27 @@ -let darkmode = localStorage.getItem('dark'); -const switch_button = document.getElementById("theme_switch"); - -const enableDarkmode = () => { - document.body.classList.add('dark'); - localStorage.setItem('dark' , 'active'); -} - -const disableDarkmode = () => { - document.body.classList.remove('dark'); - localStorage.removeItem('dark'); +// Function to apply the theme based on localStorage +const applyTheme = () => { + const darkmode = localStorage.getItem('dark'); + if (darkmode === 'active') { + document.body.classList.add('dark'); + } else { + document.body.classList.remove('dark'); + } }; -if (darkmode === 'active') enableDarkmode(); - -switch_button.addEventListener("click", () => { - darkmode = localStorage.getItem('dark'); - darkmode !== "active" ? enableDarkmode() : disableDarkmode(); -}); - +// Run on initial load +// Since the script is 'defer', document.body will be available +applyTheme(); +// Set up the toggle button listener +const switch_button = document.getElementById("theme_switch"); +if (switch_button) { + switch_button.addEventListener("click", () => { + const darkmode = localStorage.getItem('dark'); + if (darkmode !== "active") { + localStorage.setItem('dark', 'active'); + } else { + localStorage.setItem('dark', 'inactive'); + } + applyTheme(); + }); +} diff --git a/page/info.html b/page/info.html new file mode 100644 index 0000000..91061db --- /dev/null +++ b/page/info.html @@ -0,0 +1,98 @@ + + + + + + + Rain about + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+ +
+ +
+
+ + +
+
+
+
+ About +
+
+ +
+
+
+ +
+
+

Simon Zheng

+

Student & Programmer

+
+
+ +
+
+
+ +

Education

+
+
+

Bachelor of Science in Computer Science

+

Brooklyn College • Class of 2026

+
+
+ +
+
+ +

Interests

+
+
    +
  • Gaming
  • +
  • Coffee
  • +
  • Mahjong
  • +
  • Coding
  • +
  • UI Design
  • +
+
+
+
+
+
+ +
+ + + + diff --git a/page/link.html b/page/link.html new file mode 100644 index 0000000..ba01116 --- /dev/null +++ b/page/link.html @@ -0,0 +1,68 @@ + + + + + + + Rain links + + + + + + + + + + + +
+
+
+ +
+
+ +
+
+ +
+
+
+
+ Links +
+
+
+
+

Links

+
+ +
+
+
+ +
+ + diff --git a/page/project.html b/page/project.html new file mode 100644 index 0000000..cf47c98 --- /dev/null +++ b/page/project.html @@ -0,0 +1,48 @@ + + + + + + + Rain links + + + + + + + + + + + +
+
+
+ +
+
+ +
+
+ +
+
+
+
+ Projects +
+
+
+
+
+
+ +
+ +