diff --git a/pages/index.vue b/pages/index.vue index cd4b169..98914c2 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -227,4 +227,19 @@ useEventListener("keydown", (event) => { break; } }); + +useEventListener(renditionEl.value, "click", (event) => { + if ('ontouchstart' in window && renditionEl.value) { + const width = renditionEl.value.clientWidth; + const x = event.clientX % width; + const threshold = 0.3; + const side = width * threshold; + + if (x < side) { + prevPage(); + } else if (width - x < side) { + nextPage(); + } + } +});