-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (27 loc) · 841 Bytes
/
index.html
File metadata and controls
37 lines (27 loc) · 841 Bytes
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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="elm.js"></script>
<script type="text/javascript" src="vendor/mousetrap.min.js"></script>
<link rel="stylesheet" href="normalize.css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<div id="app"></div>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', initialize, false);
const shortcuts = ["left","right", "up", "down", "alt+left","alt+right","alt+up", "alt+down"];
const needOverride= ["alt+left", "alt+right"];
function initialize() {
var app = Elm.Main.init({node : document.getElementById("app"), flags : null });
Mousetrap.bind(shortcuts, function(e, s) {
app.ports.keyboard.send(s);
if (needOverride.includes(s)) {
return false;
}
});
}
</script>
</body>
</html>