Skip to content

Instantly share code, notes, and snippets.

@pntrivedy
Last active April 28, 2016 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pntrivedy/5c13dcaaaaf5dae200907b6c7e08183c to your computer and use it in GitHub Desktop.
Save pntrivedy/5c13dcaaaaf5dae200907b6c7e08183c to your computer and use it in GitHub Desktop.
Framerjs screen switch function
#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