-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
237 lines (206 loc) · 8.01 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
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-167462362-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-167462362-1');
</script>
<title>Карта повітряних тривог України</title>
<meta charset="utf-8">
<meta name="description" content="Карта повітряних тривог України">
<meta name="keywords" content="Карта повітряних тривог України">
<meta name="author" content="John Doe">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://www.amcharts.com/lib/4/core.js" crossorigin="anonymous"></script>
<script src="https://www.amcharts.com/lib/4/charts.js" crossorigin="anonymous"></script>
<script src="https://www.amcharts.com/lib/4/maps.js" crossorigin="anonymous"></script>
<script src="https://www.amcharts.com/lib/4/geodata/data/countries2.js" crossorigin="anonymous"></script>
<script src="https://www.amcharts.com/lib/4/themes/animated.js" crossorigin="anonymous"></script>
<script src="//www.amcharts.com/lib/4/themes/material.js" crossorigin="anonymous"></script>
</head>
<body>
<style>
@font-face {
font-family: "Comfortaa";
src: url("fonts/Comfortaa/Comfortaa-VariableFont_wght.ttf");
}
html, body {
font-family: 'Comfortaa', Arial, sans-serif;
font-weight:normal;
font-style:normal;
margin: 0;
}
#області{
margin:0;
padding: 10px;
background-color: #f5f5f5;
}
#chartdiv {
width: 100%;
max-width: 960px;
margin: auto;
height: calc(100% - 295px)
}
#таймлайн{
margin:0;
padding: 10px;
background-color: rgb(198, 237, 255);
}
#chartdiv2 {
margin: auto;
width: 100%;
max-height: 700px;
}
</style>
<script>
window.chart = null;
am4core.ready(function() {
jQuery.ajaxSetup({ cache: false });
window.onload = function() {
am4core.useTheme(am4themes_animated);
am4core.useTheme(am4themes_material);
/**
* This demo uses our own method of determining user's location
* It is not public web service that you can use
* You'll need to find your own. We recommend http://www.maxmind.com
*/
// jQuery.getJSON( "https://www.amcharts.com/tools/country/?v=xz6Z", function( geo ) {
var geo = {
country_code: "UA",
country_name: "Ukraine"
}
// Default map
var defaultMap = "usaAlbersLow";
// calculate which map to be used
var currentMap = defaultMap;
var title = "";
if ( am4geodata_data_countries2[ geo.country_code ] !== undefined ) {
currentMap = am4geodata_data_countries2[ geo.country_code ][ "maps" ][ 0 ];
// add country title
if ( am4geodata_data_countries2[ geo.country_code ][ "country" ] ) {
title = am4geodata_data_countries2[ geo.country_code ][ "country" ];
}
}
// Create map instance
window.chart = am4core.create("chartdiv", am4maps.MapChart);
// chart.titles.create().text = title;
// Set map definition
chart.seriesContainer.draggable = false;
chart.seriesContainer.resizable = false;
chart.maxZoomLevel = 1;
chart.chartContainer.wheelable = false;
chart.geodataSource.url = "data/ukraine-low-poli.json";
chart.geodataSource.events.on("parseended", function(ev) {
jQuery.getJSON( "data/air.json", function( geo ) {
polygonSeries.data = geo;
});
})
// Set projection
chart.projection = new am4maps.projections.Mercator();
// Create map polygon series
var polygonSeries = chart.series.push(new am4maps.MapPolygonSeries());
// polygonSeries.heatRules.push({
// "property": "fill",
// "target": polygonSeries.mapPolygons.template,
// "min": am4core.color('green'),
// "max": am4core.color('red')
// });
// Make map load polygon data (state shapes and names) from GeoJSON
polygonSeries.useGeodata = true;
// Configure series tooltip
var polygonTemplate = polygonSeries.mapPolygons.template;
polygonTemplate.tooltipText = "{name}: {time}";
polygonTemplate.nonScalingStroke = true;
polygonTemplate.strokeWidth = 0.5;
polygonTemplate.propertyFields.fill = "fill";
polygonTemplate.fill = am4core.color("#97c1a9");
// Create hover state and set alternative fill color
var hs = polygonTemplate.states.create("hover");
// hs.properties.fill = chart.colors.getIndex(6).brighten(-0.5);
// });
};
}); // end am4core.ready()
</script>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333333;
}
li {
float: left;
width: 50%;
}
li a {
display: block;
color: white;
text-align: center;
padding-top: 31px;
padding-bottom: 31px;
margin: auto;
text-decoration: none;
}
li a:hover {
background-color: #111111;
}
@media all and (max-width: 768px) {
li {
font-size: 12px
}
}
footer a:-webkit-any-link {
color: white;
}
</style>
<div id="header" style="position:fixed; top:0px; left:0px; height:80px; right:0px;overflow:hidden;z-index: 100">
<ul>
<li><a href="#">Air Raid Map</a></li>
<li><a href="/infographic/covid.html">Covid-19</a></li>
<!-- <li><a href="#випадки">Випадки</a></li>-->
<!-- <li><a href="#тенденція">Тенденція</a></li>-->
</ul>
</div>
<div id="content" style="">
<div id="області" style="padding-top:80px">
<div style="text-align: center;">
<h1>Карта повітряних тривог України</h1>
</div>
<div style="text-align: center;">
<h3>Області</h3>
</div>
<div id="chartdiv"></div>
</div>
</div>
<div id="footer" style="padding: 30px; background-color: #505050;color: #fff; font-size: 12px">
Інформацію взято з відкритих джерел.
<br>
Останнє оновлення: <span id="timestamp">...</span>.
<br>
Створено <a style="color:white" href="https://github.com/vergilet" target="_blank">Yaro</a>
</div>
<script>
function timeout() {
setTimeout(function () {
fetch('https://vergilet.github.io/infographic/data/last_post.json?' + Math.floor(Date.now() / 1000))
.then((response) => {
return response.json();
})
.then((data) => {
$('#timestamp').text(data["time"])
});
timeout();
}, 10000);
}
$(document).ready(function (){
timeout();
});
</script>
</body>
</html>