forked from kengdoj/new-bookmarklets
-
Notifications
You must be signed in to change notification settings - Fork 1
/
textblock_3hz.html
53 lines (47 loc) · 1.37 KB
/
textblock_3hz.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>3 Hz Text overlay</title>
</head>
<body>
<button onclick="on()">Turn on overlay text</button>
<script>
function on() {
var add_div = document.createElement('div');
add_div.setAttribute('id', 'overlay');
add_div.style.position = "fixed";
add_div.style.display = "block";
add_div.style.width = "100%";
add_div.style.height = "100%";
add_div.style.top = "0";
add_div.style.left = "0";
add_div.style.right = "0";
add_div.style.bottom = "0";
add_div.style.backgroundColor = "rgba(0,0,0,0.2)";
add_div.style.zIndex = "2";
add_div.style.cursor = "pointer";
var text_div = document.createElement('div');
text_div.setAttribute('id', 'text');
text_div.style.position = "absolute";
text_div.style.top = "50%";
text_div.style.left = "50%";
text_div.style.fontSize = "20px";
text_div.style.color = "white";
add_div.appendChild(text_div);
var text1=document.createTextNode("3 flashes/sec");
text_div.appendChild(text1);
//add div to top of body
document.body.insertBefore(add_div, document.body.firstChild);
setInterval(blink3, 333);
function blink3() {
var x = document.getElementById("text");
if (x.style.visibility == "hidden") {
x.style.visibility = "visible";
} else {
x.style.visibility = "hidden";
}
}
}
</script>
</body>
</html>