From e83d1ea12206ee7a1998e5e54cf1aa39b929efd7 Mon Sep 17 00:00:00 2001 From: John Bowdre <61015723+jbowdre@users.noreply.github.com> Date: Sat, 22 Jun 2024 08:25:15 -0500 Subject: [PATCH 1/5] Update params.toml --- config/_default/params.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/_default/params.toml b/config/_default/params.toml index c5db7e6..3833dba 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -108,6 +108,7 @@ taglines = [ "long division took too long", "may the code be with you", "mess with the test, fail like the rest", + "miscellaneous bug fixes and improvements", "need input", "no such file or directory", "now where did i leave my null pointer...", From dc3f6bb355733ea9a56ce0246058d4beefb6d8c0 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Mon, 24 Jun 2024 16:26:57 -0500 Subject: [PATCH 2/5] license updates --- LICENSE | 6 ++++++ config/_default/hugo.toml | 1 - layouts/partials/footer.html | 6 +++--- layouts/partials/head.html | 3 +++ static/css/custom.css | 19 ++++++++++++++----- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/LICENSE b/LICENSE index acb051e..8fb0293 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,9 @@ +The MIT License applies to the code in this repository. + +Post content in the Markdown files is separately licensed under CC BY-NC-SA 4.0. + +* * * + MIT License Copyright (c) 2023 John Bowdre diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 603ce6f..fd7e7f1 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -1,7 +1,6 @@ baseURL = "https://runtimeterror.dev" theme = "risotto" title = "runtimeterror" -copyright = "© 2024 John Bowdre" paginate = 10 languageCode = "en" DefaultContentLanguage = "en" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 9586c47..b34f843 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,6 +1,6 @@ - - +{"/slashes": [{{- range $i, $link := .Site.Params.slashPages }}{{ if $i }}, {{ end }}"{{ $link.title }}"{{ end }}]} +
{"copyright": ["content": "CC BY-NC-SA 4.0", "code": "MIT"]} +
<view source> {{ $jsToTop := resources.Get "js/back-to-top.js" | minify }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 3aea004..027c4f3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -34,6 +34,9 @@ + + + diff --git a/static/css/custom.css b/static/css/custom.css index b347497..d037e3f 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -38,23 +38,32 @@ } /* Footer tweaks */ -.copyright { +.footer_slashes { font-size: 14px; - line-height: 1.3rem; + line-height: 1.1rem; + color: var(--muted); } -.footer_links { +.footer_slashes a:link, .footer_slashes a:visited { + color: var(--link); + text-decoration: none; +} + +.footer_links, .copyright { font-size: 12px; line-height: 1.1rem; color: var(--muted); } -.footer_links a:link, .footer_links a:visited { +.footer_links a:link, .footer_links a:visited, +.copyright a:link, .copyright a:visited{ color: var(--off-fg); text-decoration: none; } -.footer_links a:hover { +.footer_links a:hover, +.footer_slashes a:hover, +.copyright a:hover { color: var(--hover); text-decoration: underline; } From 0332cbaab4bc6bbceff71492d66ee3cb758fba3a Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Mon, 24 Jun 2024 16:41:19 -0500 Subject: [PATCH 3/5] add kudos button for cabin event tracking --- layouts/_default/single.html | 7 +++---- static/css/custom.css | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 802737d..09f93ce 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -40,10 +40,9 @@ {{- $reply = false }} {{- end }} {{- if eq $reply true }} -
- {{- if (eq $reply true) }} - 📧 Reply by email - {{- end }} +
+ Enjoyed this? + 📧 Reply by email {{- end }}
{{ end }} diff --git a/static/css/custom.css b/static/css/custom.css index d037e3f..dde813d 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -403,3 +403,27 @@ p:has(+ ul) { } } +/* Cabin kudos styling */ +.post_kudos { + display: flex; +} + +button.kudos { + border: 0; + background-color: transparent; + cursor: pointer; + display: flex; + color: var(--off-fg); + font-size: 1.2rem; + padding: 0; + transition: all .2s ease-in-out; +} + +button.kudos:hover { + transform: scale(1.1); + text-shadow: var(-off-bg) 0 0 1px; +} + +button.kudos:active { + transform: scale(0.9); +} \ No newline at end of file From f2feafa49bbc581f08a4be67df66bb1003031c1e Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Mon, 24 Jun 2024 19:30:57 -0500 Subject: [PATCH 4/5] disable kudos button after click --- assets/js/kudos.js | 23 +++++++++++++++++++++++ layouts/_default/single.html | 9 ++++++++- static/css/custom.css | 35 +++++++++++++++++++++++------------ 3 files changed, 54 insertions(+), 13 deletions(-) create mode 100644 assets/js/kudos.js diff --git a/assets/js/kudos.js b/assets/js/kudos.js new file mode 100644 index 0000000..c904501 --- /dev/null +++ b/assets/js/kudos.js @@ -0,0 +1,23 @@ +// disables kudos button after click + +document.addEventListener('DOMContentLoaded', () => { + const kudosButton = document.querySelector('.kudos-button'); + const kudosText = document.querySelector('.kudos-text'); + const emojiSpan = kudosButton.querySelector('.emoji'); + + kudosButton.addEventListener('click', () => { + kudosButton.disabled = true; + kudosButton.classList.add('clicked'); + + kudosText.textContent = 'Thanks!'; + kudosText.classList.add('thanks'); + + // Rotate the emoji + emojiSpan.style.transform = 'rotate(360deg)'; + + // Change the emoji after rotation + setTimeout(() => { + emojiSpan.textContent = '🎉'; + }, 150); // Half of the transition time for a smooth mid-rotation change + }); +}); \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 09f93ce..5f288f0 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -41,7 +41,14 @@ {{- end }} {{- if eq $reply true }}
- Enjoyed this? +
+ + Enjoyed this? +
+ {{ $kudos := resources.Get "js/kudos.js" | minify }} + 📧 Reply by email {{- end }}
diff --git a/static/css/custom.css b/static/css/custom.css index dde813d..9e1c13f 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -404,26 +404,37 @@ p:has(+ ul) { } /* Cabin kudos styling */ -.post_kudos { +.kudos-container { display: flex; + align-items: center; } -button.kudos { - border: 0; - background-color: transparent; +.kudos-button { + background: none; + border: none; cursor: pointer; - display: flex; - color: var(--off-fg); font-size: 1.2rem; padding: 0; - transition: all .2s ease-in-out; + margin-right: 0.25rem; } -button.kudos:hover { - transform: scale(1.1); - text-shadow: var(-off-bg) 0 0 1px; +.kudos-button:disabled { + cursor: default; } -button.kudos:active { - transform: scale(0.9); +.kudos-button .emoji { + display: inline-block; + transition: transform 0.3s ease; +} + +.kudos-button.clicked .emoji { + transform: rotate(360deg); +} + +.kudos-text { + transition: font-style 0.3s ease; +} + +.kudos-text.thanks { + font-style: italic; } \ No newline at end of file From 751eb9b03ce7db6eb31337b78e3da9aed9f4c2d5 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Mon, 24 Jun 2024 20:56:55 -0500 Subject: [PATCH 5/5] use js for cabin event ping --- assets/js/kudos.js | 1 + layouts/_default/single.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/kudos.js b/assets/js/kudos.js index c904501..7bf55c7 100644 --- a/assets/js/kudos.js +++ b/assets/js/kudos.js @@ -6,6 +6,7 @@ document.addEventListener('DOMContentLoaded', () => { const emojiSpan = kudosButton.querySelector('.emoji'); kudosButton.addEventListener('click', () => { + cabin.event('kudos') kudosButton.disabled = true; kudosButton.classList.add('clicked'); diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 5f288f0..1d7b9fb 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -42,7 +42,7 @@ {{- if eq $reply true }}
- Enjoyed this?