-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
42 lines (35 loc) · 873 Bytes
/
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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Elm TransitRouter example</title>
<script type="text/javascript" src="/dist/example.js"></script>
<style type="text/css" media="screen">
body {
background-color: #EEE;
font-family: sans-serif;
padding: 20px;
overflow-x: hidden;
}
.menu a {
display: inline-block;
margin-right: 10px;
}
.content {
margin-top: 20px;
}
</style>
</head>
<body>
</body>
<script type="text/javascript">
var app = Elm.Main.fullscreen(document.location.pathname);
app.ports.setPath.subscribe(function(path) {
history.pushState({}, "", path);
app.ports.pathUpdates.send(path);
});
window.onpopstate = function(event) {
app.ports.pathUpdates.send(document.location.pathname);
};
</script>
</html>