Skip to content

Instantly share code, notes, and snippets.

@dbismut
Last active April 9, 2018 08:08
Show Gist options
  • Save dbismut/823b847b2b619183252bc34330d71dce to your computer and use it in GitHub Desktop.
Save dbismut/823b847b2b619183252bc34330d71dce to your computer and use it in GitHub Desktop.
Part 2 - animating the scrollTop property separately during the exiting transition
executeExitingTransition = (node, done) => {
// we're temporarily changing our spring to
// a tween with a very long duration to check
// everything is working properly
tween({
from: this.from,
to: this.to,
duration: 10000
// stiffness: 100,
// damping: 12,
// restDelta: true,
// restSpeed: 0.1
}).start({
update: ({ scrollTop, ...rest }) => {
this.postStyler.set(rest);
this.postScroll.set('top', scrollTop);
},
complete: () => {
this.preview.style.visibility = 'visible';
const scrollTop = -this.pageListStyler.get('top');
this.pageListStyler.set({ position: 'absolute', top: 0 });
windowScroll.set('top', scrollTop);
done();
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment