diff --git a/assets/main.js b/assets/main.js index ec58190..3495784 100644 --- a/assets/main.js +++ b/assets/main.js @@ -51,3 +51,21 @@ function applyFilters() { gridEl.innerHTML = '
Failed to load projects list.
'; } })(); + + + const themeToggle = document.getElementById('themeToggle'); + const body = document.body; + + + const currentTheme = localStorage.getItem('theme') || 'light'; + if (currentTheme === 'dark') { + body.classList.add('dark-mode'); + } + + themeToggle.addEventListener('click', () => { + body.classList.toggle('dark-mode'); + + + const theme = body.classList.contains('dark-mode') ? 'dark' : 'light'; + localStorage.setItem('theme', theme); + }); \ No newline at end of file diff --git a/assets/styles.css b/assets/styles.css index 37bf87e..83855f0 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -7,6 +7,30 @@ --accent-2: #93c5fd } + +body:not(.dark-mode) { + --bg: #f8f9fa; + --card: #ffffff; + --text: #1a1a1a; + --muted: #6b7280; + --bg-gradient-start: #f0f4f8; + --bg-gradient-end: #e2e8f0; + --border: #e5e7eb; + --input-bg: #ffffff; +} + + +body.dark-mode { + --bg: #0f0f12; + --card: #17171c; + --text: #eef1f8; + --muted: #a6adbb; + --bg-gradient-start: #0b0b0e; + --bg-gradient-end: #121217; + --border: #262631; + --input-bg: #0e0e13; +} + * { box-sizing: border-box } @@ -19,13 +43,15 @@ body { body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; - background: linear-gradient(180deg, #0b0b0e, #121217); - color: var(--text) + background: linear-gradient(180deg, var(--bg-gradient-start, #0b0b0e), var(--bg-gradient-end, #121217)); + color: var(--text); + transition: background 0.3s ease, color 0.3s ease; } .site-header { padding: 2rem 1rem; - text-align: center + text-align: center; + position: relative; } .site-header h1 { @@ -42,16 +68,69 @@ body { display: flex; gap: .5rem; justify-content: center; - flex-wrap: wrap + flex-wrap: wrap; + align-items: center; } .controls input, .controls select { padding: .5rem .75rem; border-radius: .5rem; - border: 1px solid #2a2a33; - background: #0e0e13; - color: var(--text) + border: 1px solid var(--border, #2a2a33); + background: var(--input-bg, #0e0e13); + color: var(--text); + transition: background 0.3s ease, border-color 0.3s ease; +} + + +.theme-toggle { + background: var(--card); + border: 2px solid var(--border, #262631); + border-radius: 50%; + width: 50px; + height: 50px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.3s ease; + position: fixed; + top: 1rem; + right: 1rem; + z-index: 1000; + color: var(--text); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); +} + +.theme-toggle:hover { + transform: rotate(15deg) scale(1.1); + border-color: var(--accent); + box-shadow: 0 6px 16px rgba(110, 231, 183, 0.2); +} + +.theme-toggle svg { + position: absolute; + transition: all 0.3s ease; +} + +.theme-toggle .sun-icon { + opacity: 0; + transform: rotate(90deg); +} + +.theme-toggle .moon-icon { + opacity: 1; + transform: rotate(0deg); +} + +body:not(.dark-mode) .theme-toggle .sun-icon { + opacity: 1; + transform: rotate(0deg); +} + +body:not(.dark-mode) .theme-toggle .moon-icon { + opacity: 0; + transform: rotate(-90deg); } .project-grid { @@ -65,10 +144,11 @@ body { .card { background: var(--card); - border: 1px solid #262631; + border: 1px solid var(--border, #262631); border-radius: .75rem; padding: 1rem; - box-shadow: 0 0 0 1px rgba(255, 255, 255, .02) inset + box-shadow: 0 0 0 1px rgba(255, 255, 255, .02) inset; + transition: background 0.3s ease, border-color 0.3s ease; } .card h3 { @@ -110,5 +190,15 @@ body { padding: 2rem 1rem; text-align: center; color: var(--muted); - border-top: 1px solid #22222b + border-top: 1px solid var(--border, #22222b); + transition: border-color 0.3s ease; +} + +.site-footer a { + color: var(--accent); + text-decoration: none; +} + +.site-footer a:hover { + text-decoration: underline; } \ No newline at end of file diff --git a/index.html b/index.html index 61bc368..1722838 100644 --- a/index.html +++ b/index.html @@ -21,6 +21,22 @@