From 05df37bf0623696b5887591aaa23703351bc66eb Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Thu, 5 Mar 2026 22:14:21 +0100 Subject: [PATCH] add info page --- index.js | 8 +++++++- style.css | 4 ++++ ui/box.css | 2 +- ui/info_view.js | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ ui/layout.css | 11 +++++++++-- ui/layout.js | 3 ++- 6 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 ui/info_view.js diff --git a/index.js b/index.js index 262c804..14835b5 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,8 @@ "use strict"; -import Layout from "/ui/layout.js"; import BaseView from "/ui/base_view.js"; +import InfoView from "/ui/info_view.js"; +import Layout from "/ui/layout.js"; m.route.prefix = ""; m.route(document.body, "/", { @@ -18,4 +19,9 @@ m.route(document.body, "/", { ); }, }, + "/info": { + render: function() { + return m(Layout, { backHref: "/" }, m(InfoView)); + } + } }); diff --git a/style.css b/style.css index 05628f5..8f0eeb9 100644 --- a/style.css +++ b/style.css @@ -142,6 +142,10 @@ body { flex-direction: column; } +a { + color: var(--color-accent); +} + h1 { font-size: 2em; margin-top: 0.75em; diff --git a/ui/box.css b/ui/box.css index 14793be..608c917 100644 --- a/ui/box.css +++ b/ui/box.css @@ -1,7 +1,7 @@ .wb-box { padding: 1em; - >* { + &:not(.-no-width)>* { width: 100%; } } \ No newline at end of file diff --git a/ui/info_view.js b/ui/info_view.js new file mode 100644 index 0000000..b3f3cc6 --- /dev/null +++ b/ui/info_view.js @@ -0,0 +1,52 @@ +const GH_PRIV_URL = + "https://docs.github.com/de/site-policy/privacy-policies" + + "/github-general-privacy-statement"; +const REPO_GITEA = "https://git.tfld.dev/tfld/watterblock"; +const REPO_GH = "https://github.com/TeFiLeDo/watterblock"; + +export default class InfoView { + view() { + return m(".wb-box.-no-width", [ + m("h2._positioned-top", "Infos"), + m("p", + "Des is a Webseitn, auf dea du ganz oanfach deine Watta-Spiele ", + "mitschreim kannst. Und hier kannst a paar Infos dazu nachlesn." + ), + m("p", + "Zerst'amal isses so, dass de Datn was du eingibsch nur direkt in ", + "deim Browser gspeichert wern. Beim Aufmachn von da Seitn muas se ", + "aba east vom Serva gladn werdn. Dea is von GitHub, und da findest ", + "eanare ", m("a", { href: GH_PRIV_URL}, "Datnschut-Erklärung"), "." + ), + m("p", + "Den Kod fia de Seitn findest ", + m("a", { href: REPO_GITEA }, "oamal da"), " und weils so schean war a ", + m("a", { href: REPO_GH }, "noamal da"), ". Dea ganze Spaß steht unta", + "da MIT-Lizenz, daher kannst damit sogar fast alles machn was ", + "willst, unta a boa minimale Bedingungen." + ), + m("h3", "Fragn"), + m("ol._unpadded", [ + m("li", { lang: "de-AT" }, [ + m("strong", + "Warum ist diese Webseite in solch seltsamer Schrift verfasst?"), + m("br"), + "Das ist ganz einfach eine schriftliche Annäherung an den ", + m("em", "Tiroler Dialekt"), ", den ich spreche", + ]), + m("li", [ + m("strong", "Wo find i denn die Lizenzn von die verwendetn Sachn?"), + m("br"), + "In da ", m("a", { href: "/README.md" }, "README-Datei"), ", de du ", + "a in scheanara Variante ", m("a", { href: REPO_GITEA }, "da"), " ", + "oda ", m("a", { href: REPO_GH }, "da"), " anschaugn kannst.", + ]), + m("li", [ + m("strong", "Fridattn- oda Kasspressknedlsuppn?"), m("br"), + "Kimmt drauf un. Wenn di Fridattn kloan gnuag gschnittn sen, dass ", + "se ganz aufm Löffl platz habn, dann de. Ansonstn liaba nit.", + ]), + ]), + ]); + } +} diff --git a/ui/layout.css b/ui/layout.css index 994d106..3eaa439 100644 --- a/ui/layout.css +++ b/ui/layout.css @@ -3,11 +3,14 @@ display: flex; align-items: center; + a { + color: inherit; + text-decoration: none; + } + >* { padding: 0.5em 0.25em; font-size: 2em; - color: inherit; - text-decoration: none; margin: 0; &:first-child { @@ -22,6 +25,10 @@ &:last-child { padding-right: 0.5em; } + + &.spacer { + flex-grow: 1; + } } } diff --git a/ui/layout.js b/ui/layout.js index aea5aa8..24a5092 100644 --- a/ui/layout.js +++ b/ui/layout.js @@ -48,7 +48,8 @@ export default class Layout { return m.fragment([ m("header.header._alternate._apply", [ backHref ? m(m.route.Link, { href: backHref }, "←") : null, - m("h1", "Watterblock"), + m("h1.spacer", m(m.route.Link, { href: "/" }, "Watterblock")), + m(m.route.Link, { href: "/info" }, "🛈"), ]), m("main.main", children), ]);