-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
34 lines (26 loc) · 680 Bytes
/
script.js
File metadata and controls
34 lines (26 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Some code thanks to @chrisgannon
var select = function(s) {
return document.querySelector(s);
}
function randomBetween(min,max)
{
var number = Math.floor(Math.random()*(max-min+1)+min);
if ( number !== 0 ){
return number;
}else {
return 0.5;
}
}
var tl = new TimelineMax();
for(var i = 0; i < 20; i++){
var t = TweenMax.to(select('.bubble' + i), randomBetween(1, 1.5), {
x: randomBetween(12, 15) * (randomBetween(-1, 1)),
y: randomBetween(12, 15) * (randomBetween(-1, 1)),
repeat:-1,
repeatDelay:randomBetween(0.2, 0.5),
yoyo:true,
ease:Elastic.easeOut.config(1, 0.5)
})
tl.add(t, (i+1)/0.6)
}
tl.seek(50);