From 6bc3ca7032c78c77a6e2b316789938221d686d8b Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Wed, 19 Feb 2025 15:39:48 +0100 Subject: frontend: Implement a better page indicator This replaces the very simplistic x/y page indicator with a visual bar at the bottom of the reader that allows the user quick access to any arbitrary page. At the margins it shows the current page number(s) and the total amount of pages. --- frontend/src/lib/reader/PageView.svelte | 60 ++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 9 deletions(-) (limited to 'frontend/src/lib/reader/PageView.svelte') diff --git a/frontend/src/lib/reader/PageView.svelte b/frontend/src/lib/reader/PageView.svelte index 2f8def7..50c0873 100644 --- a/frontend/src/lib/reader/PageView.svelte +++ b/frontend/src/lib/reader/PageView.svelte @@ -1,10 +1,11 @@ -{:else if direction === Direction.LeftToRight} - - -{:else} +{:else if reverse} +{:else} + + {/if} -
- + +{#snippet pagesIn(chunk: Chunk)} + {#if chunk.secondary} + {chunk.index + 1} - {chunk.index + 2} + {:else} + {chunk.index + 1} + {/if} +{/snippet} + +
+
+ + {@render pagesIn(currentChunk)} + +
+ {#each chunks as chunk, index} + + {/each} +
+ + {reader.pages.length} + +
+ + + -- cgit v1.2.3-2-gb3c3