-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcountry.html
264 lines (197 loc) · 8.26 KB
/
country.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
<!DOCTYPE html>
<html>
<title>India</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body,h1 {font-family: "Raleway", Arial, sans-serif;
background-image:url(https://image.freepik.com/free-vector/realistic-coronavirus-background_23-2148497718.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover
}h1 {letter-spacing: 6px}
.w3-row-padding img {margin-bottom: 12px}
</style>
<script src="https://kit.fontawesome.com/c939d0e917.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" >
var andhra_data=[['State','Confirmed']];
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var x='https://api.covid19india.org/data.json';
$.getJSON(x,function(stated){
for (i=1;i<stated.statewise.length;i=i+1){
andhra_data.push([stated.statewise[i].state,parseInt(stated.statewise[i].confirmed)
]);
}
var data = google.visualization.arrayToDataTable(andhra_data);
console.log(data);
var options = {
legend: 'none',
pieSliceText: 'label',
title: "India",
pieStartAngle: 100
};
var chart = new google.visualization.PieChart(document.getElementById('cntry'));
chart.draw(data, options);
});
}
</script>
<script>
y="https://api.covid19api.com/summary";
$.getJSON(y,function(s){
var tc=0;
var ta=0;
var tr=0;
var td=0;
var date1=0;
for(i=0;i<s.Countries.length;i=i+1){
if(s.Countries[i].Country=="India"){
tc=s.Countries[i].TotalConfirmed;
tr=s.Countries[i].TotalRecovered;
td=s.Countries[i].TotalDeaths;
ta=tc-tr-td;
date1=`Last Updated: ${s.Countries[i].Date}`;
}}
document.querySelector('.tc').innerHTML = tc;
document.querySelector('.ta').innerHTML = ta;
document.querySelector('.tr').innerHTML = tr;
document.querySelector('.td').innerHTML = td;
document.querySelector('#date1').innerHTML = date1;
});
</script>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<script>
var dailyConf=[];
var dailyRec=[];
var dailyDeaths=[];
window.onload = function () {
var y="https://api.covid19india.org/data.json";
$.getJSON(y,function(Dailydata){
for (i=0;i<Dailydata.cases_time_series.length;i=i+1){
dailyConf.push({label: Dailydata.cases_time_series[i].date,y: parseInt(Dailydata.cases_time_series[i].dailyconfirmed)});
dailyRec.push({label:Dailydata.cases_time_series[i].date,y:parseInt(Dailydata.cases_time_series[i].dailyrecovered)});
dailyDeaths.push({label:Dailydata.cases_time_series[i].date,y:parseInt(Dailydata.cases_time_series[i].dailydeceased)});
}
var chart = new CanvasJS.Chart("chartContainer",
{
theme:"light1",
animationEnabled: true,
title:{
text: "India's Daily Chart"
},
axisY: {
title: "No. of cases",
includeZero: false,
},
legend:{
cursor: "pointer",
fontSize: 16,
itemclick: toggleDataSeries
},
toolTip:{
shared: true
},
data: [{
name: "Confirmed",
type: "spline",
yValueFormatString: "###",
showInLegend: true,
dataPoints: dailyConf
},
{
name: "Deaths",
type: "spline",
yValueFormatString: "###",
showInLegend: true,
dataPoints: dailyDeaths
},
{
name: "Recovered",
type: "spline",
yValueFormatString: "### ",
showInLegend: true,
dataPoints: dailyRec
}]
});
chart.render();
function toggleDataSeries(e){
if (typeof(e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
e.dataSeries.visible = false;
}
else{
e.dataSeries.visible = true;
}
chart.render();
}
});
}
</script>
</head>
<body>
<!-- !PAGE CONTENT! -->
<div class="w3-content" style="max-width:1500px">
<!-- Header -->
<header class="w3-panel w3-center w3-opacity" style="background-image: linear-gradient(#000d20,#020202 );">
<div style=" padding-top: 15px;padding-bottom: 15px;">
<div>
<a href="main.html" class=" w3-button w3-light-grey"><b>Home<b></a>
<a href="country.html" class=" w3-button w3-light-grey"><b>India Updates<b></a>
<a href="world.html" class=" w3-button w3-light-grey"><b>World Updates<b></a>
<a href="aboutcovid19.html" class=" w3-button w3-light-grey"><b>About Covid19<b></a>
</div>
</div>
</header>
<h2 class=" w3-center" style="color: rgb(34, 34, 34); font-size:40px; font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;text-shadow: 7px 7px 15px 1px rgba(0,0,0,0.16);">INDIA</h2>
<!-- Photo Grid -->
<div class="w3-row-padding " style="margin-bottom:80px">
<h6 class="w3-center" style="margin-left: auto;" id="date1"></h6>
<div class="w3-half ">
<br>
<div style="margin-left: auto; border-radius:10px; background: rgb(252, 252, 252); color: rgb(34, 34, 34); box-shadow: 7px 7px 15px 1px rgba(0,0,0,0.16);max-width: 400px; height:100px;">
<h2 class="w3-center" style="padding-top: 2px;">Total Confirmed</h2>
<h4 class="w3-center tc" style="font-family: 'Times New Roman', Times, serif; color:deepskyblue;"></h4>
</div>
<br>
<div style="margin-left: auto; border-radius:10px;background: rgb(252, 252, 252); color: rgb(34, 34, 34); box-shadow: 7px 7px 15px 1px rgba(0,0,0,0.16);max-width: 400px; height:100px;">
<h2 class="w3-center" style="padding-top: 2px;">Total Recovered</h2>
<h4 class="w3-center tr" style="font-family: 'Times New Roman', Times, serif; color:green;"></h4>
</div>
<br>
<div style="margin-left: auto; border-radius:10px;background: rgb(252, 252, 252); color: rgb(34, 34, 34); box-shadow: 7px 7px 15px 1px rgba(0,0,0,0.16);max-width: 400px; height:100px;">
<h2 class="w3-center"style="padding-top: 2px;" >Total Deaths</h2>
<h4 class="w3-center td" style="font-family: 'Times New Roman', Times, serif; color:red;"></h4>
</div>
<br>
<div style="margin-left: auto; border-radius:10px;background: rgb(252, 252, 252); color: rgb(34, 34, 34); box-shadow: 7px 7px 15px 1px rgba(0,0,0,0.16);max-width: 400px; height:100px;">
<h2 class="w3-center" style="padding-top: 2px;">Total Active</h2>
<h4 class="w3-center ta" style="font-family: 'Times New Roman', Times, serif; color:orange;"></h4>
</div>
<br>
<div style=" margin-left:auto;background: transparent; color: rgb(34, 34, 34);max-width: 370px; height:300px;">
<img class="w3-center" style=" border-radius:10px;"max-width="300px" height="300px" src="https://media1.tenor.com/images/f841ec1fac4b581baf2dde568f231f68/tenor.gif?itemid=16678450"></img>
</div>
<br>
</div>
<div class="w3-half">
<br>
<h3 style="color:crimson;margin-left: auto; border-radius:10px;">Pie Chart(State)</h3>
<div id="cntry" style="margin-right: auto;background: rgb(252, 252, 252); color: rgb(34, 34, 34); box-shadow: 7px 7px 15px 1px rgba(0,0,0,0.16);max-width: 500px; height:270px;"></div>
<br>
<h3 style="color:crimson;margin-left: auto; border-radius:10px;">Chart based on Daily Data</h3> <div id="chartContainer" style=" margin-right:auto;background: rgb(252, 252, 252); color: rgb(34, 34, 34); box-shadow: 7px 7px 15px 1px rgba(0,0,0,0.16);max-width: 500px; height:270px"></div>
<br>
</div>
</div>
<!-- End Page Content -->
</div>
<!-- Footer -->
<footer class="w3-container w3-light-grey w3-center " style="padding-top:15px;padding-bottom: 15px;" >
<p>Click here to know about the developer <a href="https://www.linkedin.com/in/yash-gupta-0763a7162/" target="_blank" class="w3-text-green">YASH GUPTA</a> & <a href="https://www.linkedin.com/in/zia-fatima-5325b0169/" target="_blank" class="w3-text-green">ZIA FATIMA</a></p>
</footer>
</body>
</html>