Jump to content
Search Community

Windpixel last won the day on January 7

Windpixel had the most liked content!

Windpixel

Premium
  • Posts

    42
  • Joined

  • Last visited

  • Days Won

    1

Community Answers

  1. Windpixel's post in Seamless page transition with Nuxt.js was marked as the answer   
    Ok. So literally two weeks ago I didn't know what Nuxt was, but thanks to the wonderful people in this forum, they have helped me get to this stage.

    My new site in progress with seamless Nuxt3 Page Transitions: gsap.windpixel.com.au.

    But back to your problem, I added this css into the style.css file to allow both entering and leave pages to be overlapped.
     
    They get added into the DOM at the same time, so by default, they stack giving un desirable effects.
     
    Here is a working demo for of yours with seamless transitions:

    https://stackblitz.com/edit/nuxt-starter-sxwssz?file=helpers%2FtransitionConfig.js
    .page-transiton-enter-active { position: fixed; height: 100%; width:100%; top:0; left:0; right:0; bottom:0; z-index:9; } .page-transiton-leave-active { position: fixed; height: 100%; width:100%; top:0; left:0; right:0; bottom:0; /* z-index:4; */ }

    I added back the logic to track when page transitions are starting and ending, this is vital to the site working as you need to fire and cleanup certain things when the pages are done. I also made a const to handle the duration for enter and leave, these should be the same so makes sense to tie them together.
    import gsap from 'gsap'; import { useTransitionComposable } from '../composables/transition-composable'; const { toggleTransitionComplete } = useTransitionComposable(); const duration = 0.6; const pageTransition = { name: 'page-transiton', mode: '', onEnter: (el, done) => { gsap.set(el, { yPercent: 100 }); gsap .timeline({ paused: true, onComplete() { toggleTransitionComplete(true); done(); }, }) .to(el, { yPercent: 0, duration: duration}) .play(); }, onLeave: (el, done) => { toggleTransitionComplete(false); gsap .timeline({ paused: true, onComplete: done }) .to(el, { duration: duration }) .play(); }, }; export default pageTransition; I hope that helps. If your journey is anything like mine, you will encounter quite a few problems to solve, but once you get past that, full page transitions are amazing!
    - Lance
  2. Windpixel's post in Nuxt3 / GSAP Page Transitions - Seamless Page Transition was marked as the answer   
    Ok. Solved. Thanks all

    The animation and timing is perfect, but when new page gets added to the DOM, it is stacked (display:block),
     
    tapping into the native css classes vue/nuxt offers, I just set the following styles.

    Min Dem updated, now truly seamless, each page is butted up against the last: 
    https://stackblitz.com/edit/nuxt-starter-d3iqbd?file=assets%2Fstyles.css

    As mentioned, the leaving page "jumps" top the top on page transition start, but ill come up with a work around for that
     
    .page-transiton-enter-active,
    page-transiton-leave-active { position:fixed; top:0; left:0; right:0; bottom:0; }
     
×
×
  • Create New...