@@ -18,14 +18,16 @@ const isActive = (path: string) => {
1818 return currentPath === path ;
1919};
2020---
21-
22- <header class =" sticky top-0 z-50 w-full border-b border-foreground/10 bg-background/95 backdrop-blur-md" >
21+ <header
22+ class =" sticky top-0 z-50 w-full border-b border-foreground/10"
23+ style =" background: hsl(var(--background)); backdrop-filter: none;"
24+ >
2325
2426 <div class =" mx-auto flex h-24 w-full items-center justify-between px-4 sm:px-6 lg:px-10" >
2527
2628 <!-- LEFT LOGO -->
2729 <a href =" /" class =" flex items-center gap-3 lg:gap-4" >
28-
30+
2931 <Picture
3032 src ={ logoImage }
3133 formats ={ [" png" , " webp" , " jpg" ]}
@@ -41,7 +43,7 @@ const isActive = (path: string) => {
4143 </a >
4244
4345 <!-- CENTER NAV -->
44- <nav class =" hidden lg:flex absolute left-1/2 -translate-x-1/2" >
46+ <nav class =" absolute left-1/2 hidden -translate-x-1/2 lg:flex " >
4547 <ul class =" flex items-center gap-10" >
4648
4749 {
@@ -67,18 +69,18 @@ const isActive = (path: string) => {
6769 <!-- RIGHT -->
6870 <div class =" flex items-center gap-4" >
6971
70- <!-- TOGGLE -->
72+ <!-- THEME TOGGLE -->
7173 <button
7274 id =" themeToggle"
73- class =" flex h-12 w-12 items-center justify-center rounded-2xl border border-foreground/10 text-lg text-foreground transition hover:bg-foreground hover:text-background"
75+ class =" flex h-12 w-12 items-center justify-center rounded-2xl border border-foreground/10 text-2xl text-foreground transition duration-300 hover:bg-foreground hover:text-background"
7476 >
75- 🌙
77+ ☀️
7678 </button >
7779
7880 <!-- JOIN BUTTON -->
7981 <a
8082 href =" /career"
81- class =" hidden rounded-2xl bg-foreground px-6 py-3 text-lg font-semibold text-background transition hover:bg-cyan-500 hover:text-black lg:block"
83+ class =" hidden rounded-2xl bg-foreground px-6 py-3 text-lg font-semibold text-background transition duration-300 hover:bg-cyan-500 hover:text-black lg:block"
8284 >
8385 Join Us
8486 </a >
@@ -122,13 +124,54 @@ const isActive = (path: string) => {
122124
123125 </div >
124126 </div >
127+
125128</header >
126129
127130<script is:inline >
131+ // MOBILE MENU
128132 const btn = document.getElementById("menuBtn");
129133 const menu = document.getElementById("mobileMenu");
130134
131135 btn?.addEventListener("click", () => {
132136 menu.classList.toggle("hidden");
133137 });
138+
139+ // THEME TOGGLE
140+ const themeToggle = document.getElementById("themeToggle");
141+
142+ // LOAD SAVED THEME
143+ const savedTheme = localStorage.getItem("theme");
144+
145+ if (savedTheme === "dark") {
146+ document.documentElement.classList.add("dark");
147+ } else {
148+ document.documentElement.classList.remove("dark");
149+ }
150+
151+ // UPDATE ICON
152+ const updateThemeIcon = () => {
153+ const isDark = document.documentElement.classList.contains("dark");
154+
155+ if (themeToggle) {
156+ themeToggle.textContent = isDark ? "🌙" : "☀️";
157+ }
158+ };
159+
160+ updateThemeIcon();
161+
162+ // TOGGLE THEME
163+ themeToggle?.addEventListener("click", () => {
164+
165+ document.documentElement.classList.toggle("dark");
166+
167+ const isDark =
168+ document.documentElement.classList.contains("dark");
169+
170+ localStorage.setItem(
171+ "theme",
172+ isDark ? "dark" : "light"
173+ );
174+
175+ updateThemeIcon();
176+ });
134177</script >
0 commit comments