-
Notifications
You must be signed in to change notification settings - Fork 0
/
world.html
132 lines (86 loc) · 3.71 KB
/
world.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
<!DOCTYPE html>
<html>
<head>
<title>FIGHT WITH CORONA</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<body onload="fetch()">
<nav class="navbar navbar-expand-lg navbar-light bg-success">
<a class="navbar-brand" href="#">COVID-19</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="world.html">World</a>
</li>
</ul>
</div>
</nav>
<!--******************WORLD UPDATE***************************** -->
<section class="corona_update container-fluid">
<div class="mb-3">
<h3 class="text-uppercase text-center"> covid-19 update </h3>
</div>
<div class="table-responsive">
<table class="table -border table-striped table-center" id="tbval">
<tr>
<th> Country </th>
<th> TotalConfirmed </th>
<th> TotalRecovered </th>
<th> TotalDeaths </th>
<th> NewConfirmed </th>
<th> NewRecovered </th>
<th> NewDeaths </th>
</tr>
</table>
</div>
</section>
<script type="text/javascript">
alert('COVID-19 WORLD UPDATE')
function fetch() {
$.get("https://api.covid19api.com/summary",
function (data){
console.log(data['Countries'].length);
var tbval = document.getElementById('tbval');
for (var i =1; i <(data['Countries'].length); i++) {
var x = tbval.insertRow();
x.insertCell(0);
tbval.rows[i].cells[0].innerHTML = data['Countries'][i-1]['Country'];
tbval.rows[i].cells[0].style.background = '#7a4a91';
tbval.rows[i].cells[0].style.color = '#fff';
x.insertCell(1);
tbval.rows[i].cells[1].innerHTML = data['Countries'][i-1]['TotalConfirmed'];
tbval.rows[i].cells[1].style.background = '#44b7b8';
x.insertCell(2);
tbval.rows[i].cells[2].innerHTML = data['Countries'][i-1]['TotalRecovered'];
tbval.rows[i].cells[2].style.background = '#f36e23';
x.insertCell(3);
tbval.rows[i].cells[3].innerHTML = data['Countries'][i-1]['TotalDeaths'];
tbval.rows[i].cells[3].style.background = '#4bb7b8';
x.insertCell(4);
tbval.rows[i].cells[4].innerHTML = data['Countries'][i-1]['NewConfirmed'];
tbval.rows[i].cells[4].style.background = '#f36e23';
x.insertCell(5);
tbval.rows[i].cells[5].innerHTML = data['Countries'][i-1]['NewRecovered'];
tbval.rows[i].cells[5].style.background = '#4bb7b8';
x.insertCell(6);
tbval.rows[i].cells[6].innerHTML = data['Countries'][i-1]['NewDeaths'];
tbval.rows[i].cells[6].style.background = '#f36e23';
}
}
);
}
</script>
</body>
</html>