Skip to content

Commit 5fe5c93

Browse files
authored
Feat/splashscreen animation (#81)
* feat: add animation to splashScreen * feat: implement data loading logic with splash screen delay * chore: sort import
1 parent 70c76be commit 5fe5c93

File tree

4 files changed

+46
-17
lines changed

4 files changed

+46
-17
lines changed

infrastructure/eid-wallet/src/app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<link rel="preload" href="/fonts/Archivo-VariableFont_wdth,wght.ttf" as="font" type="truetype" crossorigin="anonymous">
78
<title>Tauri + SvelteKit + Typescript App</title>
89
%sveltekit.head%
910
</head>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script lang="ts">
2+
import { cubicOut } from "svelte/easing";
3+
import { fade, scale } from "svelte/transition";
4+
</script>
5+
6+
<div out:fade={{duration: 150}} class="z-50 absolute w-screen h-screen overflow-hidden" >
7+
<div class="relative w-screen h-screen bg-primary overflow-hidden">
8+
9+
<img in:scale={{start: 0.8, duration: 500, easing: cubicOut, opacity: 1 }} class="absolute w-full bottom-[-80px] start-0" src="/images/Shape1.svg" alt="illustration">
10+
<img in:scale={{start: 0.8, duration: 500, easing: cubicOut, opacity: 1 }} class="absolute w-full top-[50px] end-[100px]" src="/images/Shape2.svg" alt="illustration">
11+
<div in:scale={{start: 0.9, duration: 500, easing: cubicOut, opacity: 1 }} class="absolute w-full top-[42%] start-[50%] translate-x-[-50%] translate-y-[-42%]">
12+
<h1 in:fade={{duration: 500}} class="text-center text-white text-[44px]">eAgency</h1>
13+
<p in:fade={{duration: 500}} class="text-center text-white">Your self-sovereign digital entity</p>
14+
</div>
15+
<img in:fade={{duration: 500}} class="absolute bottom-[116px] start-[50%] translate-x-[-50%]" src="/images/W3DSLogoWhite.svg" alt="logo">
16+
</div>
17+
</div>
18+
19+
<style>
20+
21+
</style>

infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { clickOutside, cn } from "$lib/utils";
33
import { CupertinoPane } from "cupertino-pane";
4-
import { type Snippet } from "svelte";
4+
import type { Snippet } from "svelte";
55
import { swipe } from "svelte-gestures";
66
import type { HTMLAttributes } from "svelte/elements";
77
Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
11
<script lang="ts">
2+
import SplashScreen from "$lib/fragments/SplashScreen/SplashScreen.svelte";
3+
import { onMount } from "svelte";
24
import "../app.css";
5+
36
const { children } = $props();
47
5-
let showSplashScreen = $state(true);
8+
let showSplashScreen = $state(false);
9+
10+
// replace with actual data loading logic
11+
async function loadData() {
12+
await new Promise((resolve) => setTimeout(resolve, 1500));
13+
}
14+
15+
async function ensureMinimumDelay() {
16+
await new Promise((resolve) => setTimeout(resolve, 500));
17+
}
618
7-
$effect(() => {
8-
setTimeout(() => {
9-
showSplashScreen = false;
10-
}, 500);
19+
onMount(async () => {
20+
showSplashScreen = true; // Can't set up the original state to true or animation won't start
21+
22+
await Promise.all([loadData(), ensureMinimumDelay()]);
23+
24+
showSplashScreen = false;
1125
});
1226
</script>
13-
27+
1428
{#if showSplashScreen}
15-
<div class="relative w-full h-screen bg-primary">
16-
<img class="absolute w-full bottom-[-80px] start-0" src="/images/Shape1.svg" alt="illustration">
17-
<img class="absolute w-full top-[50px] end-[100px]" src="/images/Shape2.svg" alt="illustration">
18-
<div class="absolute w-full top-[42%] start-[50%] translate-x-[-50%] translate-y-[-42%]">
19-
<h1 class="text-center text-white text-[44px]">eAgency</h1>
20-
<p class="text-center text-white">Your self-sovereign digital entity</p>
21-
</div>
22-
<img class="absolute bottom-[116px] start-[50%] translate-x-[-50%]" src="/images/W3DSLogoWhite.svg" alt="logo">
23-
</div>
29+
<SplashScreen />
2430
{:else}
2531
{@render children?.()}
26-
{/if}
32+
{/if}
33+

0 commit comments

Comments
 (0)