From 649a8b3dd193c48262c045e78923fc8cb8cc52c2 Mon Sep 17 00:00:00 2001 From: nate smith Date: Sun, 17 Mar 2024 11:24:39 -0700 Subject: [PATCH] add about --- assets/main.js | 21 +++++++++++++++++++++ templates/index.tmpl | 11 ++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/assets/main.js b/assets/main.js index d475e3c..5215873 100644 --- a/assets/main.js +++ b/assets/main.js @@ -250,6 +250,26 @@ class SourceText extends HTMLDivElement { } } +class AboutToggler extends HTMLAnchorElement { + constructor() { + super(); + this.hide = true; + this.style.cursor = "pointer"; + } + + connectedCallback() { + this.innerText = "about"; + this.addEventListener("click", (e) => { + if (this.hide) { + $("#about").style.display = "block"; + } else { + $("#about").style.display = "none"; + } + this.hide = !this.hide; + }); + } +} + class ThemeToggler extends HTMLAnchorElement { constructor() { super(); @@ -385,6 +405,7 @@ class PoemSaver extends HTMLFormElement { const reorder = new CustomEvent("reorder", {bubbles: true}); const edited = new CustomEvent("edited", {bubbles: true}); +customElements.define("about-toggler", AboutToggler, { extends: "a" }); customElements.define("poem-saver", PoemSaver, { extends: "form" }); customElements.define("theme-toggler", ThemeToggler, { extends: "a" }); customElements.define("source-text", SourceText, { extends: "div" }); diff --git a/templates/index.tmpl b/templates/index.tmpl index 44d98e9..92159a3 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -24,6 +24,12 @@ body { padding: 5px } +#about { + background-color: grey; + display: none; + color: black; +} + h1 { background-color: black; } @@ -112,9 +118,12 @@ a {

Trunkless

- about +

+

+ HELLO. THIS IS A SOFT WARE FOR MAKING CUT-UP POETRY. THERE ARE 467,014,991 POSSIBLE LINES YOU MAY SEE. ALL OF THE LINES ARE FROM THE ENGLISH CORPUS OF PROJECT GUTERNBERG. SOME MAY BE OBJECTIONABLE AND I'M SORRY. THE AUTHOR OF THIS SOFT WARE IS ~VILMIBM. +