-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
355 lines (278 loc) · 14.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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!DOCTYPE html>
<html>
<!--stretch goal, refactor using shadow dom-->
<!--standard boilerplate stuff-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
<script src="main.js"></script>
</head>
<!--start of the interesting stuff-->
<body>
<!--basic user settings-->
<div id="settings">
Measurement system:
<!--inputs for switching unit system-->
<input name="unitSettings" type="radio" id="imperial" onclick="setImperial();" checked="true"/>
<label for="imperial">Imperial</label>
<input name="unitSettings" type="radio" id="metric" onclick="setMetric();"/>
<label for="metric">Metric</label>
</div>
<!--search box at top of screen which is always visible-->
<div>
<p class="sectionHeader" id="websiteTitle">Zev's Weather Website</p>
<!--text telling the user what the search boxes are for-->
<div class="row">
<p class="sectionHeader" style="margin-left: 23%;">Search by Zip Code</p>
<p class="sectionHeader" style="margin-left: 15%;">Search by City + State</p>
</div>
<!--the search boxes themselves-->
<div class="row" id="weatherSearchBoxes">
<input id="zipInput">
<button class="submitButton" style="margin-right: 9%;" onclick="findZip();">Submit</button>
OR
<label for="cityInput" class="inputLabel" style="margin-left: 6%;">City:</label>
<input id="cityInput">
<label for="stateInput" class="inputLabel" style="margin-left: 1%;">State:</label>
<input id="stateInput">
<button onclick="findCityState();" class="submitButton">Submit</button>
</div>
<!--divs for infomring the user when their input has an error-->
<div id="zipError" class="errorDiv">Zip code must be in the format of 00000</div>
<div id="cityStateError" class="errorDiv">Both city and state must be filled out!</div>
<div id="stateError" class="errorDiv">State not found! Tip: you can use the two letter abbreviation for the state</div>
<div id="apiError" class="errorDiv">No location found for given location!</div>
</div>
<!--all of the data that gets displayed once a user enters a zipcode-->
<div id="result">
<!--telling the user where the api is pulling data from-->
<div id="apiAddress" class="sectionHeader">Wallingford, CT</div>
<!--inputs for toggling hourly and weekly forecasts-->
<div class="row">
<button id="hourlyToggle" class="forecastToggle" onclick="toggleHourly();" style="margin-left: 35%;">Show/Hide Hourly Forecast</button>
<button id="weeklyToggle" class="forecastToggle" onclick="toggleWeekly();">Show/Hide Weekly Forecast</button>
</div>
<hr noshade="true" color="black"/>
<!--A header telling the user this is the hourly forecast-->
<div id="hourlyForecastHeader" class="sectionHeader">Hourly Forecast</div>
<!--boxes displaying info for hourly forecast-->
<div id="hourlyForecastBox" class="row">
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData" style="border-right: 0vh;">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
<div class="hourData">
<p class="hourHeader">10am</p>
<hr noshade="true" color="black"/>
<img src="assets/cloudy.png" class="containerImage">
<div class="hourWindDiv">
<img src="assets/windSpeed.png" class="hourWindImage">
<p class="hourWindText">10 mph</p>
</div>
<p class="hourTemp">72°</p>
</div>
</div>
<!--A header telling the user this is the weekly forecast-->
<div id="weeklyForecastHeader" class="sectionHeader">Weekly Forecast</div>
<!--boxes displaying overview for each day of the week-->
<div id="weeklyForecastBox" class="row">
<div class="dayData" style="border-right: 0vh;">
<p class="dayHeader">Monday</p>
<hr noshade="true" color="black"/>
<img src="./assets/sunny.png" class="containerImage">
<div class="dayRainDiv">
<img src="assets/rainChance.png" class="dayRainImage">
<p class="dayRainText">30%</p>
</div>
<div class="highLowContainer">
<p class="high">H: 80°</p>
<p class="low">L: 69°</p>
</div>
</div>
<div class="dayData" style="border-right: 0vh;">
<p class="dayHeader">Monday</p>
<hr noshade="true" color="black"/>
<img src="./assets/sunny.png" class="containerImage">
<div class="dayRainDiv">
<img src="assets/rainChance.png" class="dayRainImage">
<p class="dayRainText">30%</p>
</div>
<div class="highLowContainer">
<p class="high">H: 80°</p>
<p class="low">L: 69°</p>
</div>
</div>
<div class="dayData" style="border-right: 0vh;">
<p class="dayHeader">Monday</p>
<hr noshade="true" color="black"/>
<img src="./assets/sunny.png" class="containerImage">
<div class="dayRainDiv">
<img src="assets/rainChance.png" class="dayRainImage">
<p class="dayRainText">30%</p>
</div>
<div class="highLowContainer">
<p class="high">H: 80°</p>
<p class="low">L: 69°</p>
</div>
</div>
<div class="dayData" style="border-right: 0vh;">
<p class="dayHeader">Monday</p>
<hr noshade="true" color="black"/>
<img src="./assets/sunny.png" class="containerImage">
<div class="dayRainDiv">
<img src="assets/rainChance.png" class="dayRainImage">
<p class="dayRainText">30%</p>
</div>
<div class="highLowContainer">
<p class="high">H: 80°</p>
<p class="low">L: 69°</p>
</div>
</div>
<div class="dayData" style="border-right: 0vh;">
<p class="dayHeader">Monday</p>
<hr noshade="true" color="black"/>
<img src="./assets/sunny.png" class="containerImage">
<div class="dayRainDiv">
<img src="assets/rainChance.png" class="dayRainImage">
<p class="dayRainText">30%</p>
</div>
<div class="highLowContainer">
<p class="high">H: 80°</p>
<p class="low">L: 69°</p>
</div>
</div>
<div class="dayData" style="border-right: 0vh;">
<p class="dayHeader">Monday</p>
<hr noshade="true" color="black"/>
<img src="./assets/sunny.png" class="containerImage">
<div class="dayRainDiv">
<img src="assets/rainChance.png" class="dayRainImage">
<p class="dayRainText">30%</p>
</div>
<div class="highLowContainer">
<p class="high">H: 80°</p>
<p class="low">L: 69°</p>
</div>
</div>
<div class="dayData">
<p class="dayHeader">Monday</p>
<hr noshade="true" color="black"/>
<img src="./assets/sunny.png" class="containerImage">
<div class="dayRainDiv">
<img src="assets/rainChance.png" class="dayRainImage">
<p class="dayRainText">30%</p>
</div>
<div class="highLowContainer">
<p class="high">H: 80°</p>
<p class="low">L: 69°</p>
</div>
</div>
</div>
</div>
</body>