-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.html
58 lines (47 loc) · 1.66 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
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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="keywords" content="game,two-player,action">
<meta name="description" content="Action game for two players, written in Elm http://elm-lang.org">
<meta name="author" content="Stefan Kreitmayer">
<title>Elm Joust</title>
<script type="text/javascript" src="target/elm.js"></script>
</head>
<body style="margin: 0; padding: 0; background-color: #012;">
<div id="root"></div>
</body>
<script type="text/javascript">
var app = Elm.Main.init({
node: document.getElementById("root"),
flags: {
height: window.innerHeight,
width: window.innerWidth
}
});
document.addEventListener("keydown", function(event) {
app.ports.keyDown.send(event.key);
}, true);
document.addEventListener("keyup", function(event) {
app.ports.keyUp.send(event.key);
}, true);
document.addEventListener("onresize", function() {
j = {
height: window.innerHeight,
width: window.innerWidth
}
app.ports.onResize.send(j);
}, true);
</script>
<noscript>
<div style="text-align: center; font-family: Helvetica,Verdana,sans; padding: 1em; position: absolute; top: 50%; left: 50%; margin-right: -50%; transform: translate(-50%, -50%);">
<h1>Hello visitor!</h1>
<p>Please enable JavaScript in your browser.</p>
<p>
Not sure how?
<a href="http://enable-javascript.com/" target="_blank">Click here.</a>
</p>
</div>
</noscript>
</html>