Skip to content

Instantly share code, notes, and snippets.

@davidpett
Created June 14, 2016 17:33
Show Gist options
  • Save davidpett/23c5eef984257a1fd7058aa8a815fbad to your computer and use it in GitHub Desktop.
Save davidpett/23c5eef984257a1fd7058aa8a815fbad to your computer and use it in GitHub Desktop.
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