<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}
