Use spaces, run prettier on project

This commit is contained in:
ZXY101
2023-09-22 11:06:16 +02:00
parent 4731884d2b
commit d20b49a2d3
42 changed files with 1071 additions and 1796 deletions

View File

@@ -1,14 +1,14 @@
<script lang="ts">
import '../app.postcss';
import NavBar from '$lib/components/NavBar.svelte';
import Snackbar from '$lib/components/Snackbar.svelte';
import ConfirmationPopup from '$lib/components/ConfirmationPopup.svelte';
import { settings } from '$lib/settings';
import '../app.postcss';
import NavBar from '$lib/components/NavBar.svelte';
import Snackbar from '$lib/components/Snackbar.svelte';
import ConfirmationPopup from '$lib/components/ConfirmationPopup.svelte';
import { settings } from '$lib/settings';
</script>
<div class=" h-full min-h-[100svh] text-white" style:background-color={$settings.backgroundColor}>
<NavBar />
<Snackbar />
<ConfirmationPopup />
<slot />
<NavBar />
<Snackbar />
<ConfirmationPopup />
<slot />
</div>

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import Catalog from '$lib/components/Catalog.svelte';
import Catalog from '$lib/components/Catalog.svelte';
</script>
<div class="p-2">
<Catalog />
<Catalog />
</div>

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { page } from '$app/stores';
import { page } from '$app/stores';
</script>
<h1>{$page.status}: {$page.error?.message}</h1>

View File

@@ -1,48 +1,48 @@
<script lang="ts">
import { currentManga } from '$lib/catalog';
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
import VolumeItem from '$lib/components/VolumeItem.svelte';
import { Button } from 'flowbite-svelte';
import { db } from '$lib/catalog/db';
import { promptConfirmation } from '$lib/util';
import { currentManga } from '$lib/catalog';
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
import VolumeItem from '$lib/components/VolumeItem.svelte';
import { Button } from 'flowbite-svelte';
import { db } from '$lib/catalog/db';
import { promptConfirmation } from '$lib/util';
const manga = $currentManga?.sort((a, b) => {
if (a.volumeName < b.volumeName) {
return -1;
}
if (a.volumeName > b.volumeName) {
return 1;
}
return 0;
});
const manga = $currentManga?.sort((a, b) => {
if (a.volumeName < b.volumeName) {
return -1;
}
if (a.volumeName > b.volumeName) {
return 1;
}
return 0;
});
onMount(() => {
if (!manga) {
goto('/');
}
});
onMount(() => {
if (!manga) {
goto('/');
}
});
async function confirmDelete() {
const title = manga?.[0].mokuroData.title_uuid;
await db.catalog.delete(title);
goto('/');
}
async function confirmDelete() {
const title = manga?.[0].mokuroData.title_uuid;
await db.catalog.delete(title);
goto('/');
}
function onDelete() {
promptConfirmation('Are you sure you want to delete this manga?', confirmDelete);
}
function onDelete() {
promptConfirmation('Are you sure you want to delete this manga?', confirmDelete);
}
</script>
<div class="p-2 flex flex-col gap-5">
<div class="sm:block flex-col flex">
<Button outline color="red" class="float-right" on:click={onDelete}>Delete manga</Button>
</div>
<div class="flex flex-row gap-5 flex-wrap">
{#if manga}
{#each manga as volume}
<VolumeItem {volume} />
{/each}
{/if}
</div>
<div class="sm:block flex-col flex">
<Button outline color="red" class="float-right" on:click={onDelete}>Delete manga</Button>
</div>
<div class="flex flex-row gap-5 flex-wrap">
{#if manga}
{#each manga as volume}
<VolumeItem {volume} />
{/each}
{/if}
</div>
</div>

View File

@@ -1,21 +1,21 @@
<script lang="ts">
import { currentVolume } from '$lib/catalog';
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { currentVolume } from '$lib/catalog';
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
const volume = $currentVolume;
const volume = $currentVolume;
onMount(() => {
if (!volume) {
goto('/');
}
});
onMount(() => {
if (!volume) {
goto('/');
}
});
</script>
<slot />
<style>
:global(body.reader) {
overflow: hidden !important;
}
:global(body.reader) {
overflow: hidden !important;
}
</style>

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import Reader from '$lib/components/Reader/Reader.svelte';
import Reader from '$lib/components/Reader/Reader.svelte';
</script>
<Reader />

View File

@@ -1,13 +1,13 @@
<script lang="ts">
import Catalog from '$lib/components/Catalog.svelte';
import FileUpload from '$lib/components/FileUpload.svelte';
import { processFiles } from '$lib/upload';
import Catalog from '$lib/components/Catalog.svelte';
import FileUpload from '$lib/components/FileUpload.svelte';
import { processFiles } from '$lib/upload';
let promise: Promise<void>;
let promise: Promise<void>;
async function onUpload(files: FileList) {
promise = processFiles([...files]);
}
async function onUpload(files: FileList) {
promise = processFiles([...files]);
}
</script>
<!-- Note: webkitdirectory is not fully supported and does not work on mobile -->
@@ -15,5 +15,5 @@
<FileUpload {onUpload} accept=".mokuro,.zip,.cbz" multiple>Upload files</FileUpload>
{#await promise}
<h2>Loading...</h2>
<h2>Loading...</h2>
{/await}