Skip to content

Commit 98b7ba3

Browse files
authored
feat: splash-screen (#187)
1 parent 94a4128 commit 98b7ba3

File tree

3 files changed

+66
-2
lines changed

3 files changed

+66
-2
lines changed

platforms/metagram/src/lib/dummyData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export const dummyPosts = Array.from({ length: 100 }, (_, i) => ({
66
username: `user${i + 1}`,
77
imgUri: [
88
'https://picsum.photos/800',
9-
'https://picsum.photos/200',
9+
'https://picsum.photos/600',
1010
'https://picsum.photos/800',
11-
'https://picsum.photos/200'
11+
'https://picsum.photos/600'
1212
],
1313
postAlt: 'Sample',
1414
text: `This is post number ${i + 1}. Loving how these shots came out! 📸`,

platforms/metagram/src/routes/+layout.svelte

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<script lang="ts">
22
import { onNavigate } from '$app/navigation';
33
import { isNavigatingThroughNav } from '$lib/store/store.svelte';
4+
import { onMount } from 'svelte';
45
import '../app.css';
56
67
let { children } = $props();
78
89
let previousRoute = null;
10+
let showSplashScreen = $state(true);
911
1012
onNavigate((navigation) => {
1113
if (!document.startViewTransition) return;
@@ -32,8 +34,20 @@
3234
});
3335
});
3436
});
37+
38+
onMount(() => {
39+
setTimeout(() => {
40+
showSplashScreen = false;
41+
}, 2500)
42+
})
3543
</script>
3644

45+
{#if showSplashScreen}
46+
<main class="h-[100dvh] w-full grid items-center justify-center">
47+
<img src="/images/Logo.svg" alt="logo">
48+
</main>
49+
{:else}
3750
<main class="h-[100dvh] overflow-hidden px-4 md:px-0">
3851
{@render children()}
3952
</main>
53+
{/if}
Lines changed: 50 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)