feat: show one page, nav buttons, cache pages
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
<h1>It's reader page</h1>
|
||||
<div class="flex flex-col items-center">
|
||||
@for (page of pages; track $index) {
|
||||
<img [src]="page.url" [alt]="page.slug" />
|
||||
@if(pages.length > 0){
|
||||
<img [src]="cachedPages[currentPageIndex].url" [alt]="cachedPages[currentPageIndex].slug" />
|
||||
<div class="flex items-center justify-center space-x-4 mb-10">
|
||||
<button (click)="prevPage()" [disabled]="currentPageIndex === 0" class="p-3 text-white bg-slate-600 w-[100px] mt-5 rounded-lg">←</button>
|
||||
<p>{{pages[currentPageIndex].slug}} / {{pages.length}}</p>
|
||||
<button (click)="nextPage()" [disabled]="currentPageIndex === pages.length - 1" class="p-3 text-white bg-slate-600 w-[100px] mt-5 rounded-lg">→</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user