-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatic1.html
48 lines (41 loc) · 964 Bytes
/
static1.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Attempt 1</title>
<style type="text/css">
body {
margin: 0px;
line-height: 1px;
font-size: 1px;
background-color: #111;
overflow: hidden;
}
span {
width: 1px;
height: 1px;
display: inline-block;
}
</style>
</head>
<body></body>
<script type="text/javascript">
function noise() {
let start = Date.now()
let h = window.innerHeight;
let w = window.innerWidth;
let pixels = h * w;
let logpoint = Math.floor(pixels / 1000);
console.log('Start')
for (let i=0; i < pixels; i++) {
let color = Math.random().toString(16).slice(-6)
span = `<span style="background-color: #${color};"></span>`;
document.body.innerHTML += span
if (i % logpoint == 0) {
console.log(`${i}/${pixels} in ${(Date.now()-start) / 1000} sec `)
}
}
}
noise()
</script>
</html>