-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
40 lines (40 loc) · 1.04 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Stellaris</title>
<link rel="stylesheet" href="bootstrap.min.css"/>
<link rel="stylesheet" href="style.css"/>
<link rel="stylesheet" href="ethoses.css"/>
</head>
<body>
<div id="app"></div>
<div class="alert alert-info">
Hint : you can share your race by copying the URL.
</div>
<script src="main.js"></script>
<script>
var app = window.StellarisRaceMaker = Elm.embed(
Elm.Main,
document.getElementById("app"),
{
path: ""
}
);
app.ports.newPath.subscribe(function (path) {
if (encodeURI(path) !== window.location.search) {
window.history.pushState({}, "", path);
}
});
function sendPath (path) {
app.ports.path.send(path);
}
window.addEventListener("load", function (event) {
sendPath(decodeURI(window.location.search));
});
window.addEventListener("popstate", function (event) {
sendPath(decodeURI(window.location.search));
});
</script>
</body>
</html>