Hello everyone! I am trying to use GSAP with Animate.css to create flexible animation for banner ads. I know this is possible but I would like to know the best way to use GSAP + Animate.css to improve my coding. I've provided link for codepen! Any suggestion would be great! If you have experience with GSAP + Animate.css please comment here!
What is Animate.css?
--> a bunch of cool, fun, and cross-browser animations for you to use in your projects. Great for emphasis, home pages, sliders, and general just-add-water-awesomeness.
Thanks GSAP Masters!
HTML:
<div id="circle"></div>
CSS:
#circle {
width: 200px;
height: 200px;
background: #222;
border-radius: 200px;
}
Javascript:
window.onload = init;
function init() {
TweenMax.set("#circle", {alpha: 0, x: "+=100px", onComplete: a});
}
function a() {
TweenMax.to("#circle", 1, {delay: 1, alpha: 1, onStart: aa});
TweenMax.to("#circle", 1, {delay: 1.5, onStart: ab});
TweenMax.to("#circle", 1, {delay: 2, onStart: ac});
TweenMax.delayedCall(2, ad);
}
function aa() {
$("#circle").addClass("animated wobble");
}
function ab() {
$("#circle").css("margin-left","100px");
}
function ac() {
$("#circle").addClass("animated bounce");
}
function ad() {
$("#circle").removeClass("animated bounce wobble")
}