/
index.html
308 lines (270 loc) · 11.5 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
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aire Libre</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="./style/normalize.css">
<link rel="stylesheet" href="./style/master.css">
<link rel="stylesheet" href="./style/custom-map-marker-icon.css">
<style type="text/css">
.reading-info--is-good .leaflet-popup-content-wrapper,
.reading-info--is-good .leaflet-popup-tip,
.leaflet-tooltip.reading-info--is-good {
background-color: #A2DC61;
}
.reading-info--is-moderate .leaflet-popup-content-wrapper,
.reading-info--is-moderate .leaflet-popup-tip,
.leaflet-tooltip.reading-info--is-moderate {
background-color: #FBD651;
}
.reading-info--is-sensitive .leaflet-popup-content-wrapper,
.reading-info--is-sensitive .leaflet-popup-tip,
.leaflet-tooltip.reading-info--is-sensitive {
background-color: #FD9A57;
}
.reading-info--is-unhealthy .leaflet-popup-content-wrapper,
.reading-info--is-unhealthy .leaflet-popup-tip,
.leaflet-tooltip.reading-info--is-unhealthy {
background-color: #FF6A6E;
}
.reading-info--is-very-unhealthy .leaflet-popup-content-wrapper,
.reading-info--is-very-unhealthy .leaflet-popup-tip,
.leaflet-tooltip.reading-info--is-very-unhealthy {
background-color: #A97BBC;
}
.reading-info--is-dangerous .leaflet-popup-content-wrapper,
.reading-info--is-dangerous .leaflet-popup-tip,
.leaflet-tooltip.reading-info--is-dangerous {
background-color: #9B5974;
}
.reading-info--is-good.leaflet-tooltip {
border: #639c22 solid 1px !important;
}
.reading-info--is-good.leaflet-tooltip-left:before {
border-left-color: #639c22 !important;
}
.reading-info--is-good.leaflet-tooltip-right:before {
border-right-color: #639c22 !important;
}
.reading-info--is-moderate.leaflet-tooltip {
border: #C39A04 solid 1px !important;
}
.reading-info--is-moderate.leaflet-tooltip-left:before {
border-left-color: #C39A04 !important;
}
.reading-info--is-moderate.leaflet-tooltip-right:before {
border-right-color: #C39A04 !important;
}
.reading-info--is-sensitive.leaflet-tooltip {
border: #CB5202 solid 1px !important;
}
.reading-info--is-sensitive.leaflet-tooltip-left:before {
border-left-color: #CB5202 !important;
}
.reading-info--is-sensitive.leaflet-tooltip-right:before {
border-right-color: #CB5202 !important;
}
.reading-info--is-unhealthy.leaflet-tooltip {
border: #D90007 solid 1px !important;
}
.reading-info--is-unhealthy.leaflet-tooltip-left:before {
border-left-color: #D90007 !important;
}
.reading-info--is-unhealthy.leaflet-tooltip-right:before {
border-right-color: #D90007 !important;
}
.reading-info--is-very-unhealthy.leaflet-tooltip {
border: #6A3F7C solid 1px !important;
}
.reading-info--is-very-unhealthy.leaflet-tooltip-left:before {
border-left-color: #6A3F7C !important;
}
.reading-info--is-very-unhealthy.leaflet-tooltip-right:before {
border-right-color: #6A3F7C !important;
}
.reading-info--is-dangerous.leaflet-tooltip {
background-color: #9B5974 !important;
border: #5D3646 solid 1px !important;
}
.reading-info--is-dangerous.leaflet-tooltip-left:before {
border-left-color: #5D3646 !important;
}
.reading-info--is-dangerous.leaflet-tooltip-right:before {
border-right-color: #5D3646 !important;
}
.leaflet-tooltip h1 {
font-weight: bold;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin="" />
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0EQ0STJ1E5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-0EQ0STJ1E5');
</script>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
<script src="./js/fetch.js"></script>
</head>
<body>
<div class="wrapper">
<section class="container">
<header class="head">
<h1 class="anchor anchor__for-desktop">
<a class="tvTitleMap colorTheme" href="/">Aire|Libre</a>
</h1>
<h1 class="anchor anchor__for-mobile">
<a class="tvTitleMap colorTheme" href="/">A|L</a>
</h1>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" onchange="changeSwitch()" checked>
<label class="onoffswitch-label" for="myonoffswitch">
<div class="onoffswitch-inner"></div>
<div class="onoffswitch-switch"></div>
</label>
</div>
</header>
<div id="map" class="map"></div>
</section>
<section class="info">
<section>
<h2 class="info__title colorTheme">¿Qué es AireLibre?</h2>
<p class="info__desc colorTheme">AireLibre es una respuesta de la comunidad a la necesidad de saber sobre la calidad del aire de manera libre, colaborativa y descentralizada.</p>
<h2 class="info__title colorTheme">¿Qué es AQI?</h2>
<p class="info__desc colorTheme">Es un índice utilizado por agencias ambientales para medir la calidad del aire, cuanto más
alto su valor, el nivel de contaminación es mayor.</p>
</section>
<section id="scale">
<span class="info__title colorTheme">Escala AQI</span>
<div class="reading-info reading-info--is-good">
<span class="reading-info__title">0-50 | Libre</span>
<p class="reading-info__desc">Escaso riesgo de contaminación atmosférica, calidad de aire satisfactoria.</p>
</div>
<div class="reading-info reading-info--is-moderate">
<span class="reading-info__title">51-100 | Maso</span>
<p class="reading-info__desc">Calidad de aire aceptable, riesgo moderado para la salud de personas sensibles a
la contaminación ambiental.</p>
</div>
<div class="reading-info reading-info--is-sensitive">
<span class="reading-info__title">101-150 | No tan bien</span>
<p class="reading-info__desc">Insalubre para personas sensibles.</p>
</div>
<div class="reading-info reading-info--is-unhealthy">
<span class="reading-info__title">151-200 | Insalubre</span>
<p class="reading-info__desc">Riesgo general para las personas, efectos más graves en personas sensibles.</p>
</div>
<div class="reading-info reading-info--is-very-unhealthy">
<span class="reading-info__title">201-300 | Muy insalubre</span>
<p class="reading-info__desc">Condición de emergencia.</p>
</div>
<div class="reading-info reading-info--is-dangerous">
<span class="reading-info__title">300+ | Peligroso</span>
<p class="reading-info__desc">Alerta sanitaria, efectos graves para toda la población.</p>
</div>
<p class="colorTheme">Fuente de la escala: <a class="link" href="https://www.airnow.gov/aqi/aqi-basics-in-spanish/">AirNow</a></p>
</section>
<div class="separator"></div>
<section>
<h3 class="info__subtitle colorTheme">¿Querés saber más sobre el proyecto?</h3>
<p class="content colorTheme">Si querés colaborar, o aprender a <b>construir tu propio sensor</b>, o saber en que se diferencia con otros proyectos similares o
<a class="color:inherit; link" href="https://github.com/melizeche/AireLibre/#los-sensores-son-calibrados-en-suiza">¿donde se calibran nuestos sensores</a>? Entrá <a class="link" href="https://github.com/melizeche/AireLibre/#faq">acá para más info.</a></p>
<p class="content colorTheme">Mastodon bot: <a class="link" rel="me" href="https://terere.social/@AireLibre">https://terere.social/@AireLibre</a></p>
</section>
<div class="separator"></div>
<footer class="content is-small">
<p class="is-small colorTheme">AireLibre es un proyecto libre y de código abierto bajo licencia AGPLv3.<br>Sugerencias, bugs o lo que sea lo encontras en el <a
class="link" href="https://github.com/melizeche/AireLibre">repo</a></p>
</footer>
</section>
</div>
</body>
<script>
WebFontConfig = {
google: { families: ['Rubik:400,700,900:latin'] }
};
(function () {
setTimeout(function () {
document.getElementsByTagName('body')[0].classList.add('beautiful');
}, 1000);
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
<script>
var map = L.map('map').setView(DEFAULT_CENTER, DEFAULT_ZOOM);
let darkMode = {
isDarkTheme: false
};
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
let flag = JSON.parse(localStorage.getItem('darkTheme')) || {isDarkTheme:false};
if(flag && flag.isDarkTheme){
document.getElementById("myonoffswitch").checked = false;
onDarkMode()
}else{
onLightMode()
document.getElementById("myonoffswitch").checked = true;
}
function changeSwitch() {
var checked = document.getElementById("myonoffswitch").checked;
if(!checked){
onDarkMode();
}else{
onLightMode();
}
}
requestGeoData();
if (window.navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = [position.coords.latitude, position.coords.longitude];
map.setView(pos, DEFAULT_ZOOM);
})
}
function onDarkMode(){
document.getElementsByClassName('leaflet-pane leaflet-tile-pane')[0].style.cssText +=';filter: invert(1) hue-rotate(180deg) grayscale(0.7);';;
var bodyElement = document.body;
bodyElement.classList ="beautiful dark-mode";
var titlesElements = document.getElementsByClassName('colorTheme');
for(i=0;i<titlesElements.length;i++){
titlesElements[i].style.color = 'white';
}
darkMode.isDarkTheme = true;
localStorage.setItem('darkTheme', JSON.stringify(darkMode));
var linksText = document.getElementsByClassName('link');
for(i=0;i<linksText.length;i++){
linksText[i].style.color = '#8cb4ff';
}
}
function onLightMode(){
document.getElementsByClassName('leaflet-pane leaflet-tile-pane')[0].removeAttribute('style');
var bodyElement = document.body;
bodyElement.classList ="beautiful light-mode"
darkMode.isDarkTheme = false;
localStorage.setItem('darkTheme', JSON.stringify(darkMode));
var titlesElements = document.getElementsByClassName('colorTheme');
for(i=0;i<titlesElements.length;i++){
titlesElements[i].style.color = 'black';
}
var linksText = document.getElementsByClassName('link');
for(i=0;i<linksText.length;i++){
linksText[i].style.color = '#1a0dab';
}
}
</script>
</html>