Add fade animation to overlay comp

This commit is contained in:
kPherox 2019-04-24 00:04:29 +09:00
parent 38657ce31a
commit c7446fd49f
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D

View File

@ -1,4 +1,5 @@
<template>
<transition name="fade">
<div class="overlay">
<button type="button" class="close-button" @click="closeOverlay">x</button>
<h1>{{ title }}</h1>
@ -6,6 +7,7 @@
<slot/>
</div>
</div>
</transition>
</template>
<script lang="ts">
@ -25,13 +27,21 @@ export default class BaseOverlay extends Vue {
</script>
<style scoped lang="postcss">
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-to {
opacity: 0;
}
.overlay {
position: absolute;
top: 50%;
transform: translateY(-50%);
background-color: var(--bg-color);
width: 100vw;
height: 100vh;
background-color: var(--bg-color);
}
.overlay-inner {
margin: 1em;