1
0
Fork 0

add page and layout transitions

This commit is contained in:
Moritz Ruth 2019-03-10 17:29:07 +01:00
parent 8ead8b8928
commit fa14506eaa
4 changed files with 41 additions and 5 deletions

View file

@ -1,4 +1,5 @@
@import "./colors";
@import "./transitions";
@import url('https://fonts.googleapis.com/css?family=Raleway');
html, body, #__nuxt, #__layout {

29
assets/transitions.scss Normal file
View file

@ -0,0 +1,29 @@
.page-enter-active, .page-leave-active {
transition: opacity 0.5s;
}
.page-enter, .page-leave-to {
opacity: 0;
}
.layout-enter-active {
transition: transform 0.5s ease, opacity 0.6s ease;
}
.layout-leave-active {
transition: transform 0.5s ease, opacity 0.1s ease;
}
.layout-enter {
transform: translateX(-100%);
opacity: 0;
}
.layout-leave-to {
transform: translateX(100%);
opacity: 0;
}
.layout-enter-to, .layout-leave {
opacity: 1;
}

View file

@ -2,6 +2,12 @@
<nuxt/>
</template>
<script>
export default {
name: "default"
}
</script>
<style lang="scss">
</style>

View file

@ -1,10 +1,10 @@
<template>
<div id="layout">
<nuxt-link class="button" to="/"></nuxt-link>
<div class="content">
<nuxt/>
</div>
<div id="layout">
<nuxt-link class="button" to="/"></nuxt-link>
<div class="content">
<nuxt/>
</div>
</div>
</template>
<script>