-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoffline.html
241 lines (194 loc) · 7.24 KB
/
offline.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
<!doctype html>
<html lang="en">
<head>
<title>Umbrella</title>
<meta property="og:title" content="Umbrella">
<meta name="description" content="A simple weather page that tells you if you need to take an umbrella when going outside.">
<meta property="og:description" content="A simple weather page that tells you if you need to take an umbrella when going outside.">
<meta property="og:image" content="https://vardecab.github.io/umbrella/images/social-sharing/umbrella-facebook-ogimage-v2.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:url" content="https://vardecab.github.io/umbrella/umbrella-en.html">
<meta name="twitter:card" content="summary_large_image">
<meta name="theme-color" content="#505050">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./images/umbrella-icon_blue-circle.png" />
<!-- <link rel="stylesheet" href="./styles/styles.css" /> -->
<!-- <script src="./scripts/weather.js"></script> -->
<!-- <script src="./scripts/air_quality.js"></script> -->
<!-- <script src="./scripts/allergy.js"></script> NOTE: API doesn't have good coverage -->
<!-- <script src="./scripts/libraries/moment.min.js"></script> time formats manipulation -->
<!-- <script src="./scripts/libraries/js.cookie.min.js"></script> lightweight JavaScript API for handling browser cookies -->
</head>
<body>
<style>
@import url('https://fonts.googleapis.com/css?family=Reem+Kufi&display=swap');
/* @import url('https://fonts.googleapis.com/css?family=Fira+Code:300,400,500,600,700&display=swap'); */
@import url('https://fonts.googleapis.com/css?family=Mali:300,400,500,700&display=swap');
body {
/* background: linear-gradient(2deg,
rgba(198, 198, 198, 1) 40%,
rgba(228, 228, 228, 1) 60%) no-repeat center center fixed;
background-size: cover !important;
-webkit-background-size: cover !important;
-moz-background-size: cover !important;
-o-background-size: cover !important; */
background: #505050;
font-family: "Mali", monospace;
color: #ffffff;
text-align: center;
height: 100vh;
margin: 0;
}
/* === styling specific elements === */
#icon {
width: 125px;
height: 125px;
margin-bottom: 3%;
margin-top: 15%;
}
#temperature,
#temperature_offline {
font-size: 4rem;
font-family: "Reem Kufi", monospace !important;
/* font-weight: bold; */
margin-bottom: 3%;
}
#temperature:hover+#more_details {
display: block;
}
#more_details {
margin-top: -4%;
margin-bottom: 2.5%;
display: none;
}
#umbrella,
#umbrella_offline,
#loading {
font-size: 1.9rem;
font-weight: 500;
margin: auto;
margin-bottom: 3%;
/* width: 65%; */
}
#clothes {
margin-bottom: 3%;
font-size: 1.2rem;
font-weight: 400;
}
#air_quality {
font-weight: 400;
}
#bottom_navbar {
overflow: hidden;
position: fixed;
bottom: 0;
width: 100%;
}
#bottom_navbar p,
a {
float: right;
display: block;
color: #ffffff;
padding-top: 0px;
padding-bottom: 0px;
padding-left: 3px;
padding-right: 14px;
text-decoration: none;
}
/* === layout === */
.container {
position: relative;
width: 100%;
max-width: 960px;
margin: 0 auto;
padding: 0 20px;
box-sizing: border-box;
}
.column,
.columns {
width: 100%;
box-sizing: border-box;
}
/* === RWD === */
/* Small mobile phone, eg iPhone 4 */
@media (max-width: 320px) and (max-height: 480px) {
#icon {
height: 75px;
width: 75px;
margin-top: 10% !important;
/* NOTE: doesn't work without "important" */
}
}
/* Mobile phone, eg SGS5, iPhones */
@media (min-width: 300px) and (max-width: 450px) {
#icon {
margin-top: 30%;
}
}
/* Should cover both iPad and iPad Pro */
@media (min-width: 450px) and (max-width: 1025px) and (min-height: 1000px) {
#icon {
margin-top: 35% !important;
}
}
/* Browser at horizontally 1/3 size on laptop */
@media (min-width: 500px) and (max-width: 600px) {
#icon {
margin-top: 30%;
}
}
/* My usual browser size on laptop */
@media screen and (min-height: 400px) and (max-height: 650px) and (min-width: 800px) {
#icon {
margin-top: 5% !important;
}
}
/* Computer w/ Full HD screen */
@media (min-width: 1800px) {
#icon {
margin-top: 25%;
}
}
/* Computer w/ Full HD screen - half size */
@media (min-width: 950px) and (min-height: 1000px) {
#icon {
margin-top: 30% !important;
}
}
/* Computer w/ 4K screen */
@media (min-width: 2560px) {
/* TODO: */
}
</style>
<div class="container">
<div class="row">
<div class="twelve columns">
<img src="./images/status/no-connection.svg" id="icon"></<img>
<div id="temperature_offline"></div>
<div id='loading' style="font-weight: 300;">No Internet connection 😢</div>
<div id='description_offline'>Weather conditions: </div>
</div>
</div>
</div>
<div id="bottom_navbar">
<p id="location"></p>
<p id="time_of_update">Last update: </p>
</div>
<script>
var get_time_of_update = localStorage.getItem('localStorage_time_of_update_key');
var time_of_update_text = document.getElementById("time_of_update");
time_of_update_text.textContent += get_time_of_update;
var get_localStorage_temp = localStorage.getItem('localStorage_temperature_key');
document.getElementById("temperature_offline").innerHTML = get_localStorage_temp + "°";
var get_localStorage_description = localStorage.getItem('localStorage_description_key');
document.getElementById("description_offline").textContent += get_localStorage_description;
var get_localStorage_location = localStorage.getItem('localStorage_location_key');
document.getElementById("location").textContent += get_localStorage_location;
if (navigator.onLine === true) {
window.location = 'umbrella.html';
}
</script>
</body>
</html>