Chore: Port over SeriesDetail (WIP Panels)

This commit is contained in:
Youwes09
2026-05-28 23:05:02 -05:00
parent 584b917f98
commit 8c250021a0
53 changed files with 4570 additions and 885 deletions
+19 -19
View File
@@ -1,44 +1,44 @@
import type { Manga, Chapter } from '$lib/types'
import type { Page } from '$lib/server-adapters/types'
import type { Manga, Chapter } from "$lib/types";
import type { Page } from "$lib/server-adapters/types";
export type ReadMode = 'single' | 'strip'
export type FitMode = 'width' | 'height' | 'original'
export type ReadDirection = 'ltr' | 'rtl'
export type ReadMode = "single" | "strip";
export type FitMode = "width" | "height" | "original";
export type ReadDirection = "ltr" | "rtl";
export const readerState = $state({
manga: null as Manga | null,
manga: null as Manga | null,
chapter: null as Chapter | null,
chapters: [] as Chapter[],
pages: [] as Page[],
pages: [] as Page[],
pagesLoading: false,
pagesError: null as string | null,
pagesError: null as string | null,
currentPage: 0,
mode: 'single' as ReadMode,
fit: 'width' as FitMode,
direction: 'ltr' as ReadDirection,
zoom: 1,
currentPage: 0,
mode: "single" as ReadMode,
fit: "width" as FitMode,
direction: "ltr" as ReadDirection,
zoom: 1,
showControls: false,
showSettings: false,
fullscreen: false,
})
fullscreen: false,
});
export function currentPageData() {
return readerState.pages[readerState.currentPage] ?? null
return readerState.pages[readerState.currentPage] ?? null;
}
export function progress() {
return readerState.pages.length > 0
? (readerState.currentPage + 1) / readerState.pages.length
: 0
: 0;
}
export function hasPrev() {
return readerState.currentPage > 0
return readerState.currentPage > 0;
}
export function hasNext() {
return readerState.currentPage < readerState.pages.length - 1
return readerState.currentPage < readerState.pages.length - 1;
}