-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
78 lines (60 loc) · 1.73 KB
/
index.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<style>
.bubble {
width: 200px;
height: 200px;
border-radius: 50%;
background-color: blue;
position: relative;
}
</style>
<title></title>
</head>
<body>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<script>
// var bubble = document.getElementsByClassName('bubble')
/*circle.style.top = '200px'
circle.style.left = '100px'*/
var bubbles = document.getElementsByClassName('bubble')
for (var i = 0; i < bubbles.length;) { bubbles[i].style.left = Math.floor(Math.random()*100) + '%'; }
var position = function() {
bubble[0].style.top = "calc(" + Math.floor(100 * Math.random()) + '%' + ' - 200px)';
bubble[0].style.left = "calc(" + Math.floor(100 * Math.random()) + '%' + ' - 200px)';
}
// position()
/*var color = function() {
var colorString = "rgb(" + Math.floor(255 * Math.random()) + ',' + Math.floor(255 * Math.random()) + ',' + Math.floor(255 * Math.random()) + ")";
console.log("The color is", colorString);
bubble.style.backgroundColor = colorString;
}
color()*/
/*var size = funciton () {
bubble.style.width = 1000*Math.random()
bubble.style.height = 1000*Math.random()
}
size ()*/
// setInterval(position, 500);
// setInterval(color, 500)
//setInterval(size, 500)//
// for (var i = 0; i < 10; i = i + 1) {
// console.log(i);
// }
var i = 0;
while (i < 10) {
console.log(i);
i = i + 1;
}
var i = 0;
do {
console.log(i);
i = i + 1;
} while (i < 10);
</script>
</body>
</html>