diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8eb8b96 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "chat.tools.terminal.autoApprove": { + "zola": true + } +} \ No newline at end of file diff --git a/sass/_article.scss b/sass/_article.scss index b164bc0..a3fbed9 100644 --- a/sass/_article.scss +++ b/sass/_article.scss @@ -77,3 +77,67 @@ font-family: var(--font-mono); } } + +.post-nav { + display: flex; + flex-direction: column; + align-items: center; + gap: 1.5rem; + margin-top: 3rem; + padding-top: 2rem; + border-top: 1px solid var(--border-color); +} + +.post-nav-link { + display: flex; + flex-direction: column; + gap: 0.35rem; + align-items: center; + text-align: center; + max-width: 34ch; +} + +.post-nav-label { + color: var(--accent-color); + font-size: 0.9rem; + font-weight: 500; +} + +.post-nav-title { + font-size: 1rem; + line-height: 1.35; + color: var(--text-muted); + transition: color 0.2s ease; +} + +.post-nav-link:hover .post-nav-title, +.post-nav-link:hover .post-nav-label { + color: var(--accent-color); +} + +@media (max-width: 640px) { + .post-nav-title { + font-size: 0.95rem; + } +} + +@media (min-width: 900px) { + .post-nav { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 2rem; + align-items: start; + } + + .post-nav-next { + justify-self: start; + align-items: flex-start; + text-align: left; + } + + .post-nav-prev { + justify-self: end; + align-items: flex-end; + text-align: right; + } +} diff --git a/static/js/theme.js b/static/js/theme.js index 04316ee..0d40759 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -1,30 +1,31 @@ document.addEventListener('DOMContentLoaded', () => { const themeToggleBtn = document.getElementById('theme-toggle'); const htmlElement = document.documentElement; + + const applyTheme = (theme) => { + if (theme === 'dark') { + htmlElement.classList.add('dark'); + } else { + htmlElement.classList.remove('dark'); + } + localStorage.setItem('theme', theme); + }; // Check local storage for theme preference const currentTheme = localStorage.getItem('theme'); - if (currentTheme) { - if (currentTheme === 'light') { - htmlElement.classList.remove('dark'); - } + if (currentTheme === 'dark' || currentTheme === 'light') { + applyTheme(currentTheme); } else { // Fallback to system preference const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)'); - if (!prefersDarkScheme.matches) { - htmlElement.classList.remove('dark'); - } + applyTheme(prefersDarkScheme.matches ? 'dark' : 'light'); } // Toggle theme on click if (themeToggleBtn) { themeToggleBtn.addEventListener('click', () => { - htmlElement.classList.toggle('dark'); - let theme = 'light'; - if (htmlElement.classList.contains('dark')) { - theme = 'dark'; - } - localStorage.setItem('theme', theme); + const nextTheme = htmlElement.classList.contains('dark') ? 'light' : 'dark'; + applyTheme(nextTheme); }); } diff --git a/templates/base.html b/templates/base.html index 4c647f3..32afa9b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,10 +1,28 @@ - +