Created
June 14, 2016 17:33
-
-
Save davidpett/23c5eef984257a1fd7058aa8a815fbad 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', 1); | |
this.newElement.css('z-index', 0); | |
return Promise.all([ | |
animate(document.getElementsByTagName('html'), 'scroll', { | |
offset: 0, | |
duration: 300, | |
easeing: 'easeInOutQuint', | |
queue: false | |
}), | |
animate(this.oldElement, { | |
translateX: windowWidth | |
}, { | |
duration: 600, | |
delay: 100, | |
easing: 'easeInOutQuint', | |
queue: false | |
}), | |
animate(this.newElement, { | |
opacity: [1, 0.25], | |
translateX: [0, -(windowWidth * 0.5)] | |
}, { | |
duration: 600, | |
easing: 'easeInOutQuint', | |
queue: false | |
}) | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment