forked from nate-parrott/subway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
196 lines (194 loc) · 5.22 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>BART Subway Travel Time Map</title>
<meta property="og:title" content="BART Subway Travel Time Map" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://eliothertenstein.com/subway" />
<meta
property="og:image"
content="https://eliothertenstein.com/subway/og.png"
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@eiioth" />
<meta name="twitter:creator" content="@eiioth" />
<meta name="twitter:title" content="NYC Subway Travel Time Map" />
<meta
name="twitter:image"
content="https://eliothertenstein.com/subway/og.png"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
html,
body {
height: 100%;
margin: 0;
font-family: "HelveticaNeue", "Helvetica", "Arial", sans-serif;
-webkit-font-smoothing: antialiased;
}
svg {
background-color: #f8f8ff;
height: 100%;
width: 100%;
}
.tooltip {
position: absolute;
pointer-events: none;
background-color: #2a2a2f;
color: white;
font-size: small;
padding: 4px 8px;
}
svg {
cursor: -webkit-grab;
cursor: -moz-grab;
}
.stop,
.home {
cursor: default;
}
.line,
.stop,
.home {
vector-effect: non-scaling-stroke;
}
.stop {
stroke-width: 15;
stroke: transparent;
}
.hour {
stroke: rgba(0, 0, 100, 0.1);
stroke-width: 1px;
fill: transparent;
z-index: -1;
}
#info {
position: fixed;
top: 2vh;
left: 2vh;
width: 25vw;
background-color: #36363f;
color: white;
padding: 10px;
line-height: 1.4;
}
#info h1 {
font-size: 1.2em;
margin-top: 0;
border-top: 2px solid white;
padding-top: 5px;
}
#info p {
}
#info .fine-print {
opacity: 0.5;
font-size: small;
}
#explanation {
display: none;
}
a:link,
a:visited {
color: inherit;
}
#attribution {
margin-top: 2em;
text-align: right;
font-size: small;
margin-bottom: 0;
}
#timePicker h6 {
text-transform: uppercase;
font-weight: bold;
margin-bottom: 0;
}
#timePicker ul {
padding: 0;
margin-top: 0;
}
#timePicker li {
cursor: default;
opacity: 0.5;
}
#timePicker li.selected {
text-decoration: underline;
opacity: 1;
}
#timePicker li:hover {
text-decoration: underline;
}
@media screen and (max-width: 500px) {
.stop {
stroke-width: 22px;
}
#info {
width: auto;
right: 2vh;
top: auto;
bottom: 2vh;
max-height: 20vh;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
</style>
<script src="./subway.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="./schedules/transfers.js"></script>
<script src="https://unpkg.com/[email protected]/heap.js"></script>
<script src="./virtual_rider.js"></script>
<!-- Analytics -->
<script
defer
data-domain="eliothertenstein.com/subway"
src="https://analytics.eliothertenstein.com/js/plausible.js"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "UA-37604830-12");
</script>
</head>
<body>
<script src="map.js"></script>
<div id="info">
<div id="initial">
<h1>Click a Stop</h1>
</div>
<div id="explanation">
<h1>BART Travel Time Map</h1>
<p>
On this map, each stop's distance from your chosen stop is based on
the time it'll take to travel there.
</p>
<div id="timePicker">
<h6>Travel time:</h6>
<ul>
<li class="selected" data-schedule="weekday_8am">
Weekday morning rush hour
</li>
<li data-schedule="weekday_5pm">Weekday evening rush hour</li>
<li data-schedule="weekday_8pm">Weekday night</li>
<li data-schedule="sunday_afternoon">Weekend afternoon</li>
</ul>
</div>
<p class="fine-print">
Travel time predictions are based on BART's published schedule,
assuming an 8 AM weekday departure. They may be a little optimistic
these days.
</p>
<p id="attribution">
by <a href="https://github.com/eiiot">Eliot Hertenstein</a> forked
from <a href="https://twitter.com/nateparrott">Nate Parrott</a> |
<a href="https://github.com/eiiot/subway">github</a> |
<a href="./howitworks.html">how it works</a>
</p>
</div>
</div>
</body>
</html>