Chore: Restructure Repository for SvelteKit

This commit is contained in:
Youwes09
2026-05-22 04:04:59 -05:00
parent bf071dcfc7
commit 8cef74bb98
266 changed files with 5093 additions and 396 deletions
+41
View File
@@ -0,0 +1,41 @@
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 const readerState = $state({
manga: null as Manga | null,
chapter: null as Chapter | null,
chapters: [] as Chapter[],
pages: [] as Page[],
pagesLoading: false,
pagesError: null as string | null,
currentPage: 0,
mode: 'single' as ReadMode,
fit: 'width' as FitMode,
direction: 'ltr' as ReadDirection,
zoom: 1,
showControls: false,
showSettings: false,
fullscreen: false,
})
export const currentPageData = $derived(
readerState.pages[readerState.currentPage] ?? null
)
export const progress = $derived(
readerState.pages.length > 0
? (readerState.currentPage + 1) / readerState.pages.length
: 0
)
export const hasPrev = $derived(readerState.currentPage > 0)
export const hasNext = $derived(
readerState.currentPage < readerState.pages.length - 1
)