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/assets/js/kudos.js b/assets/js/kudos.js new file mode 100644 index 0000000..7bf55c7 --- /dev/null +++ b/assets/js/kudos.js @@ -0,0 +1,24 @@ +// 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', () => { + cabin.event('kudos') + 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/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/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...", diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 802737d..1d7b9fb 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -40,10 +40,16 @@ {{- $reply = false }} {{- end }} {{- if eq $reply true }} -
- {{- if (eq $reply true) }} - 📧 Reply by email - {{- end }} +
+
+ + Enjoyed this? +
+ {{ $kudos := resources.Get "js/kudos.js" | minify }} + + 📧 Reply by email {{- end }} {{ end }} 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..9e1c13f 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; } @@ -394,3 +403,38 @@ p:has(+ ul) { } } +/* Cabin kudos styling */ +.kudos-container { + display: flex; + align-items: center; +} + +.kudos-button { + background: none; + border: none; + cursor: pointer; + font-size: 1.2rem; + padding: 0; + margin-right: 0.25rem; +} + +.kudos-button:disabled { + cursor: default; +} + +.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