diff --git a/src/lib/components/Catalog.svelte b/src/lib/components/Catalog.svelte index 5806af5..05e09d4 100644 --- a/src/lib/components/Catalog.svelte +++ b/src/lib/components/Catalog.svelte @@ -1,17 +1,78 @@ {#if $catalog} {#if $catalog.length > 0}
-
- {#each $catalog as { id } (id)} - - {/each} +
+ + +
+ {#if search && sortedCatalog.length === 0} +
+

No results found.

+
+ {:else} +
+ {#if $miscSettings.galleryLayout === 'grid'} + {#each sortedCatalog as { id } (id)} + + {/each} + {:else} + + {#each sortedCatalog as { id } (id)} + + {/each} + + {/if} +
+ {/if}
{:else}
diff --git a/src/lib/components/CatalogListItem.svelte b/src/lib/components/CatalogListItem.svelte new file mode 100644 index 0000000..967d5c8 --- /dev/null +++ b/src/lib/components/CatalogListItem.svelte @@ -0,0 +1,25 @@ + + +{#if manga} +
+ + +
+

{manga.mokuroData.title}

+ img +
+
+
+
+{/if} diff --git a/src/lib/components/VolumeItem.svelte b/src/lib/components/VolumeItem.svelte index 02065a0..69d7b3d 100644 --- a/src/lib/components/VolumeItem.svelte +++ b/src/lib/components/VolumeItem.svelte @@ -1,5 +1,4 @@ - +
(stored ? JSON.parse(stored) : defaultSettings); + +miscSettings.subscribe((miscSettings) => { + if (browser) { + window.localStorage.setItem('miscSettings', JSON.stringify(miscSettings)); + } +}); + +export function updateMiscSetting(key: MiscSettingsKey, value: any) { + miscSettings.update((miscSettings) => { + return { + ...miscSettings, + [key]: value + }; + }); +} \ No newline at end of file diff --git a/src/lib/settings/settings.ts b/src/lib/settings/settings.ts index f8a22f2..b735e1a 100644 --- a/src/lib/settings/settings.ts +++ b/src/lib/settings/settings.ts @@ -1,5 +1,4 @@ import { browser } from '$app/environment'; -import { zoomDefault } from '$lib/panzoom'; import { derived, get, writable } from 'svelte/store'; export type FontSize = diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 9ca74ec..a282226 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,6 +1,5 @@ diff --git a/src/routes/[manga]/+page.svelte b/src/routes/[manga]/+page.svelte index 33d2996..ab9d0a1 100644 --- a/src/routes/[manga]/+page.svelte +++ b/src/routes/[manga]/+page.svelte @@ -2,7 +2,7 @@ import { catalog } from '$lib/catalog'; import { goto } from '$app/navigation'; import VolumeItem from '$lib/components/VolumeItem.svelte'; - import { Button, Listgroup, Progressbar, Spinner } from 'flowbite-svelte'; + import { Button, Listgroup } from 'flowbite-svelte'; import { db } from '$lib/catalog/db'; import { promptConfirmation, zipManga } from '$lib/util'; import { page } from '$app/stores'; @@ -77,7 +77,7 @@

Minutes read: {stats.timeReadInMinutes}

-
+