-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtools.js
38 lines (36 loc) · 826 Bytes
/
tools.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
28
29
30
31
32
33
34
35
36
37
38
function random_color()
{
var alea = get_alea(0,8);
if (alea == 1)
return("color1");
else if (alea == 2)
return("color2");
else if (alea == 3)
return("color3");
else if (alea == 4)
return("color4");
else if (alea == 5)
return("color5");
else if (alea == 6)
return("color6");
else if (alea == 7)
return("color7");
else if (alea == 8)
return("color8");
}
function draw_background_title()
{
var title_contner = document.getElementById('title_contner');
var i = 0;
title_contner.innerHTML = "";
while (i < ((window.innerWidth / 25) * 5))
{
var rand_color = random_color();
title_contner.innerHTML += "<div class=\"relative_piece low_opacity " + rand_color + "\">";
i++;
}
}
draw_background_title()
window.onresize = function(){
draw_background_title();
}