aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Root.svelte
blob: d65a9832609412dd24727391d8182696e770dab6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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}