-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathkeyboardtest.html
114 lines (99 loc) · 3.35 KB
/
keyboardtest.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<link rel="manifest" href="/manifest.json">
<style>
html, body {
margin: 0px;
width: 100%;
height: 100%;
}
#header {
position: absolute;
top: -50px;
height: 50px;
width: 100%;
background-color: red;
transition: top 2s;
}
#header.shown {
top: 0px;
}
#leftfixed {
position: fixed;
left: 0px;
top: 0px;
width: 5px;
height: 100%;
background-color: purple;
opacity: 0.25;
}
#bottomfixed {
position: fixed;
left: 0px;
bottom: 0px;
width: 100%;
height: 5px;
background-color: purple;
opacity: 0.25;
}
#infobox {
width: 200px;
height: 50px;
}
#resizeinfo {
width: 100px;
height: 200px;
}
</style>
<script>
var fullscreen = false;
function didResize() {
refresh();
var resizebox = document.getElementById("resizeinfo");
resizebox.innerHTML += "RESIZE!<br>"
}
function toggleFullscreen() {
if (fullscreen)
document.webkitExitFullscreen();
else
document.documentElement.webkitRequestFullscreen();
fullscreen = !fullscreen;
}
function refresh() {
var infobox = document.getElementById("infobox");
infobox.innerHTML = "InnerHeight: " + window.innerHeight + "</br>";
infobox.innerHTML += "doc Height: " + document.documentElement.clientHeight;
}
window.addEventListener('load', function() {
infobox = document.getElementById('infobox');
contentbox = document.getElementById('infobox-content');
targetbox = document.getElementById('targetBox');
crossHair = document.getElementById('crossHair');
crossHairUnscaled = document.getElementById('crossHairUnscaled');
window.addEventListener('resize', didResize);
window.addEventListener('touchstart', refresh);
refresh();
});
</script>
</head>
<body>
<button onclick="toggleFullscreen()">Toggle Fullscreen</button>
<div id="infobox"></div>
<input type="text"></input>
<div id="leftfixed"></div>
<div id="bottomfixed"></div>
<div id="resizeinfo"></div>
<div id="header"></div>
</body>
<script>
//document.body.addEventListener('click', function() {
// var header = document.getElementById("header");
// if (header.className === "shown")
// header.className = "";
// else
// header.className = "shown";
//});
</script>
</html>