Skip to content

Instantly share code, notes, and snippets.

@yann-yinn
Created August 14, 2017 11:19
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yann-yinn/7daf76e448955612b3578be526d4ccd7 to your computer and use it in GitHub Desktop.
Save yann-yinn/7daf76e448955612b3578be526d4ccd7 to your computer and use it in GitHub Desktop.
Page transitions slide effect example with Nuxt.js and Vue.js
// 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;
}
}
<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