diff --git a/frontend/src/lib/components/reader/epub-reader.svelte b/frontend/src/lib/components/reader/epub-reader.svelte index 84a630a..f197745 100644 --- a/frontend/src/lib/components/reader/epub-reader.svelte +++ b/frontend/src/lib/components/reader/epub-reader.svelte @@ -1,272 +1,311 @@ - - + + + Chapters + - Chapters - {#each chapters as chapter} + {#each chapters as chapter (chapter.href)} {#if chapter.subitems.length > 0} - await navigateToChapter(chapter)} - > + navigateToChapter(chapter)}> {chapter.label} - {#each chapter.subitems as subchapter} + {#each chapter.subitems as subchapter (subchapter.href)} await navigateToChapter(subchapter)} + onclick={() => navigateToChapter(subchapter)} > - {subchapter.label} + + {subchapter.label} + {/each} @@ -275,10 +314,7 @@ {:else} - await navigateToChapter(chapter)} - > + navigateToChapter(chapter)}> {chapter.label} @@ -286,68 +322,119 @@ {/each} - - - - {#if browser} - {#if !isReaderVisible} - - - + + + + + + + (isSidebarOpen = !isSidebarOpen)} + disabled={!isReaderVisible} + > + + + Chapters + + + + + {title || 'Reader'} + + + {#if isReaderVisible} + + + + + {percent}% + {/if} - - - - + + - - - - + {#if loadError} + + + + + This book wouldn't open + {loadError} + + + + Try again + + + Back to book + + + {:else if !isReaderVisible} + + + Opening… + {/if} + + + + + + + + + + + + +
Chapters
{loadError}