-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathparrots.html
53 lines (49 loc) · 1.38 KB
/
parrots.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<title>PARROTS</title>
<link rel="icon" href="pelement.png">
<style>
body{
background-color:white;
/*background-image:url(images/parrotsPiece.gif);
background-size:290px 55px;*/
/*animation:psych 1s linear infinite;*/
margin:0;
overflow:hidden;
}
.parrot{
display:block;
position:relative;
float:left;
width:32px;
height:25px;
background-size:cover;
}
#container{
display:block;
position:fixed;
}
@keyframes psych{
0%{background-color:red;}
50%{background-color:green;}
100%{background-color:blue;}
}
</style>
</head>
<body>
<div id="container"></div>
<script>
var outStr="";
var container=document.getElementById("container");
container.style.width=""+(Math.ceil(window.innerWidth/32)*32)+"px";
container.style.height=""+(Math.ceil(window.innerHeight/25)*25)+"px";
var amount=Math.ceil(window.innerWidth/32)*Math.ceil(window.innerHeight/25);
for (var i=0;i<amount;i++){
outStr+="<div class=\"parrot\" style=\"background-image:url(images/parrots/parrot"+Math.floor(Math.random()*43)+".gif)\"></div>";
}
console.log(amount);
container.innerHTML=outStr;
</script>
</body>
</html>