Cleanup and testing

This commit is contained in:
ZXY101
2023-09-04 13:53:51 +02:00
parent 83b427f976
commit 695c63c06b
13 changed files with 34 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
$background-color: #1b1b20; $background-color: #0d0d0f;
$primary-color: #2e3042; $primary-color: #2e3042;
$primary-accent-color: #263447; $primary-accent-color: #263447;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

View File

@@ -0,0 +1,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg width="64px" height="64px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -3,19 +3,33 @@
import CatalogItem from './CatalogItem.svelte'; import CatalogItem from './CatalogItem.svelte';
</script> </script>
<div> {#if $catalog && $catalog.length > 0}
{#if $catalog} <div class="container">
{#each $catalog as { manga }} {#each $catalog as { manga }}
<CatalogItem {manga} /> <CatalogItem {manga} />
{/each} {/each}
{/if}
</div> </div>
{:else}
<div class="empty-state">
<p>Your catalog is currently empty.</p>
<a href="upload">Add manga</a>
</div>
{/if}
<style> <style lang="scss">
div { .container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 20px; gap: 20px;
flex-wrap: wrap; flex-wrap: wrap;
} }
.empty-state {
text-align: center;
padding: 20px;
}
a {
color: $secondary-accent-color;
}
</style> </style>

View File

@@ -7,6 +7,7 @@
import { page } from '$app/stores'; import { page } from '$app/stores';
import { currentManga, currentVolume } from '$lib/catalog'; import { currentManga, currentVolume } from '$lib/catalog';
import SettingsIcon from '$lib/assets/svgs/settings-svgrepo-com.svg';
import { writable } from 'svelte/store'; import { writable } from 'svelte/store';
let title: string | undefined = 'Mokuro'; let title: string | undefined = 'Mokuro';
@@ -45,10 +46,15 @@
{:else} {:else}
<a href="/"><h2>{title}</h2></a> <a href="/"><h2>{title}</h2></a>
{/if} {/if}
<img src={SettingsIcon} alt="settings" />
</div> </div>
</nav> </nav>
<style lang="scss"> <style lang="scss">
img {
width: 32px;
fill: #000;
}
nav { nav {
position: relative; position: relative;
width: 100%; width: 100%;

View File

@@ -1,33 +1,5 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation';
import { db } from '$lib/catalog/db';
import Button from '$lib/components/Button.svelte';
import Catalog from '$lib/components/Catalog.svelte'; import Catalog from '$lib/components/Catalog.svelte';
import Modal from '$lib/components/Modal.svelte';
function onClick() {
goto('/upload');
}
function clear() {
db.catalog.clear();
}
let modal: HTMLDialogElement;
</script> </script>
<Button variant="secondary" on:click={onClick}>Upload</Button>
<Button variant="danger" on:click={clear}>Clear</Button>
<Modal bind:modal>
<div slot="title">Title</div>
<div slot="content">
Content
<input type="text" />
</div>
<div slot="action">
<Button on:click={() => modal.close()}>Action</Button>
<Button variant="secondary" on:click={() => modal.close()}>Close</Button>
</div>
</Modal>
<Catalog /> <Catalog />

View File

@@ -16,6 +16,4 @@
{#await promise} {#await promise}
<h2>Loading...</h2> <h2>Loading...</h2>
{:then}
<Catalog />
{/await} {/await}