Created
August 14, 2017 11:19
-
-
Save yann-yinn/7daf76e448955612b3578be526d4ccd7 to your computer and use it in GitHub Desktop.
Page transitions slide effect example with Nuxt.js and Vue.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// only for desktop for now, | |
@media screen and (min-width: 1008px) { | |
/* during entering and leaving : */ | |
.page-enter-active, .page-leave-active { | |
position:absolute; | |
max-width:725.328px; /*make sur our content keep it's original width*/ | |
transition: all .2s ease; | |
} | |
/* entering start */ | |
.page-enter { | |
left: -100%; | |
} | |
/* entering end */ | |
.page-enter-to { | |
left: 0; | |
} | |
/* leaving start */ | |
.page-leave { | |
opacity: 1; | |
} | |
/* leaving end */ | |
.page-leave-to { | |
opacity: 0; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<Contact /> | |
</template> | |
<script> | |
import Contact from '~/components/Contact' | |
export default { | |
transition: 'page', // set our transition with nuxt.js | |
components: { Contact }, | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment