-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
276 lines (254 loc) · 13.6 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
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
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE html>
<html>
<!--
WARNING! Make sure that you match all Quasar related
tags to the same version! (Below it's "@2.0.3")
-->
<head>
<link
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Icons+Sharp"
rel="stylesheet" type="text/css">
<link href="https://maxst.icons8.com/vue-static/landings/line-awesome/font-awesome-line-awesome/css/all.min.css"
rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/animate.css@^4.0.0/animate.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/quasar@2.0.3/dist/quasar.prod.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- example of injection point where you write your app template -->
<div id="q-app">
<div class="text-center" style="margin-bottom: 5rem;">
<div class="col-6">
<q-img style="height: 40vh;"
src="https://images.unsplash.com/photo-1583324113626-70df0f4deaab?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2378&q=80">
<div class="absolute-bottom text-center text-h1">
ZA Covid 19 Statistics
</div>
</q-img>
</div>
</div>
<div class="row justify-around" style="margin-bottom: 50px; margin-left: 50px; margin-right: 50px" id="summary">
<q-card class="shadow-21 text-center" style="height:236px; width:244px">
<q-card-section>
<q-icon style="font-size: 60px; color: rgb(7, 131, 153);margin-top:10px;" class="material-icons-outlined"
name="vaccines"></q-icon>
<div class="text-h6" style="margin-top: 10px;">Tests Conducted</div>
<div class="text-caption" style="margin-top: 5px; color: rgb(121, 144, 148); font-size:10px;">Last Updated: {{
totalTestsConducted[0]['date'] }}</div>
<div class="text-h4 text-center text-bold" style="margin-top:15px; color: rgb(7, 131, 153);">{{
totalTestsConducted[0]['cumulative_tests'].toLocaleString("en", {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
})
}}</div>
</q-card-section>
</q-card>
<q-card class="shadow-21 text-center" style="height:236px; width:244px">
<q-card-section>
<q-icon style="font-size: 60px; color: rgb(202, 173, 7); margin-top:10px;" class="material-icons-outlined"
name="sick"></q-icon>
<div class="text-h6" style="margin-top: 10px;">Total Positive Cases</div>
<div class="text-caption" style="margin-top: 5px; color: rgb(121, 144, 148);font-size:10px;">Last Updated: {{
totalConfirmedCases[0]['date'] }}</div>
<div class="text-h4 text-center text-bold" style="margin-top:15px;color: rgb(202, 173, 7);">{{
totalConfirmedCases[0]['total'].toLocaleString("en", {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
})
}}</div>
</q-card-section>
</q-card>
<q-card class="shadow-21 text-center" style="height:236px; width:244px">
<q-card-section>
<q-icon style="font-size: 60px; color: rgb(160, 64, 64);margin-top:10px;" class="material-icons-outlined"
name="sentiment_dissatisfied"></q-icon>
<div class="text-h6" style="margin-top: 10px;">Total Deaths</div>
<div class="text-caption" style="margin-top: 5px;color: rgb(121, 144, 148);font-size:10px;">Last Updated: {{
totalDeaths[0]['date'] }}</div>
<div class="text-h4 text-center text-bold" style="margin-top:15px;color: rgb(160, 64, 64);">{{
totalDeaths[0]['total'].toLocaleString("en", {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
})
}}</div>
</q-card-section>
</q-card>
<q-card class="shadow-21 text-center" style="height:236px; width:244px">
<q-card-section>
<q-icon style="font-size: 60px; color: rgb(26, 155, 1);margin-top:10px;" class="material-icons-outlined"
name="health_and_safety"></q-icon>
<div class="text-h6" style="margin-top: 10px;">Total Recoveries</div>
<div class="text-caption" style="margin-top: 5px;color: rgb(121, 144, 148);font-size:10px;">Last Updated: {{
totalRecoveries[0]['date'] }}</div>
<div class="text-h4 text-center text-bold" style="margin-top:15px;color: rgb(26, 155, 1);">{{
totalRecoveries[0]['total'].toLocaleString("en", {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
})
}}</div>
</q-card-section>
</q-card>
<q-card class="shadow-21 text-center">
<q-card-section>
<q-icon style="font-size: 60px; color: rgb(2, 105, 119);margin-top:10px;" class="material-icons-outlined"
name="add_moderator"></q-icon>
<div class="text-h6" style="margin-top: 10px;">Vaccines Administered</div>
<div class="text-caption" style="margin-top: 5px;color: rgb(121, 144, 148);font-size:10px;">Last Updated: {{
totalVaccinations[0]['date'] }}</div>
<div class="text-h4 text-center text-bold" style="margin-top:15px; color: rgb(2, 105, 119);">{{
totalVaccinations[0]['vaccinations'].toLocaleString("en", {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
})
}}</div>
</q-card-section>
</q-card>
</div>
<div class="row justify-around" style="margin-bottom: 50px; margin-left: 50px; margin-right: 50px" id="cards">
<q-card v-for="(province, index) in provinces" :key="province" style="width: 325px;margin-top:50px;"
class="col-4 shadow-21">
<q-card-section horizontal>
<q-img :src="province.url" class="col-5" loading="lazy" fit="fill"
style="height: 140px; max-width: 150px; margin-bottom: 25px; margin-left: 10px ; margin-top: 25px; margin-right:10px">
</q-img>
<q-separator vertical></q-separator>
<div class="row justified-center">
<div class="text-h6 col-12 text-center">{{ province.name }}</div>
<div class="text-caption col-12 text-center">Confirmed Cases: <br> <span
style="color:rgb(255, 102, 0); font-weight:bold" class="text-subtitle1">{{
totalConfirmedCases[0][province.key] }}</span></div>
<div class="text-caption col-12 text-center">Deaths: <br> <span style="color:red; font-weight:bold"
class="text-subtitle1">{{ totalDeaths[0][province.key] }}</span></div>
<div class="text-caption col-12 text-center">Recoveries: <br> <span style="color:green; font-weight:bold"
class="text-subtitle1">{{ totalRecoveries[0][province.key] }}</span></div>
</div>
</q-card-section>
<q-separator> </q-separator>
<q-card-actions class="row justify-between">
<q-btn flat type="a" :href="province.vac_url" target="_blank" label="Vaccination Sites" text-color="green-9">
</q-btn>
<q-btn flat type="a" href="https://vaccine.enroll.health.gov.za/#/" target="_blank" label="Enroll on EVDS"
text-color="green-9">
</q-btn>
</q-card-actions>
</q-card>
</div>
<div class="row"
style="position: fixed; bottom: 0; width:100vw; height: 3rem; margin-top: 5rem; background-color: rgba(0, 0, 0, 0.651); align-self: center; align-content: center;">
<div class="col text-white text-center text-h6" style="width:100vw;">
{{ disclaimer }}
</div>
</div>
</div>
<!-- Add the following at the end of your body tag -->
<script src="https://cdn.plot.ly/plotly-1.2.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.2.4/lib/bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>
<script src="https://cdn.jsdelivr.net/npm/quasar@2.0.3/dist/quasar.umd.prod.js"></script>
<script>
/*
Example kicking off the UI. Obviously, adapt this to your specific needs.
Assumes you have a <div id="q-app"></div> in your <body> above
*/
const app = Vue.createApp({
data() {
return {
disclaimer: 'Data Science for Social Impact Research Group @ University of Pretoria, Coronavirus COVID-19 (2019-nCoV) Data Repository for South Africa. Available on: https://github.com/dsfsi/covid19za.',
loading: true,
provinces: [{ name: 'Western Cape', url: 'https://southafrica.co.za/images/western-cape-coat-of-arms-786x692.jpg', key: 'WC', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-db7ac6fbef89116f56f' },
{ name: 'Eastern Cape', url: 'https://southafrica.co.za/images/eastern-cape-arms-786x597.jpg', key: 'EC', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-50d834971fbe08c0814' },
{ name: 'Northern Cape', url: 'https://southafrica.co.za/images/northern-cape-province-arms-786x633.jpg', key: 'NC', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-1bc92d4904fd9b62f8b' },
{ name: 'KwaZulu-Natal', url: 'https://www.heraldry-wiki.com/heraldrywiki/images/1/1e/Kwazulun.jpg', key: 'KZN', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-07351d0bb57a47090d4' },
{ name: 'Freestate', url: 'https://southafrica.co.za/images/free-state-arms-786x638.jpg', key: 'FS', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-921bce3a1f8e1486bc9' },
{ name: 'Limpopo', url: 'https://southafrica.co.za/images/limpopo-province-arms-786x715.jpg', key: 'LP', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-ed26449d4afffebd6b6' },
{ name: 'Gauteng', url: 'https://southafrica.co.za/images/gauteng-logo-786x613.jpg', key: 'GP', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-614955392d80ac92f1c' },
{ name: 'Mampumalanga', url: 'https://southafrica.co.za/images/mpumalanga-province-vector-891509-786x589.jpg', key: 'MP', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-cdb24ed09bdb756ff78' },
{ name: 'North West', url: 'https://southafrica.co.za/images/north-west-province-arms-logo-786x744.jpg', key: 'NW', vac_url: 'https://sacoronavirus.co.za/active-vaccination-sites/#tab-d2bbc68ecd9a7e01236' }],
totalDeaths: [],
totalRecoveries: [],
totalConfirmedCases: [],
totalVaccinations: [],
totalTestsConducted: []
}
},
methods: {
loadTesting() {
dfd.read_csv("https://raw.githubusercontent.com/dsfsi/covid19za/master/data/covid19za_timeline_testing.csv")
.then(df => {
df.sort_values({ by: "YYYYMMDD", inplace: true, ascending: false })
df.to_json().then((json) => {
this.totalTesting = JSON.parse(json)
})
}).catch(err => {
console.log(err);
})
},
loadRecoveries() {
dfd.read_csv("https://raw.githubusercontent.com/dsfsi/covid19za/master/data/covid19za_provincial_cumulative_timeline_recoveries.csv")
.then(df => {
df.sort_values({ by: "YYYYMMDD", inplace: true, ascending: false })
df.to_json().then((json) => {
this.totalRecoveries = JSON.parse(json)
})
}).catch(err => {
console.log(err);
})
},
loadTestsConducted() {
dfd.read_csv("https://raw.githubusercontent.com/dsfsi/covid19za/master/data/covid19za_timeline_testing.csv")
.then(df => {
df.sort_values({ by: "YYYYMMDD", inplace: true, ascending: false })
df.to_json().then((json) => {
this.totalTestsConducted = JSON.parse(json)
})
}).catch(err => {
console.log(err);
})
},
loadVaccinations() {
dfd.read_csv("https://raw.githubusercontent.com/dsfsi/covid19za/master/data/covid19za_timeline_vaccination.csv")
.then(df => {
df.sort_values({ by: "YYYYMMDD", inplace: true, ascending: false })
df.to_json().then((json) => {
this.totalVaccinations = JSON.parse(json)
})
}).catch(err => {
console.log(err);
})
},
loadConfirmedCases() {
dfd.read_csv("https://raw.githubusercontent.com/dsfsi/covid19za/master/data/covid19za_provincial_cumulative_timeline_confirmed.csv")
.then(df => {
df.sort_values({ by: "YYYYMMDD", inplace: true, ascending: false })
df.to_json().then((json) => {
this.totalConfirmedCases = JSON.parse(json)
})
}).catch(err => {
console.log(err);
})
},
loadDeaths() {
dfd.read_csv("https://raw.githubusercontent.com/dsfsi/covid19za/master/data/covid19za_provincial_cumulative_timeline_deaths.csv")
.then(df => {
df.sort_values({ by: "YYYYMMDD", inplace: true, ascending: false })
df.to_json().then((json) => {
this.totalDeaths = JSON.parse(json)
})
}).catch(err => {
console.log(err);
})
}
},
created() {
this.loadVaccinations()
this.loadDeaths()
this.loadRecoveries()
this.loadConfirmedCases()
this.loadTestsConducted()
}
})
app.use(Quasar)
app.mount('#q-app')
</script>
</body>
</html>