-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
238 lines (208 loc) · 10.1 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>High Tide Flooding</title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/plotly.js/1.58.4/plotly-basic.min.js" integrity="sha512-7S1p+6A2VVIWu+EevZqeqXWos1Tn+mroZxpkZ9THWipecJkL7TLg2myv5cIAShu9j3+fjHyCvEh/d7BKegMY1g==" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap" rel="stylesheet">
<!-- <script src="dist/tidalstationswidget.js"></script>-->
<style>
.navbar.navbar-default {
padding: 0;
margin: 0;
height: 120px;
}
.navbar.navbar-default .navbar-brand img {
height: 100px;
width: 300px;
padding: 0;
margin: 0;
left: 0;
}
.navbar.selector {
margin-top: 35px;
}
.row {
margin-left: 0;
margin-right: 0;
}
#tidal-chart {
width: 100%;
}
#chart {
width: 100%;
height: 70vh;
}
html, body {
font-size: 100%;
}
/*
#zoom-btn {
align
} */
</style>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<span class="navbar-text">
<h1>High Tide Flooding</h1>
</span>
<ul class="nav navbar-nav navbar-right">
<ul>
<div class="row">
<div class="navbar selector">
<form class="navbar-form pull-right">
<button type="button" class="btn btn-danger" id="zoom-btn">Historical Mode <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span></button>
<select name="" id="station" class="form-control" style="width: 200px;">
<option value="" disabled selected hidden>Station</option>
<option value="1611400">Nawiliwili, HI</option>
<option value="1612340">Honolulu, HI</option>
<option value="1612480">Mokuoloe, HI</option>
<option value="1615680">Kahului, HI</option>
<option value="1617433">Kawaihae, HI</option>
<option value="1617760">Hilo, HI</option>
<option value="1619910">Midway Island</option>
<option value="1630000">Apra Harbor, Guam</option>
<option value="1770000">Pago Pago, American Samoa</option>
<option value="1820000">Kwajalein Island</option>
<option value="1890000">Wake Island</option>
<option value="8413320">Bar Harbor, ME</option>
<option value="8418150">Portland, ME</option>
<option value="8443970">Boston, MA</option>
<option value="8447930">Woods Hole, MA</option>
<option value="8449130">Nantucket Island, MA</option>
<option value="8452660">Newport, RI</option>
<option value="8454000">Providence, RI</option>
<option value="8461490">New London, CT</option>
<option value="8467150">Bridgeport, CT</option>
<option value="8510560">Montauk, NY</option>
<option value="8516945">Kings Point, NY</option>
<option value="8518750">The Battery, NY</option>
<option value="8519483">Bergen Point, NY</option>
<option value="8531680">Sandy Hook, NJ</option>
<option value="8534720">Atlantic City, NJ</option>
<option value="8536110">Cape May, NJ</option>
<option value="8545240">Philadelphia, PA</option>
<option value="8551910">Reedy Point, DE</option>
<option value="8557380">Lewes, DE</option>
<option value="8571892">Cambridge, MD</option>
<option value="8573364">Tolchester Beach, MD</option>
<option value="8574680">Baltimore, MD</option>
<option value="8575512">Annapolis, MD</option>
<option value="8577330">Solomons Island, MD</option>
<option value="8594900">Washington, DC</option>
<option value="8631044">Wachapreague, VA</option>
<option value="8632200">Kiptopeke, VA</option>
<option value="8635750">Lewisetta, VA</option>
<option value="8636580">Windmill Point, VA</option>
<option value="8638610">Sewells Point, VA</option>
<option value="8638863">Chesapeake Bay Bridge, VA</option>
<option value="8651370">Duck, NC</option>
<option value="8652587">Oregon Inlet, NC</option>
<option value="8656483">Beaufort, NC</option>
<option value="8658120">Wilmington, NC</option>
<option value="8661070">Springmaid Pier, SC</option>
<option value="8665530">Charleston, SC</option>
<option value="8670870">Fort Pulaski, GA</option>
<option value="8720030">Fernandina Beach, FL</option>
<option value="8720218">Mayport, FL</option>
<option value="8721604">Trident Pier, FL</option>
<option value="8723214">Virginia Key, FL</option>
<option value="8723970">Vaca Key, FL</option>
<option value="8724580">Key West, FL</option>
<option value="8725110">Naples, FL</option>
<option value="8725520">Fort Myers, FL</option>
<option value="8726520">St. Petersburg, FL</option>
<option value="8726724">Clearwater, FL</option>
<option value="8727520">Cedar Key, FL</option>
<option value="8728690">Apalachicola, FL</option>
<option value="8729108">Panama City, FL</option>
<option value="8729210">Panama City Beach, FL</option>
<option value="8729840">Pensacola, FL</option>
<option value="8735180">Dauphin Island, AL</option>
<option value="8747437">Bay Waveland, MS</option>
<option value="8761724">Grand Isle, LA</option>
<option value="8770570">Sabine Pass, TX</option>
<option value="8770613">Morgans Point, TX</option>
<option value="8771013">Eagle Point, TX</option>
<option value="8771450">Galveston Pier 21, TX</option>
<option value="8774770">Rockport, TX</option>
<option value="8775870">Corpus Christi, TX</option>
<option value="8779770">Port Isabel, TX</option>
<option value="9410170">San Diego, CA</option>
<option value="9410230">La Jolla, CA</option>
<option value="9410660">Los Angeles, CA</option>
<option value="9410840">Santa Monica, CA</option>
<option value="9412110">Port San Luis, CA</option>
<option value="9413450">Monterey, CA</option>
<option value="9414290">San Francisco, CA</option>
<option value="9414750">Alameda, CA</option>
<option value="9415020">Point Reyes, CA</option>
<option value="9415144">Port Chicago, CA</option>
<option value="9416841">Arena Cove, CA</option>
<option value="9418767">Humboldt Bay, CA</option>
<option value="9431647">Port Orford, CA</option>
<option value="9432780">Charleston, OR</option>
<option value="9435380">South Beach, OR</option>
<option value="9440910">Toke Point,WA</option>
<option value="9444090">Port Angeles, WA</option>
<option value="9444900">Port Townsend, WA</option>
<option value="9447130">Seattle, WA</option>
<option value="9449424">Cherry Point, WA</option>
<option value="9449880">Friday Harbor, WA</option>
<option value="9751401">Lime Tree Bay, VI</option>
<option value="9751639">Charlotte Amalie, VI</option>
<option value="9755371">San Juan, PR</option>
<option value="9759110">Magueyes Island, PR</option>
</select>
<a type="button" id="download-tidal-image" href="javascript:void(0)">Download Image</a>
</form>
</div>
</div>
</ul>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12" style="padding:2rem;">
<div id="tidal-chart"></div>
</div>
</div>
</div>
<script type="module">
import TidalStationWidget from './tidalstationswidget.js';
const widget = new TidalStationWidget($('#tidal-chart')[0], {
data_url: 'https://crt-climate-explorer.nemac.org/data/high-tide-flooding-widget/tidal_data.json'
});
let zoomed = false;
$('#station').change(function () {
widget.request_update({'station': $('#station').val()});
zoomed = false;
$('#zoom-btn').css({"background-color": "#c9302c", "border-color": "#ac2925"})
});
$('#zoom-btn').click(function () {
widget.zoomToggle();
zoomed = !zoomed;
if (zoomed) {
$('#zoom-btn').css({"background-color": "green", "border-color": "green"});
} else {
$('#zoom-btn').css({"background-color": "#c9302c", "border-color": "#ac2925"})
}
});
$('#download-tidal-image').click(function (e) {
e.preventDefault();
widget.request_download_image();
});
</script>
</body>
</html>