Skip to content

Commit f5a6dd0

Browse files
Added the dark theme button and fixed social hover
1 parent 3970d4b commit f5a6dd0

2 files changed

Lines changed: 40 additions & 19 deletions

File tree

web-app/css/styles.css

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,35 @@ body.sidebar-active .sidebar-dock {
587587
transition: all var(--duration-fast) ease-in;
588588
}
589589

590+
.fixed-theme-toggle {
591+
position: fixed;
592+
top: 18px;
593+
left: 18px;
594+
z-index: 1101;
595+
width: 44px;
596+
height: 44px;
597+
border-radius: 14px;
598+
box-shadow: var(--shadow-sm);
599+
backdrop-filter: blur(18px);
600+
-webkit-backdrop-filter: blur(18px);
601+
}
602+
603+
.fixed-theme-toggle:hover {
604+
background: var(--accent-soft);
605+
color: var(--accent);
606+
border-color: var(--border-accent);
607+
transform: translateY(-1px);
608+
}
609+
610+
@media (max-width: 900px) {
611+
.fixed-theme-toggle {
612+
top: 14px;
613+
left: 14px;
614+
width: 42px;
615+
height: 42px;
616+
}
617+
}
618+
590619
.sound-toggle:hover,
591620
.theme-toggle:hover {
592621
background: var(--accent-soft);
@@ -3024,13 +3053,6 @@ body.sidebar-active .sidebar-dock {
30243053
text-decoration: none;
30253054
}
30263055

3027-
.footer-social-icons a:hover {
3028-
background: var(--accent-soft);
3029-
border-color: var(--border-accent);
3030-
color: var(--accent);
3031-
transform: translateY(-2px);
3032-
}
3033-
30343056
.footer-links h3 {
30353057
font-family: var(--font-sans);
30363058
font-size: 0.85rem;
@@ -3158,8 +3180,8 @@ body.sidebar-active .sidebar-dock {
31583180
background: var(--accent-soft);
31593181
border-color: var(--border-accent);
31603182
color: var(--accent);
3161-
transform: translateY(-4px) scale(1.05);
3162-
box-shadow: 0 10px 20px rgba(34, 197, 94, 0.16);
3183+
transform: translateY(-1px);
3184+
box-shadow: 0 6px 14px rgba(34, 197, 94, 0.14);
31633185
}
31643186

31653187
.footer-social-icons a:hover::before {
@@ -3168,7 +3190,7 @@ body.sidebar-active .sidebar-dock {
31683190
}
31693191

31703192
.footer-social-icons a:active {
3171-
transform: translateY(-1px) scale(0.98);
3193+
transform: translateY(0);
31723194
}
31733195

31743196
.footer-links h3 {
@@ -6361,4 +6383,4 @@ body.sidebar-active .projects-section,
63616383
body.sidebar-collapsed .projects-section {
63626384
padding-left: 0 !important;
63636385
padding-right: 0 !important;
6364-
}
6386+
}

web-app/index.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@
3434
/>
3535
</head>
3636
<body class="sidebar-active">
37+
<button aria-label="Switch theme" class="theme-toggle fixed-theme-toggle" type="button">
38+
<i class="fas fa-moon" aria-hidden="true"></i>
39+
</button>
3740
<!-- Scroll Progress Bar -->
3841
<div id="scrollProgressContainer" aria-label="Page scroll progress">
3942
<div id="scrollProgressBar"></div>
4043
</div>
41-
44+
4245
<a class="skip-link" href="#main-content">Skip to main content</a>
4346

4447
<!-- Cursor Glow -->
@@ -1340,10 +1343,10 @@ <h3>${proj.title}</h3>
13401343
const icon = toggle.querySelector("i");
13411344
if (icon) {
13421345
if (theme === "dark") {
1343-
icon.className = "fas fa-sun";
1346+
icon.className = "fas fa-moon";
13441347
toggle.setAttribute("aria-label", "Switch to light mode");
13451348
} else {
1346-
icon.className = "fas fa-moon";
1349+
icon.className = "fas fa-sun";
13471350
toggle.setAttribute("aria-label", "Switch to dark mode");
13481351
}
13491352
}
@@ -1377,11 +1380,7 @@ <h3>${proj.title}</h3>
13771380

13781381
// Add click listeners to all theme toggles
13791382
themeToggles.forEach((toggle) => {
1380-
// Remove any existing listeners
1381-
const newToggle = toggle.cloneNode(true);
1382-
toggle.parentNode.replaceChild(newToggle, toggle);
1383-
1384-
newToggle.addEventListener("click", function (e) {
1383+
toggle.addEventListener("click", function (e) {
13851384
e.preventDefault();
13861385
const current = html.getAttribute("data-theme");
13871386
const next = current === "light" ? "dark" : "light";

0 commit comments

Comments
 (0)