Skip to content

Commit

Permalink
feat: create Transition component
Browse files Browse the repository at this point in the history
  • Loading branch information
Fariz Rizaldy committed Jan 13, 2020
1 parent d0e7513 commit 4afaf5b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/Transition.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script>
import { onMount } from 'svelte'
import { fade } from 'svelte/transition'
let isMounted = false
onMount(() => {
isMounted = true
})
</script>

{#if isMounted}
<div transition:fade={{ duration: 500 }}>
<slot />
</div>
{/if}

0 comments on commit 4afaf5b

Please sign in to comment.