basic tween
by Laras intan
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/plugins/CSSPlugin.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/easing/EasePack.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenLite.min.js"></script>
<div class="box" id="red"></div>
<div class="box" id="yellow"></div>
<div class="box" id="blue"></div>
<div class="box" id="ocean"></div>
CSS
.box {
position: relative;
float: left;
margin-right: 12px;
width: 70px;
height: 70px;
}
#red {
background-color: #cc2a36;
}
#yellow {
background-color: #ffdb00;
}
#blue {
background-color: #1e2e4d;
}
#ocean {
background-color: #7ebac7;
}
JavaScript
var red = document.getElementById("red"),
yellow = document.getElementById("yellow"),
ocean = document.getElementById("ocean"),
blue = document.getElementById("blue");
TweenLite.to([red, yellow, blue, ocean], 2, {
scale: 0.3,
opacity: 0.4
});