-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_flash.html
40 lines (36 loc) · 1008 Bytes
/
test_flash.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
<html>
<head>
<style>
#main {
height:100%;
width:100%;
background: red;
}
</style>
</head>
<body>
<div id="main">
</div>
<script>
morse_block = [1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0];
pos = 0;
function ditdah() {
console.log ('.');
if (pos <= morse_block.length) {
elt = document.getElementById('main');
if (morse_block[pos] == 1) {
elt.style.background = 'white';
console.log ('on');
} else {
elt.style.background = 'black';
console.log ('off');
}
pos += 1;
} else {
pos = 0;
}
}
var t = setInterval(ditdah, 200);
</script>
</body>
</html>