/*
* See https://greensock.com/gsap/ for details about GSAP.
*/
var master = gsap.timeline(),
bg = $("#featureBackground")
master.add(control())
function control() {
var dots = gsap.timeline(),
qty = 80,
duration = 2.5,
colors = ["#91e600","#84d100","#73b403","#528003"];
for (i = 0; i < qty; i++) {
dot = $("<div class='dot'/>").appendTo(bg)[0];
var color = colors[(Math.random() * colors.length) | 0];
gsap.set(dot, {backgroundColor:color, x:400, y:300});
delay = Math.random() * duration;
dots.to(dot, {duration: duration, physics2D:{velocity:Math.random() * 400 + 150, angle:Math.random() * 40 + 250, gravity:500}}, delay);
}
return dots;
}
GSDevTools.create({
animation: master,
container:"#featureAnimation",
minimal:true
});