Add base animation
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
|
import { fly } from 'svelte/transition';
|
||||||
|
|
||||||
import { generateId } from './utils/id'
|
import { generateId } from './utils/id'
|
||||||
import { store } from './store'
|
import { store } from './store'
|
||||||
|
|
||||||
@@ -10,10 +12,17 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if id === $store.currentItemId}
|
{#if id === $store.currentItemId}
|
||||||
|
<div
|
||||||
|
class="main-container"
|
||||||
|
in:fly="{{ x: 200, duration: 200, delay: 200 }}"
|
||||||
|
out:fly="{{ x: -200, duration: 200 }}"
|
||||||
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
</div>
|
||||||
{/if }
|
{/if }
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.main-container {
|
.main-container {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -11,10 +11,14 @@
|
|||||||
<div class="main-container">
|
<div class="main-container">
|
||||||
<ImageCarousel {arrows}>
|
<ImageCarousel {arrows}>
|
||||||
<CarouselChild>
|
<CarouselChild>
|
||||||
|
<div class="child-content-container">
|
||||||
<h1>Element 1</h1>
|
<h1>Element 1</h1>
|
||||||
|
</div>
|
||||||
</CarouselChild>
|
</CarouselChild>
|
||||||
<CarouselChild>
|
<CarouselChild>
|
||||||
|
<div class="child-content-container">
|
||||||
<h1>Element 2</h1>
|
<h1>Element 2</h1>
|
||||||
|
</div>
|
||||||
</CarouselChild>
|
</CarouselChild>
|
||||||
</ImageCarousel>
|
</ImageCarousel>
|
||||||
</div>
|
</div>
|
||||||
@@ -24,4 +28,10 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.child-content-container {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user