aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorXe <me@christine.website>2021-12-19 17:54:02 +0000
committerXe <me@christine.website>2021-12-19 17:54:02 +0000
commit66fd857b569007f9e6e1452e2454b8fab46b4840 (patch)
tree396177369c7b32c9dd1886f8aa9227f890b2352f /static
parent540ae4a3a9735d3f55ebceb1d271e472cd7f950e (diff)
downloadxesite-66fd857b569007f9e6e1452e2454b8fab46b4840.tar.xz
xesite-66fd857b569007f9e6e1452e2454b8fab46b4840.zip
fix CSS contrast ratio
Signed-off-by: Xe <me@christine.website>
Diffstat (limited to 'static')
-rw-r--r--static/js/conversation.js4
-rw-r--r--static/js/hnwarn.js38
-rwxr-xr-xstatic/js/sw.js2
3 files changed, 41 insertions, 3 deletions
diff --git a/static/js/conversation.js b/static/js/conversation.js
index bdce9ad..d20865f 100644
--- a/static/js/conversation.js
+++ b/static/js/conversation.js
@@ -1,8 +1,8 @@
import { g, h, x } from "./xeact.min.js";
import { div, span } from "./xeact-html.min.js";
-const mkConversation = (who, mood, message) =>
- h("div", {className: "conversation gruvbox-dark"}, [
+export const mkConversation = (who, mood, message, extraClasses = "") =>
+ h("div", {className: "conversation gruvbox-dark " + extraClasses}, [
h("div", {className: "conversation-picture conversation-smol"}, [
h("picture", {}, [
h("source", {type: "image/avif", srcset: `https://cdn.christine.website/file/christine-static/stickers/${who.toLowerCase()}/${mood}.avif`}),
diff --git a/static/js/hnwarn.js b/static/js/hnwarn.js
new file mode 100644
index 0000000..b2bfeae
--- /dev/null
+++ b/static/js/hnwarn.js
@@ -0,0 +1,38 @@
+import { g, x, r, t } from "./xeact.min.js";
+import { div, ahref, br } from "./xeact-html.min.js";
+import { mkConversation } from "./conversation.js";
+
+const addNag = () => {
+ let root = g("refererNotice");
+ x(root);
+ root.appendChild(
+ div(
+ {style: "padding:1em"},
+ mkConversation("Cadey", "coffee", [
+ t("Thank you for reading this article. If you have any questions or thoughts about its contents, please comment civilly on it and remember the human on the other side of the screen. Due to facts and circumstances surrounding our fundamentally subjective reality, I may experience things differently than you do. If this is somehow unacceptable to you, please feel free to "),
+ ahref("https://zombo.com", "go somewhere else"),
+ t(". Have a good day and be well!")
+ ], "warning"),
+ br(),
+ br()
+ )
+ );
+};
+
+r(() => {
+ switch (document.referrer) {
+ case "https://news.ycombinator.com/":
+ addNag();
+ break;
+ case "https://www.reddit.com/":
+ addNag();
+ break;
+ case "https://old.reddit.com/":
+ addNag();
+ break;
+ case "https://reddit.com/":
+ addNag();
+ break;
+ }
+});
+
diff --git a/static/js/sw.js b/static/js/sw.js
index df5bb0d..72aaad6 100755
--- a/static/js/sw.js
+++ b/static/js/sw.js
@@ -5,7 +5,7 @@ self.addEventListener('install', function (event) {
event.waitUntil(preLoad());
});
-const cacheName = "cache-xesite-2.3.0-3";
+const cacheName = "cache-xesite-2.3.0-4";
var preLoad = function () {
console.log('[PWA Builder] Install Event processing');