Created
June 14, 2016 17:30
-
-
Save davidpett/c2b4ca4523abcf3c06b769c9c68d8c98 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import Ember from 'ember'; | |
import { stop, animate, Promise } from 'liquid-fire'; | |
export default function() { | |
stop(this.oldElement); | |
let windowWidth = window.innerWidth ? window.innerWidth : Ember.$(window).width(); | |
this.oldElement.css('z-index', 0); | |
this.newElement.css('z-index', 1); | |
return Promise.all([ | |
animate(this.newElement, { | |
translateX: [0, windowWidth] | |
}, { | |
duration: 600, | |
easing: 'easeInOutQuint', | |
queue: false | |
}), | |
animate(this.oldElement, { | |
opacity: [0.25, 1], | |
translateX: -(windowWidth * 0.5) | |
}, { | |
duration: 1000, | |
delay: 100, | |
easing: 'easeInOutQuint', | |
queue: false | |
}) | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment