diff --git a/src/app.pcss b/src/app.pcss index 3b0fe0f..9063c96 100644 --- a/src/app.pcss +++ b/src/app.pcss @@ -3,4 +3,5 @@ @tailwind components; @tailwind utilities; -body { @apply bg-surface-50-900-token; } \ No newline at end of file +body { @apply bg-surface-50-900-token; } +html, body { @apply min-h-full; } \ No newline at end of file diff --git a/src/lib/components/AppSettings.svelte b/src/lib/components/AppSettings.svelte new file mode 100644 index 0000000..fd8cac7 --- /dev/null +++ b/src/lib/components/AppSettings.svelte @@ -0,0 +1,36 @@ + +
+

Settings

+ + Search Grid + + + {#if tabPos === 0} +
+
+ +
+
Grid Columns
+
{$imageGridColumns} / {12}
+
+
+
+
+ +
+
+ {/if} +
+
+
\ No newline at end of file diff --git a/src/lib/components/BackAppRailAnchor.svelte b/src/lib/components/BackAppRailAnchor.svelte index 587a9d7..6c92950 100644 --- a/src/lib/components/BackAppRailAnchor.svelte +++ b/src/lib/components/BackAppRailAnchor.svelte @@ -1,12 +1,12 @@ - + +

Back

diff --git a/src/lib/components/GlobalSearch.svelte b/src/lib/components/GlobalSearch.svelte new file mode 100644 index 0000000..0991955 --- /dev/null +++ b/src/lib/components/GlobalSearch.svelte @@ -0,0 +1,18 @@ + + +{#if $showSearch} +
{ + $loading = true; + goto('/') + lastSearch.set(searchValue); + }}> + + +
+{/if} \ No newline at end of file diff --git a/src/lib/components/ImageGrid.svelte b/src/lib/components/ImageGrid.svelte index b714a4e..ee7e70f 100644 --- a/src/lib/components/ImageGrid.svelte +++ b/src/lib/components/ImageGrid.svelte @@ -1,14 +1,17 @@
{#each posts as post} - + { + $loading = true; + $showSearch = false + }}>
- {`Post
diff --git a/src/lib/components/PostMedia.svelte b/src/lib/components/PostMedia.svelte new file mode 100644 index 0000000..4c9c818 --- /dev/null +++ b/src/lib/components/PostMedia.svelte @@ -0,0 +1,17 @@ + + +
+ {#if post?.preview?.has} + {`Post + {:else} + {#if ['webm', 'mp4'].includes(post.file.ext)} + + {:else} + {`Post + {/if} + {/if} +
diff --git a/src/lib/components/SearchAppRailAnchor.svelte b/src/lib/components/SearchAppRailAnchor.svelte new file mode 100644 index 0000000..46f7006 --- /dev/null +++ b/src/lib/components/SearchAppRailAnchor.svelte @@ -0,0 +1,13 @@ + + + $showSearch = !$showSearch}> +
+ +

Search

+
+
diff --git a/src/lib/components/index.js b/src/lib/components/index.js index 251ee54..cab472f 100644 --- a/src/lib/components/index.js +++ b/src/lib/components/index.js @@ -1,5 +1,15 @@ +import AppSettings from './AppSettings.svelte'; +import BackAppRailAnchor from './BackAppRailAnchor.svelte'; +import GlobalSearch from './GlobalSearch.svelte'; import ImageGrid from './ImageGrid.svelte'; +import PostMedia from './PostMedia.svelte'; +import SearchAppRailAnchor from './SearchAppRailAnchor.svelte'; export { + AppSettings, + BackAppRailAnchor, + GlobalSearch, ImageGrid, + PostMedia, + SearchAppRailAnchor } \ No newline at end of file diff --git a/src/lib/stores.js b/src/lib/stores.js index c24f79d..2594b31 100644 --- a/src/lib/stores.js +++ b/src/lib/stores.js @@ -2,8 +2,8 @@ import { localStorageStore } from '@skeletonlabs/skeleton'; import { writable } from 'svelte/store'; export const lastSearch = localStorageStore('lastSearch', ''); -export const imageGridColumns = localStorageStore('gridColumns', 8); -export const imageSearchResults = writable(null); -export const imageGridPreviewQuality = localStorageStore('gridPreviewQuality', 'preview'); - -export const loading = writable(false); \ No newline at end of file +export const imageGridColumns = localStorageStore('gridColumns', 6); +export const postSearchResults = writable(null); +export const postGridPreviewQuality = localStorageStore('gridPreviewQuality', 'preview'); +export const loading = writable(false); +export const showSearch = writable(true); \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 36ea83a..af5639a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,14 +1,21 @@ -
+
+ + +
+ +
+
{#if $loading} -
+
{/if} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 3869138..a491e5a 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,95 +1,70 @@ - -
-
- - -
-
-
- -
-
Grid Columns
-
{$imageGridColumns} / {12}
-
-
-
-
- -
-
-
-
- - - - - drawerStore.open()}> -
- -

Settings

-
-
-
-
+ + + + +
+ + + + + + drawerStore.open()}> +
+ +

Settings

+
+
+
+
+
+
+ -
- {#if $imageSearchResults} - {#await $imageSearchResults} - {:then result} - - {:catch err} -

Error: {err}

- {/await} +
+ {#if $postSearchResults} + {/if}
- + \ No newline at end of file diff --git a/src/routes/posts/[post_id]/+page.svelte b/src/routes/posts/[post_id]/+page.svelte index 7662312..6926d2a 100644 --- a/src/routes/posts/[post_id]/+page.svelte +++ b/src/routes/posts/[post_id]/+page.svelte @@ -3,19 +3,16 @@ AppRail, AppRailAnchor, AppShell, - Modal, getDrawerStore, - getModalStore, - Drawer } from '@skeletonlabs/skeleton'; - import {faCode, faGear} from '@fortawesome/free-solid-svg-icons'; + import { faGear, faCopy } from '@fortawesome/free-solid-svg-icons'; import { Fa } from 'svelte-fa'; - import BackAppRailAnchor from "$lib/components/BackAppRailAnchor.svelte"; + import { BackAppRailAnchor, GlobalSearch, PostMedia, SearchAppRailAnchor } from '$lib/components'; + import {onMount} from 'svelte'; + import {loading} from '$lib/stores.js'; + export let data; - let drawerStore = getDrawerStore(); - let modalStore = getModalStore(); - const tagTypes = Object.entries({ artist: 'Artist', character: 'Character', @@ -25,13 +22,17 @@ meta: 'Meta', invalid: 'Invalid' }); + + onMount(() => { + $loading = false; + }); - - - - + + + +
{#each tagTypes as [name, label]} @@ -44,35 +45,36 @@ {/each}
+ - - - - - - - drawerStore.open()}> -
- -

Settings

-
-
-
-
+
+ + + + + + + {}}> +
+ +

Copy link

+
+
+ drawerStore.open()}> +
+ +

Settings

+
+
+
+
+
+ -
+
- {#if data?.post?.preview?.has} - {`Post - {:else} - {`Post - {/if} +
@@ -82,11 +84,6 @@

{data.post.description}

-