-
Notifications
You must be signed in to change notification settings - Fork 0
/
animate.js
27 lines (26 loc) · 1.07 KB
/
animate.js
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
var animate = (function() {
var p1 = document.getElementById('p1');
var p2 = document.getElementById('p2');
var p3 = document.getElementById('p3');
var p4 = document.getElementById('p4');
var circles = document.getElementsByTagName('circle');
for (var i = 0; i < circles.length; i++) {
var R1 = ((Math.random() * 0.699) + 0.300).toFixed(3),
R2 = ((Math.random() * -0.899) - 0.100).toFixed(3),
R3 = ((Math.random() * 0.899) + 0.100).toFixed(3),
R4 = (Math.random() + 0.4).toFixed(3);
console.log(circles[i]);
var animation = "blinker 20s cubic-bezier(" + R1 + ", " + R2 + ", " + R3 + ", " + R4 + ") infinite";
// circles[i].style.fill = '#'+Math.floor(Math.random()*16777215).toString(16);
circles[i].style.fill = "#000000";
circles[i].style.animation = animation;
p1.style.fill = "#000000";
p1.style.animation = animation;
p2.style.fill = "#000000";
p2.style.animation = animation;
p3.style.fill = "#000000";
p3.style.animation = animation;
p4.style.fill = "#000000";
p4.style.animation = animation;
}
}());