aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Home/Root.svelte
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-13 18:56:25 -0800
committerFuwn <[email protected]>2024-01-13 18:56:25 -0800
commit6a1933178985e23825d8453449ca99bb0e5cfcb6 (patch)
tree1c2b7919e9b57bb908a34593be10302542d45c60 /src/lib/Home/Root.svelte
parentrefactor(data): move json to data (diff)
downloaddue.moe-6a1933178985e23825d8453449ca99bb0e5cfcb6.tar.xz
due.moe-6a1933178985e23825d8453449ca99bb0e5cfcb6.zip
refactor(home): move layout to home
Diffstat (limited to 'src/lib/Home/Root.svelte')
-rw-r--r--src/lib/Home/Root.svelte26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/Home/Root.svelte b/src/lib/Home/Root.svelte
new file mode 100644
index 00000000..d65a9832
--- /dev/null
+++ b/src/lib/Home/Root.svelte
@@ -0,0 +1,26 @@
+<script lang="ts">
+ import settings from '$stores/settings';
+ import { fly } from 'svelte/transition';
+
+ export let data: any;
+ export let way: number;
+
+ const animationDelay = 100;
+</script>
+
+{#if $settings.displayDisableAnimations}
+ <slot />
+{:else}
+ {#key data.url}
+ <div
+ in:fly={{
+ x: way,
+ duration: animationDelay,
+ delay: animationDelay
+ }}
+ out:fly={{ x: -way, duration: animationDelay }}
+ >
+ <slot />
+ </div>
+ {/key}
+{/if}