-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
118 lines (102 loc) · 3.39 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live Update</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.wrapper {
margin: 0 auto;
padding: 0;
width: 100%;
min-width: 1000px;
max-width: 1100px;
height: 100%;
position: relative;
box-sizing: inherit;
background-color: white;
box-sizing: border-box;
}
.wrapper:before,
.wrapper:after {
content: " ";
display: table;
}
.wrapper:after {
clear: both;
}
.wrapper .box {
margin: 10px auto;
padding: 0;
position: relative;
float: left;
width: 33.33333%;
height: 100%;
text-align: center;
box-sizing: border-box;
}
.box .content {
margin: 10px;
padding: 10px;
min-height: 100px;
box-sizing: border-box;
}
</style>
</head>
<body>
<div id="app">
<div class="wrapper">
<strong style="margin: 10px; padding: 10px; min-height: 100px;">Live Update of Corona Virus - Bangladesh </strong>
</div>
<div class="wrapper">
<div class="box">
<div class="content" style="background-color: #17a2b8; font-size: 30px; ">
{{ confirmed }}
<hr>
<p>Total Confirmed</p>
</div>
</div>
<div class="box">
<div class="content" style="background-color: #28a745; font-size: 30px; ">
{{ recovered }}
<hr>
<p>Total Recovered</p>
</div>
</div>
<div class="box">
<div class="content" style="background-color: #dc3545; font-size: 30px; ">
{{ deaths }}
<hr>
<p>Total Deaths</p>
</div>
</div>
</div>
<div class="wrapper">
<strong style="margin: 10px; padding: 10px; min-height: 100px;">Source : IEDCR; Developed by Hasan Mahmud</strong>
</div>
<script>
var app = new Vue({
el: '#app',
data: {
confirmed: '',
recovered: '',
deaths: ''
},
created: function() {
function formatNumber(num) {
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
}
axios.get('https://fastaar.com/api')
.then(res => {
this.confirmed = formatNumber(res.data.total.confirmed)
this.recovered = formatNumber(res.data.total.recovered)
this.deaths = formatNumber(res.data.total.deaths)
})
}
})
</script>
</body>
</html>