From 27c82f6f87dec77a7370dc96e2bbb9b841298813 Mon Sep 17 00:00:00 2001 From: yequari Date: Sun, 23 Feb 2025 22:32:53 -0700 Subject: [PATCH] pagination, dark theme toggle --- assets/css/custom.css | 25 ++++++++++++++--- content/now.md | 5 +--- layouts/index.html | 16 +++++------ layouts/links/list.html | 8 +++++- layouts/partials/footer.html | 3 --- layouts/partials/header.html | 15 +++++++++++ themes/desert-breeze/assets/css/main.css | 27 +++++++++++++++++-- themes/desert-breeze/assets/js/main.js | 15 +++++++---- .../desert-breeze/layouts/_default/list.html | 8 +++++- 9 files changed, 95 insertions(+), 27 deletions(-) diff --git a/assets/css/custom.css b/assets/css/custom.css index d1c7b8e..dbda5f4 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -19,13 +19,32 @@ nav#social { header .social { width: 1.3rem; - color: var(--nav-link); } -header .social:hover { - color: var(--nav-link-hover); +header button { + background: var(--main-bg); + color: var(--primary-link); + border: none; + padding: 0; + margin: 0; + margin-bottom: 1rem; +} + +header button:hover { + color: var(--primary-link-hover); + cursor: pointer; + transition: color 0.5s; +} + +header button svg { + width: 1.3rem; } .blurb { font-style: italic; } + +.hidden { + display: none; +} + diff --git a/content/now.md b/content/now.md index add6aac..e9401c8 100644 --- a/content/now.md +++ b/content/now.md @@ -1,10 +1,7 @@ --- title: "Now" -date: 2023-04-17T15:00:46-07:00 +date: 2025-02-23T15:00:46-07:00 --- -# Now - -Updated 2/19/25 One day this page will pull some info from APIs to create a more interesting page but for now I just manually update it as needed. diff --git a/layouts/index.html b/layouts/index.html index 33f5645..7f6799c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -16,6 +16,14 @@
+
+

Site Updates

+
    + {{ range first 3 .Site.Data.siteupdates }} +
  • {{ .date }}: {{ .text }}
  • + {{ end }} +
+

What I'm Up To

    @@ -39,14 +47,6 @@ {{ end }}
-
-

Site Updates

-
    - {{ range .Site.Data.siteupdates }} -
  • {{ .date }}: {{ .text }}
  • - {{ end }} -
-
{{ end }} diff --git a/layouts/links/list.html b/layouts/links/list.html index f632dff..b0b2454 100644 --- a/layouts/links/list.html +++ b/layouts/links/list.html @@ -1,7 +1,10 @@ {{ define "main" }}

{{ .Title }}

{{ .Content }} - {{ range .Pages }} + + {{ range .Paginator.Pages.ByPublishDate.Reverse }} {{ if .Params.context }} {{ $url := urls.Parse .Params.context.url }}

{{ .LinkTitle }}

@@ -12,4 +15,7 @@ {{ .Summary }} {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} {{ end }} + {{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 53f8acc..db3a2ac 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,6 +1,3 @@ -

- -

Site updated . diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 1712e53..314c647 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,3 +1,18 @@

{{ site.Title }}

{{ partial "menu.html" (dict "menuID" "main" "page" .) }} {{ partial "socials.html" . }} + diff --git a/themes/desert-breeze/assets/css/main.css b/themes/desert-breeze/assets/css/main.css index 9a18df6..d02a34a 100644 --- a/themes/desert-breeze/assets/css/main.css +++ b/themes/desert-breeze/assets/css/main.css @@ -1,4 +1,4 @@ -@import url(https://fonts.bunny.net/css?family=share-tech-mono:400); +@import url(https://fonts.bunny.net/css?family=yaldevi:400,600|share-tech-mono:400|tilt-neon:400|unica-one:400); @media (prefers-color-scheme: dark) { :root { @@ -33,6 +33,7 @@ body { margin: 1rem auto; max-width: 900px; background: var(--content-bg); + font-family: 'Yaldevi', sans-serif; font-size: 1.2rem; } @@ -45,11 +46,15 @@ header { flex-flow: row wrap; justify-content: space-between; align-items: baseline; - font-family: 'Share Tech Mono', 'Courier New', Courier, monospace; + font-family: 'Unica One', display; text-transform: lowercase; font-size: 1.3rem; } +h1 { + /* font-family: 'Unica One', display; */ +} + header h1 { display: inline; margin: 0; @@ -83,6 +88,7 @@ footer { border-top: 1px solid var(--accent); margin-top: 1rem; text-align: center; + font-family: 'Unica One', display; } a { @@ -102,6 +108,23 @@ figure { max-width: 100%; } +pre { + overflow-x: scroll; +} + +code { + font-family: 'Share Tech Mono', monospace; +} + +.pagination { + text-align: center; +} + +.pagination li { + display: inline-block; + padding: 0 0.3rem; +} + @media only screen and (max-width: 450px) { header h1 { display: block; diff --git a/themes/desert-breeze/assets/js/main.js b/themes/desert-breeze/assets/js/main.js index c6241e5..b79ec53 100644 --- a/themes/desert-breeze/assets/js/main.js +++ b/themes/desert-breeze/assets/js/main.js @@ -18,6 +18,10 @@ const lightMode = { const root = document.querySelector(':root'); const themeToggle = document.getElementById('theme-toggle'); +const lightModeIcon = document.getElementById('icon-light-mode'); +const darkModeIcon = document.getElementById('icon-dark-mode'); + +console.log(lightModeIcon) const applyTheme = (theme) => { root.style.setProperty("--main-bg", theme.mainBg); @@ -30,21 +34,22 @@ const applyTheme = (theme) => { const enableDarkMode = () => { applyTheme(darkMode); + lightModeIcon.className = ''; + darkModeIcon.className = 'hidden'; localStorage.setItem('theme', 'dark'); - themeToggle.innerText = '☀️ Light Theme'; - themeToggle.value = 'Light Mode'; +console.log(lightModeIcon) } const disableDarkMode = () => { applyTheme(lightMode); + lightModeIcon.className = 'hidden'; + darkModeIcon.className = ''; localStorage.setItem('theme', 'light'); - themeToggle.innerText = '🌙 Dark Theme'; - themeToggle.value = 'Dark Mode'; +console.log(lightModeIcon) } const detectTheme = () => { let theme = 'light'; - let themeObj = lightMode; if (localStorage.getItem('theme')) { theme = localStorage.getItem('theme'); diff --git a/themes/desert-breeze/layouts/_default/list.html b/themes/desert-breeze/layouts/_default/list.html index 50fc92d..41bbdd2 100644 --- a/themes/desert-breeze/layouts/_default/list.html +++ b/themes/desert-breeze/layouts/_default/list.html @@ -1,8 +1,14 @@ {{ define "main" }}

{{ .Title }}

{{ .Content }} - {{ range .Pages }} + + {{ range .Paginator.Pages.ByPublishDate.Reverse }}

{{ .LinkTitle }}

{{ .Summary }} {{ end }} + {{ end }}