-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
291 lines (263 loc) · 15.3 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
<HTML>
<HEAD>
<TITLE>WeatherMe</TITLE>
<link rel="shortcut icon" href="images/weatheme2.png" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="css/materialize.css" media="screen, projection" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="css/weather-icons.css" />
<link type="text/css" rel="stylesheet" href="styles.css" media="screen, projection" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#4fa584">
<link rel="manifest" href="manifest.json">
<!-- ios support -->
<link rel="apple-touch-icon" href="/icons/icon-96x96.png">
<meta name="apple-mobile-web-app-status-bar" content="#FFE1C4">
</HEAD>
<body>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
<header class="mdl-layout__header hide-on-large-only z-depth-3" style="display: fixed;">
<div class="mdl-layout__header-row">
<div class="mdl-layout-spacer"></div>
<img src="images/weatheme2.png" width="32px" height="32px">
<span class="mdl-layout-title">The Weather App</span>
<div class="mdl-layout-spacer"></div>
<button class="mdl-button mdl-js-button mdl-button--icon main-menu" onclick="refresh()">
<i class="material-icons">refresh</i>
</button>
</div>
</header>
<!--Right Side Nav Drawer-->
<div id="rightNav" class="mdl-layout__drawer mdl-layout--fixed-drawer drawer-right hide-on-small-and-down">
<!--Date Widget-->
<div class="my-date">
<p
style="text-align: center; font-weight: bold; color: #eee; font-family: Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif">
Last
updated</p>
<span id="time" style="font-weight: bold; color: white;" align="center">Time</span>
<span id="wday" style="font-weight: bold; color: white;" align="center">Day</span>
<h2 align="center" style="font-weight: bold; color: white;" id="mdate">00</h2>
<div class="moye">
<span id="month" style="font-weight: bold; color: white;">Month</span>
<span id="year" style="font-weight: bold; color: white;"> Year</span>
</div>
</div>
<div class="mdl-layout-title subtitle" style="margin-top: 10px;">
<img src="images/place.png" class="nav-icon">
<span style="padding: 4 18 0 4;">Locations</span>
<button class="mdl-button mdl-js-button mdl-button--icon" onclick="getLocation()">
<i class="material-icons">my_location</i>
</button>
</div>
<nav id="locationList" class="mdl-navigation my-nav">
<form
style="margin: 0px 7%; font-family: Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif">
<div class="input-field" style="margin-top: 30px;">
<input id="addLocation" type="text" class="validate" style="color: var(--text)">
<label style="width: auto" for="addLocation">Add location</label>
</div>
<a id="fab" class="btn-floating waves-effect scale-transition scale-out" style="float: right">
<i class="material-icons prefix">add</i>
</a>
</form>
</nav>
</div>
<!--Mobile side Nav-->
<div class="mdl-layout__drawer">
<header class="nav-drawer-header">
<img src="icons/weatherme.png" class="nav-avatar">
</header>
<span class="mdl-layout-title site-title">WeatherMe</span>
<nav class="mdl-navigation my-nav">
</nav>
<nav id="mobileLocation" class="mdl-navigation my-nav hide-on-med-and-up">
<div class="mdl-layout-title subtitle">
<img src="images/place.png" class="nav-icon">
<span style="padding: 4 18 0 4;">Locations</span>
<button class="mdl-button mdl-js-button mdl-button--icon" onclick="getLocation()">
<i class="material-icons">my_location</i>
</button>
</div>
</nav>
<nav class="mdl-navigation my-nav">
<a class="mdl-navigation__link" style="cursor: default;">
Units
<form class="prefs">
<p style="margin-bottom: 8px; margin-top: 10px;">
<label>
<input name="tempunit" type="radio" checked class="with-gap" value="metric"
onclick="changeUnit()" />
<span> °C</span>
</label>
</p>
<p style="margin: 0px;">
<label>
<input name="tempunit" type="radio" class="with-gap" value="imperial"
onclick="changeUnit()" />
<span> °F</span>
</label>
</p>
</form>
</a>
<a class="mdl-navigation__link" style="cursor: default;">
Theme
<form>
<div class="switch">
<label>
Dark Theme
<input name="theme" type="checkbox" onclick="themer()">
<span class="lever"></span>
</label>
</div>
</form>
</a>
</nav>
</div>
<main class="mdl-layout__content">
<div class="page-content">
<!-- Main content goes here -->
<div class="row">
<div class="col s12">
<div class="card z-depth-2 main-card loading">
<div id="grad" class="card-image">
<span id="location" class="card-subtitle"></span>
<span id="mainIcon"></span>
<span id="temp" class="main-temp">--</span>
</div>
<div class="card-content info" style="padding: 10px 10px 0px 10px;">
<div id="loader" class="progress">
<div class="indeterminate"></div>
</div>
<div style="overflow: hidden;"></div>
<div id="content" class="hide">
<div class="row">
<div class="col s8">
<h4 style="margin: 0px; margin-top: 5px;">
<span id="title" class="col s12 card-title ui-text truncate">No data
available..</span>
</h4>
<span id="desc" class="col s12 ui-text" style="padding:0 16px;"></span>
</div>
<div class="col s4 feels-like">
<h6>Feels like</h6>
<span id="fl-temp"></span>
</div>
</div>
<div class="divider"></div>
<div class="row" style="margin: 0px; padding-bottom: 10px">
<div class='ui'>
<div class="col s6 ">
<div class='ui_box col s12'>
<div class="stat-text">
<h5>
<i class="wi wi-raindrop"></i> Humidity
</h5>
<div class='ui_box__inner'>
<div class='stat'>
<span id="humid">--</span>
</div>
<div class='progress'>
<div class='progress_bar' id="humidBar"></div>
</div>
</div>
</div>
</div>
</div>
<div class="col s6 ">
<div class='ui_box col s12'>
<div class="stat-text">
<h5>
<i
class="wi wi-strong-wind"></i> Wind
</h5>
<div class='ui_box__inner'>
<div class='stat'>
<span id="wind">--</span>
</div>
<div class='progress' style="height: 0px"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="divider"></div>
<div
style="padding: 12px 5%; display: flex; justify-content: space-between; color: var(--text)">
<div>
<i class="wi wi-sunrise"></i>
<span id="sr">Sunrise:</span>
</div>
<div>
<i class="wi wi-sunset"></i>
<span id="ss">Sunset:</span>
</div>
</div>
</div>
</div>
</div>
<div class="card z-depth-2" style="border-radius:10px !important;">
<div class="row" style="margin: 0px; padding-bottom: 10px;">
<div class="col s12">
<div class="card-content">
<span class="card-title"
style="padding:10px; font-size:16px; text-align:center;">Temperature
variation (7 Day forecast)</span>
</div>
</div>
<div class="col s12 chart-wrapper">
<div class="chartbox" id="chart-container"
style="position: relative; height: 40vh;">
<canvas id="canvas"></canvas>
</div>
</div>
</div>
</div>
<div class="card z-depth-2" style="border-radius:10px !important;">
<div class="row" style="margin: 0px; padding-bottom: 10px">
<div class="card-content">
<span class="card-title"
style="padding:10px; font-size:16px; text-align:center;">Cloud cover</span>
<div id="cload" class="progress">
<div class="indeterminate"></div>
</div>
</div>
<div id="graph" class="hide">
<div class="col s4 xs">
<div class='ui col s12'>
<div class="stat-text">
<div class='ui_box__inner' style="padding-top: 10px">
<div class='stat'>
<h5 style="display:inline">
<i class="wi wi-cloud"></i> Clouds
</h5>
<span id="cloudCover">--</span>
</div>
<div class='progress'>
<div class='progress_bar' id="cloudBar"></div>
</div>
</div>
</div>
</div>
</div>
<div class="col s8 xs chart-wrapper" style="position: relative; height:25vh;">
<div class="chartbox" id="cloud-chart-container">
<canvas id="cloudCanvas"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
<script src="js/material.min.js"></script>
<script src="js/materialize.min.js"></script>
<script src="js/controller.js"></script>
<script src="js/ui.js"></script>
<script src="js/app.js"></script>
</body>
</HTML>