Created
January 31, 2018 09:07
-
-
Save hpstuff/6f4f05f18b0d2e03f33605966d48afbe to your computer and use it in GitHub Desktop.
GSAP vs Animated
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
/* (...) */ | |
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 | |
}; | |
} | |
/* (...) */ |
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
/* (...) */ | |
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