Skip to content

Instantly share code, notes, and snippets.

@hpstuff
Created January 31, 2018 09:07
Show Gist options
  • Save hpstuff/6f4f05f18b0d2e03f33605966d48afbe to your computer and use it in GitHub Desktop.
Save hpstuff/6f4f05f18b0d2e03f33605966d48afbe to your computer and use it in GitHub Desktop.
GSAP vs Animated
/* (...) */
show(toValue, cb) {
return Animated.timing(this.animation, {
toValue,
duration,
easing: Ease.ease(Ease.out)
}).start(({finished}) => finished && cb);
}
/* (...) */
show(0);
/* (...) */
render() {
const style = {
opacity: this.animation,
height: this.aniamtion
};
}
/* (...) */
/* (...) */
const duration = 0.5;
show(target, cb) {
return TweenMax
from(target, duration, {
opacity: 0,
height: 0,
onComplete() {
cb();
},
ease: Elastic.easeOut.config(0.25, 1),
});
}
show(this.wrapperElement);
/* (...) */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment