diff --git a/docs/adr/0001-tipjar-support-button.md b/docs/adr/0001-tipjar-support-button.md new file mode 100644 index 0000000..828909a --- /dev/null +++ b/docs/adr/0001-tipjar-support-button.md @@ -0,0 +1,30 @@ +--- +public: false +--- + +# 0001: A floating tipjar button complements the footer's Ko-fi link + +- **Status:** Accepted +- **Date:** 2026-11-07 +- **PR:** (this PR) + +## Context + +The landing page's only support link was the footer's "☕ Support future projects" (Ko-fi), which most +visitors never scroll to. Matt's own `tipjar` package (npm, MIT, zero dependencies) draws a floating support +button. Options: replace the footer line with the button, add the button and keep the line, or leave it. +The site's CSP is `script-src 'self'` and the site self-hosts everything it loads. + +## Decision + +We add the tipjar button to the landing page and keep the footer line. Both go to https://ko-fi.com/mtblck, +and the button tucks itself away (`hideWhenVisible: 'footer'`) while the footer is on screen, so only one +shows at a time. `tools/site.mjs` copies `tipjar/dist/*.js` and `style.css` from node_modules into +`dist/site/tipjar/`, and `site/tip.js` (a module file) mounts it, so no CDN and no CSP change. It takes the +page's cobalt via `--tipjar-*` in `site.css`, so it follows `data-theme`. The docs pages don't get it: they +are for reading, and their footer has no support link to hand over to. + +## Consequences + +Upgrading the button is a `tipjar` version bump in package.json. Clicks are not counted: a new event name +would need adding to Boards' events list first. Revisit if the button crowds the playground on phones. diff --git a/package-lock.json b/package-lock.json index ce5ebd0..40ca8ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "@fontsource-variable/bricolage-grotesque": "^5.3.0", "@fontsource-variable/jetbrains-mono": "^5.3.0", "marked": "^16.4.2", - "playwright": "1.64.1" + "playwright": "1.64.1", + "tipjar": "^1.2.0" }, "engines": { "node": ">=22" @@ -77,6 +78,19 @@ "engines": { "node": ">=20" } + }, + "node_modules/tipjar": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tipjar/-/tipjar-1.2.0.tgz", + "integrity": "sha512-5M/yHG9WEUcxahX9uNiKh84AoyaMzdjLMaSDOTorLBdnR8rr400W66m7oT5OlXwqM4Y9CLq7GiG9IE2jYbhQEA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22" + }, + "funding": { + "url": "https://ko-fi.com/mtblck" + } } } } diff --git a/package.json b/package.json index b3e23fe..3c3f376 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@fontsource-variable/bricolage-grotesque": "^5.3.0", "@fontsource-variable/jetbrains-mono": "^5.3.0", "marked": "^16.4.2", - "playwright": "1.64.1" + "playwright": "1.64.1", + "tipjar": "^1.2.0" } } diff --git a/site/index.html b/site/index.html index bb533a4..73396bb 100644 --- a/site/index.html +++ b/site/index.html @@ -15,6 +15,7 @@ +
@@ -258,5 +259,6 @@