-
Notifications
You must be signed in to change notification settings - Fork 0
/
ElmInSpace.html
37 lines (32 loc) · 967 Bytes
/
ElmInSpace.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
<html>
<head>
<title>Elm In Space!</title>
<script type="text/javascript" src="ElmInSpace.js"></script>
<script src='https://cdn.firebase.com/js/client/2.2.1/firebase.js'></script>
<style>
body {
background-color: #000000;
font-family: helvetica, arial, sans-serif;
font-size: 14px;
}
#elminspace {
width: 960px; height: 540px;
border: 1px solid #111111;
margin: auto; position: absolute;
left: 0; right: 0; top: 0; bottom: 15%;
}
</style>
</head>
<body>
<div id="elminspace" />
</body>
<script type="text/javascript">
var elmDiv = document.getElementById('elminspace');
// generate a random integer ...
var rng = (Math.random() * 1000000000) | 0;
console.log("Sending rng=" + rng + " to application");
// ... and start Elm with it
var elminspace = Elm.ElmInSpace;
elminspace.ports.jsRNG.send(rng);
</script>
</html>