Add some nice transitions

pull/4161/head
Elijah 6 years ago
parent c5c68907f8
commit d139f158d6

@ -1,21 +1,30 @@
<script> <script>
import { writable } from 'svelte/store'; import { writable } from 'svelte/store';
import { fade, fly} from 'svelte/transition';
export let showing = false; export let showing = false;
</script> </script>
{#if showing} {#if showing}
<div class="search"></div> <div class="cover background" on:click={() => showing = false} transition:fade></div>
<div class="cover search" transition:fly={{x: 400}}></div>
{/if} {/if}
<style> <style>
.search { .cover {
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; right: 0;
left: 0;
bottom: 0; bottom: 0;
z-index: 100;
}
.background {
background: rgba(0, 0, 0, 0.6);
}
.search {
left:unset;
width: 385px; width: 385px;
background: var(--back); background: var(--back);
z-index: 100;
} }
</style> </style>

Loading…
Cancel
Save