summaryrefslogtreecommitdiffhomepage
path: root/template.old/base.templ
diff options
context:
space:
mode:
Diffstat (limited to 'template.old/base.templ')
-rw-r--r--template.old/base.templ51
1 files changed, 0 insertions, 51 deletions
diff --git a/template.old/base.templ b/template.old/base.templ
deleted file mode 100644
index dcef2d8..0000000
--- a/template.old/base.templ
+++ /dev/null
@@ -1,51 +0,0 @@
-package template
-
-import "git.thomasvoss.com/euro-cash.eu/lib"
-
-templ Base(body templ.Component) {
- {{ p := ctx.Value("printer").(lib.Printer) }}
- <!DOCTYPE html>
- <html lang={ p.Locale.Bcp }>
- <head>
- <meta charset="UTF-8"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
- <link rel="stylesheet" type="text/css" href="/style.css"/>
- <title>Euro Cash</title>
- <script type="text/javascript">
- const $ = q => document.querySelector(q);
- const $$ = q => document.querySelectorAll(q);
-
- const validate = theme =>
- ["light", "dark"].includes(theme) ? theme : "light";
- const toggle = theme =>
- theme == "light" ? "dark" : "light";
-
- const setTheme = theme => {
- localStorage.setItem("theme", theme);
- $("html").setAttribute("data-theme", theme);
- $(`#nav-icon-theme-${theme}`)
- .style.display = "";
- $(`#nav-icon-theme-${toggle(theme)}`)
- .style.display = "none";
- };
-
- document.addEventListener('DOMContentLoaded', _ => {
- $("#theme-button").onclick = () =>
- setTheme(toggle(validate(localStorage.getItem("theme"))));
- setTheme(validate(localStorage.getItem("theme")));
- });
- </script>
- </head>
- <body>
- @body
- <footer>
- <p>
- <small>
- { p.T("Found a mistake or want to contribute missing information?") }
- <a href="/about">{ p.T("Feel free to contact us!") }</a>
- </small>
- </p>
- </footer>
- </body>
- </html>
-}