Last active
April 9, 2018 08:08
-
-
Save dbismut/823b847b2b619183252bc34330d71dce to your computer and use it in GitHub Desktop.
Part 2 - animating the scrollTop property separately during the exiting transition
This file contains 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
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