diff --git a/templates/gallery.html b/templates/gallery.html index 36892f2..d678a2a 100644 --- a/templates/gallery.html +++ b/templates/gallery.html @@ -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 diff --git a/templates/index.html b/templates/index.html index 58ef2fe..6cb5ca8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -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 >