-
Notifications
You must be signed in to change notification settings - Fork 1
/
health_data.html
41 lines (40 loc) · 2.06 KB
/
health_data.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Health Datas</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="data_css.css" />
</head>
<body>
<div class="container">
<h2 style="font-family:poppins;background-color:orange;text-align:center;font-color:white;color:white">COVID -19 Cases in <span id="country"></span> <img src="" id="flag"></h2>
<div class="board">
<div class="card a"><i class="fa fa-tachometer"></i><h5>Life Expectancy</h5><span id="life"></span></div>
<div class="card ca"><i class="fa fa-th-list"></i><h5>Total Population</h5><span id="population"></span></div>
<div class="card cr"><i class="fa fa-times-circle"></i><h5>Critical Cases</h5><span id="critical"></span></div>
<div class="card d"><i class="fa fa-times"></i><h5>Mortality Rate (per 1000)</h5><span id="mortality"></span></div>
<div class="card r"><i class="fa fa-check-square-o"></i><h5>Recovered Cases</h5><span id="recovered"></span></div>
<div class="card t"><i class="fa fa-eye"></i><h5>Total Testes Done</h5><span id="tests"></span></div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
fetch('https://corona.lmao.ninja/v2/countries/India')
.then((response) => {
return response.json();
})
.then((data) => {
console.log(data);
document.getElementById("country").innerHTML = data.country;
document.getElementById("life").innerHTML = "70 Years";
document.getElementById("population").innerHTML = "1.353 Billion";
document.getElementById("critical").innerHTML = data.critical.toLocaleString();
document.getElementById("mortality").innerHTML = 202;
document.getElementById("recovered").innerHTML = data.recovered.toLocaleString();
document.getElementById("tests").innerHTML = data.tests.toLocaleString();
document.getElementById("flag").src = data.countryInfo.flag;
});
</script>