diff options
| author | Fuwn <[email protected]> | 2024-01-24 21:29:56 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-24 21:29:56 -0800 |
| commit | 26de12b070a55ac60c897e1d0b385a8aa621362c (patch) | |
| tree | 352074c951c461e8d3681548cb8a1f880df55ba3 /src | |
| parent | feat(skeleton): optional width and height (diff) | |
| download | due.moe-26de12b070a55ac60c897e1d0b385a8aa621362c.tar.xz due.moe-26de12b070a55ac60c897e1d0b385a8aa621362c.zip | |
feat(user): skeleton loading
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/Skeleton.svelte | 3 | ||||
| -rw-r--r-- | src/routes/user/[user]/+page.svelte | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Skeleton.svelte b/src/lib/Skeleton.svelte index 32182657..839d7985 100644 --- a/src/lib/Skeleton.svelte +++ b/src/lib/Skeleton.svelte @@ -2,10 +2,11 @@ export let count = 3; export let width = '100%'; export let height = '100px'; + export let card = true; </script> {#each Array(count) as _, i} - <div class="card card-small" style={`width: ${width};`}> + <div class={card ? 'card card-small' : ''} style={`width: ${width};`}> <div class="skeleton-container"> <div class="skeleton" style={`width: ${width}; height: ${height};`} /> </div> diff --git a/src/routes/user/[user]/+page.svelte b/src/routes/user/[user]/+page.svelte index 4637234a..d6248a3b 100644 --- a/src/routes/user/[user]/+page.svelte +++ b/src/routes/user/[user]/+page.svelte @@ -2,6 +2,7 @@ import { user, type User } from '$lib/AniList/user'; import HeadTitle from '$lib/Home/HeadTitle.svelte'; import { estimatedDayReading } from '$lib/Media/Manga/time'; + import Skeleton from '$lib/Skeleton.svelte'; import root from '$lib/Utility/root.js'; import { onMount } from 'svelte'; @@ -31,7 +32,9 @@ Does this user exist? {:else if userData === undefined} - Loading user ... 50% + <p>Loading user ... 50%</p> + + <Skeleton card={false} count={1} /> {:else} <div class="card" |