From cbaa466191aaf5bf90dedabb92c8f9e30a3fa857 Mon Sep 17 00:00:00 2001 From: icefox Date: Sun, 11 Jan 2026 19:55:28 -0300 Subject: [PATCH] . --- templates/covers.html | 5 +++++ templates/index.html | 4 ++-- templates/pages.html | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 templates/covers.html create mode 100644 templates/pages.html diff --git a/templates/covers.html b/templates/covers.html new file mode 100644 index 0000000..6645ff5 --- /dev/null +++ b/templates/covers.html @@ -0,0 +1,5 @@ +{{range $i, $c := .Covers}} +
+ +
+{{end}} diff --git a/templates/index.html b/templates/index.html index 6cb5ca8..036e785 100644 --- a/templates/index.html +++ b/templates/index.html @@ -12,8 +12,8 @@ x-data="{active: 0, total: {{len .Covers}}, row: 6, chapter: {{.Chapter}}, prefix: '{{.Prefix}}', comics: [{{range $i, $c := .Covers}}{{if $i}},{{end}}{{$c.Comic}}{{end}}]}" @keydown.window.left.prevent="active = Math.max(0, active - 1)" @keydown.window.right.prevent="active = Math.min(total - 1, active + 1)" - @keydown.window.up.prevent="active = Math.max(0, active - row)" - @keydown.window.down.prevent="active = Math.min(total - 1, active + row)" + @keydown.window.up.prevent="active < 7 ? htmx.ajax('GET', prefix + '/' + Math.max(0, chapter - 2), {target: '#app', swap: 'outerHTML'}).then(() => history.replaceState(null, '', prefix + '/' + Math.max(0, chapter - 2))) : active = Math.max(0, active - row)" + @keydown.window.down.prevent="active > 12 ? htmx.ajax('GET', prefix + '/' + chapter, {target: '#app', swap: 'outerHTML'}).then(() => history.replaceState(null, '', prefix + '/' + chapter)) : active = Math.min(total - 1, active + row)" @keydown.window.i.prevent="htmx.ajax('GET', prefix + '/' + chapter, {target: '#app', swap: 'outerHTML'}).then(() => history.replaceState(null, '', prefix + '/' + chapter))" @keydown.window.n.prevent="htmx.ajax('GET', prefix + '/' + Math.max(0, chapter - 2), {target: '#app', swap: 'outerHTML'}).then(() => history.replaceState(null, '', prefix + '/' + Math.max(0, chapter - 2)))" @keydown.window.enter.prevent="window.location.href = '/gallery/' + comics[active]" diff --git a/templates/pages.html b/templates/pages.html new file mode 100644 index 0000000..6cb5ca8 --- /dev/null +++ b/templates/pages.html @@ -0,0 +1,41 @@ + + + + + + Henna + + + + +
+
+ {{range $i, $c := .Covers}} +
+ +
+ {{end}} +
+ + +
+ +