This commit is contained in:
icefox 2025-12-26 13:46:46 -03:00
parent b4bbe2a7c6
commit cbeb5d8e4c
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View file

@ -74,6 +74,8 @@
}"
@keydown.window.left.prevent="current = Math.max(0, current - 1)"
@keydown.window.right.prevent="current = Math.min(urls.length - 1, current + 1)"
@keydown.window.up.prevent="current = Math.max(0, current - 5)"
@keydown.window.down.prevent="current = Math.min(urls.length - 1, current + 5)"
@keydown.window.k.prevent="swap()"
@keydown.window.backspace.prevent="history.back()"
autofocus

View file

@ -14,10 +14,10 @@
@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.i.prevent="htmx.ajax('GET', prefix + '/' + chapter, {target: '#app', swap: 'outerHTML'})"
@keydown.window.n.prevent="htmx.ajax('GET', prefix + '/' + Math.max(0, chapter - 2), {target: '#app', swap: 'outerHTML'})"
@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]"
@wheel.window.prevent="$event.deltaY > 0 ? htmx.ajax('GET', prefix + '/' + chapter, {target: '#app', swap: 'outerHTML'}) : htmx.ajax('GET', prefix + '/' + Math.max(0, chapter - 2), {target: '#app', swap: 'outerHTML'})"
@wheel.window.prevent="$event.deltaY > 0 ? htmx.ajax('GET', prefix + '/' + chapter, {target: '#app', swap: 'outerHTML'}).then(() => history.replaceState(null, '', prefix + '/' + chapter)) : htmx.ajax('GET', prefix + '/' + Math.max(0, chapter - 2), {target: '#app', swap: 'outerHTML'}).then(() => history.replaceState(null, '', prefix + '/' + Math.max(0, chapter - 2)))"
autofocus
>
<div>