Created
February 8, 2021 16:35
-
-
Save popeating/7c114d226efc013a910d37b9dbaf6d02 to your computer and use it in GitHub Desktop.
This file contains 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
useEffect(() => { | |
gsap.to('.hometex', { | |
autoAlpha: 1, | |
duration: 1, | |
}); | |
}, []); //THIS IS RUN THE FIRST TIME THE SITE IS OPENED | |
useEffect(() => { | |
if (transitionStatus === 'entering') { | |
gsap.to('.hometex', { | |
autoAlpha: 1, | |
duration: 1, //if we are entering the page, let's make the div with class .hometex visible in one second | |
}); | |
} | |
if (transitionStatus === 'exiting') { | |
gsap.to('.hometex', { autoAlpha: 0, duration: 1 });//if we are exiting the page, let's make the div with class .hometex transparent in one second | |
} | |
}, [transitionStatus]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment