Jump to content
Search Community

Help > Simple Page transition

CreativeRobot test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

  • Solution

Hi CreativeRobot, Sure, happy to give some pointers.

 

Your first and last tween are doing the same thing, so you don't need both.

You also don't need yoyo in the first one - yoyo alternates the direction of repeating tweens, and that tween isn't repeating

You can add defaults to a timeline if your tweens are using the same values repeatedly.


You could write this in just one tween.
 

gsap.to(".logo", {
  opacity: 0,
  xPercent: -100,
  duration: 1,
  repeat: 1,
  yoyo: true,
  repeatDelay: 5,
  ease: "power1.out",
})


But the ease would be reversed.

Here's another option with separate tweens and the easing you had applied originally.

See the Pen yLXwJea?editors=1010 by GreenSock (@GreenSock) on CodePen

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

I'm not sure what you mean by 'refresh the page transition' I'm afraid. The code will play on page load, but that's all. Does that answer your question?

If you want to block scrolling the usual route is to add height:100vh and overflow:hidden to the body during the transition.

you can add these with GSAP.

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...