-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
32 lines (32 loc) · 1.02 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="user-scalable=no">
<title>Effective JavaScript: Frogger</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>Controls</h1>
<p>
Use up, down, left, right keys or safari mobile users can
alternatively use w, a, s, d keys to move the player.
</p>
<input type="text" id="keyboard">
<a class="keyboard-link" href="#" onclick="document.getElementById('keyboard').focus();">
click here to get keyboard (if you are from mobile devices)
</a>
<script>
var keyboardElm = document.getElementsByClassName("keyboard-link")[0];
window.addEventListener("resize", showKeyboard);
function showKeyboard() {
if (window.innerWidth < 700) {
keyboardElm.setAttribute("style", "display: block;")
}
}
</script>
<script src="js/resources.js"></script>
<script src="js/app.js"></script>
<script src="js/engine.js"></script>
</body>
</html>