feat: manhwa scroll and cache pages rework

This commit is contained in:
2024-07-17 23:46:33 +03:00
parent 0fea62b639
commit 4105933098
6 changed files with 106 additions and 183 deletions

View File

@@ -11,17 +11,21 @@
<h3>{{ currentChapterInfo?.number }}. {{ currentChapterInfo?.name || "Нет названия" }}</h3>
</div>
<div class="flex flex-col items-center">
@if (pages.length > 0 && cachedPages.get(currentPageIndex)) {
@if (pages.length > 0 && currentPage) {
<div [class]="imageContainerClass">
@if (!isManhwa) {
<app-scale-image [imageSrc]="imageUrl"></app-scale-image>
<app-scale-image [imageSrc]="currentPage.imageUrl"></app-scale-image>
} @else {
@for (page of manhwaPages; track page.id) {
<app-scale-image [imageSrc]="page.imageUrl"></app-scale-image>
<app-scale-image
[imageSrc]="page.imageUrl"
[host]="host"
(view)="loadPage(page.index)"
[hostScrollable]="isHostScrollable()"
></app-scale-image>
}
}
</div>
<div #anchor></div>
<div class="flex items-center justify-center space-x-4 my-10">
<button (click)="prevPage()" class="p-3 text-white bg-slate-600 w-[100px] rounded-lg">