Last active
April 28, 2016 17:19
-
-
Save pntrivedy/5c13dcaaaaf5dae200907b6c7e08183c to your computer and use it in GitHub Desktop.
Framerjs screen switch function
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
#source : https://github.com/ServusJon/PrototypeWithFramerjs | |
screenSwitch = (current,next) -> | |
next.animate | |
properties: | |
x: 0 | |
curve: "ease-out" | |
time: 0.15 | |
animationHideScreen = new Animation | |
layer: current | |
properties: | |
opacity: 0 | |
time: 0.4 | |
curve:"ease-in" | |
animationOrigin = new Animation | |
layer: current | |
properties: | |
x: screenWidth | |
opacity: 1 | |
time:0.0 | |
animationHideScreen.on(Events.AnimationEnd,animationOrigin.start) | |
animationHideScreen.start() | |
#Usage | |
Splashbtn.on Events.Click, -> | |
screenSwitch(Splash, Accounts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment