-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (53 loc) · 1.84 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
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Chicago Bus Routes CanJS Bus Demo">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Chicago Bus Routes CanJS Bus Demo</title>
<link href="assets/css/style.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Catamaran" rel="stylesheet">
</head>
<body>
<script id="app-view" type="text/stache">
<div class="top">
<div class="header">
<h1>{{title}}</h1>
{{#if(routesPromise.isPending)}}<p>Loading routes…</p>{{/if}}
{{#if(vehiclesPromise.isPending)}}<p>Loading vehicles…</p>{{/if}}
</div>
<ul class="routes-list">
{{#each(routesPromise.value)}}
<li on:click="pickRoute(this)" {{#eq(this, route)}}class="active"{{/eq}}>
<span class="route-number">{{this.rt}}</span>
<span class="route-name">{{this.rtnm}}</span>
<span class="check">✔</span>
</li>
{{/each}}
</ul>
</div>
<div class="bottom">
{{#if(route)}}
<div class="route-selected" on:click="pickRoute(route)">
<small>Route {{route.rt}}:</small> {{route.rtnm}}
{{#if(vehiclesPromise.isRejected)}}
<div class="error-message">No vehicles available for this route</div>
{{/if}}
</div>
{{/if}}
<google-map-view vehicles:from="vehiclesPromise.value"/>
<div class='gmap'>Bus count: {{vehiclesPromise.value.length}}</div>
</div>
</script>
<script src="https://unpkg.com/can@3/dist/global/can.all.js"></script>
<script>
window.googleAPI = new Promise(function(resolve){
const script = document.createElement("script");
script.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyD7POAQA-i16Vws48h4yRFVGBZzIExOAJI";
document.body.appendChild( script );
script.onload = resolve;
});
</script>
<script type="text/javascript" src="assets/js/bustracker.js"></script>
</body>
</html>