-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
223 lines (197 loc) · 6.72 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Weather App</title>
<meta charset="utf-8" />
<meta name="Description" content="Weather App PWA with Yahoo Weather API">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="favicon.png" />
<!-- Meta Spcific to iOS -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta
name="apple-mobile-web-app-status-bar-style"
content="black-translucent"
/>
<meta name="apple-mobile-web-app-title" content="Weather App PWA" />
<link rel="apple-touch-icon" href="favicon.png" />
<!-- Theme color for android app -->
<meta name="theme-color" content="#6c00f6" />
<!-- Metadata for windows devices -->
<meta name="application-name" content="Weather App PWA" />
<meta name="msapplication-TileColor" content="#6c00f6" />
<meta
name="msapplication-square70x70logo"
content="assets/app-icons/app_icon_72x72.png"
/>
<meta
name="msapplication-square150x150logo"
content="assets/app-icons/app_icon_96x96.png"
/>
<meta
name="msapplication-wide310x150logo"
content="assets/app-icons/app_icon_144x144.png"
/>
<meta
name="msapplication-square310x310logo"
content="assets/app-icons/app_icon_192x192.png"
/>
<!-- Stylesheet -->
<link rel="stylesheet" href="css/style.css" />
<!-- App Manifest -->
<link rel="manifest" href="manifest.json" />
</head>
<body>
<header class="header">
<div class="menu">
<a href="#" class="icon-menu">
☰
</a>
</div>
<div class="city-info">
<div class="place">--</div>
<div class="time">--</div>
<div class="locationErr">
Failed to get current location, using fallback location!
</div>
</div>
<div id="btnRefresh" class="refresh">
<a href="#" class="icon-refresh">
↻
</a>
</div>
</header>
<main>
<div class="weather-app">
<div class="basic-info">
<div id="currentWeather" class="weather-info">
<div class="w-cond">
<img class="cond-code" alt="condition code"/>
<span class="cond"></span>
</div>
<div class="temp">
<!-- TODO svg arrow with top horizontal line -->
<div class="temp-max" id="temp-max"></div>
<div class="temp-min" id="temp-min"></div>
</div>
<div class="cur-temp">
<span></span>
</div>
</div>
</div>
<div class="detailed-info">
<!-- Weather forecast -->
<div id="forecast" class="card">
<div class="title">
Forecast
</div>
<!-- <div id="hourly-forecast" class="hourly-forecast">
Temperature
</div> -->
<div id="daily-forecast" class="daily-forecast"></div>
</div>
<!-- <div id="precipitation" class="card">
<div class="title">
Precipitation
</div>
<div>
<span>Morning</span>
<span>Noon</span>
<span>Evening</span>
<span>Night</span>
</div>
</div> -->
<div id="wind-pressure" class="card">
<div class="title">
Wind & Pressure
</div>
<div class="wind-pressure-forecast">
<div class="wind-icon">
<img class="turbine" alt="tubine" />
<!-- <img class="turbine-small"/> -->
</div>
<div class="details">
<div class="padding-bottom-border">
<span class="wind"></span>
</div>
<div class="padding-top">
<span class="pressure"></span>
</div>
</div>
</div>
</div>
<div id="weather-details-container" class="card">
<div class="title">
Details
</div>
<div class="weather-details">
<div class="cond-icon">
<img class="weather-condition-icon" alt="weather condition"/>
</div>
<div class="details">
<div class="padding-bottom-border">
Feels like <span class="feels-like"></span>
</div>
<div class="padding-bottom-border padding-top">
Humidity <span class="humidity"></span>
</div>
<div class="padding-bottom-border padding-top">
Visibility <span class="visibility"></span>
</div>
<div class="padding-top">UV Index <span>0 (low)</span></div>
</div>
</div>
</div>
<div id="astro" class="card">
<div class="title">
Sun & Moon
</div>
<div class="astro-details">
<div class="sun-pos">
<canvas id="astro-img" width="200" height="120"></canvas>
</div>
<div class="details">
<div class="padding-bottom-border">
Sunrise <span class="sunrise"></span>
</div>
<div class="padding-top">
Sunset <span class="sunset"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- service worker inject -->
<!-- <script src="js/script.js"></script> -->
<script>
let swRegistration = null
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('./sw.js')
.then(registration => {
// Registration was successful
swRegistration = registration;
console.log(
'ServiceWorker registration successful with scope: ',
registration.scope
);
// register push
// initializeUI()
})
.catch(err => {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>
<!-- script inject -->
<script src="js/constant.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"></script>
<script src="js/util.js"></script>
<script src="js/app.js"></script>
</body>
</html>