Skip to content

Commit 47b473d

Browse files
committed
Added timestamp
1 parent 9dbd719 commit 47b473d

File tree

8 files changed

+100
-76846
lines changed

8 files changed

+100
-76846
lines changed

components/Map/index.vue

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
zoom: 1.6
3333
})
3434
35-
// map.addControl(new mapboxgl.NavigationControl())
35+
map.addControl(new mapboxgl.NavigationControl())
3636
3737
const addLayers = map => {
3838
map.addSource('covid', {
@@ -56,10 +56,8 @@ export default {
5656
'circle-color': [
5757
'step',
5858
['get', 'point_count'],
59-
'#ffedcc',
60-
2,
61-
'#ffc966',
62-
4,
59+
'#ffa500',
60+
1,
6361
'#ffa500'
6462
],
6563
'circle-radius': [
@@ -131,10 +129,11 @@ export default {
131129
let coordinates = e.features[0].geometry.coordinates.slice()
132130
const country = e.features[0].properties.country
133131
const province = e.features[0].properties.province
134-
const title = country + (province ? ` - ${province}` : '')
132+
const title = (province ? `${province}, ` : '') + country
135133
const cc = e.features[0].properties.confirmed_count
136134
const rc = e.features[0].properties.recovered_count
137135
const dc = e.features[0].properties.dead_count
136+
const last_update = e.features[0].properties.last_update
138137
139138
while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
140139
coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360
@@ -147,16 +146,17 @@ export default {
147146
<p class="popup_title">${title}</p>
148147
<div class="popup_item item_confirmed">
149148
<span>Confirmed</span>
150-
<span>${cc}</span>
149+
<span class="value">${cc}</span>
151150
</div>
152151
<div class="popup_item item_recovered">
153152
<span>Recovered</span>
154-
<span>${rc}</span>
153+
<span class="value">${rc}</span>
155154
</div>
156155
<div class="popup_item item_dead">
157156
<span>Dead</span>
158-
<span>${dc}</span>
157+
<span class="value">${dc}</span>
159158
</div>
159+
<div class="popup_last-update">last update ${last_update}</div>
160160
</div>
161161
`)
162162
.addTo(map)
@@ -205,20 +205,29 @@ export default {
205205
}
206206
}
207207
&.item_confirmed {
208-
span:last-child {
208+
.value {
209209
color: #ffa500;
210210
}
211211
}
212212
&.item_recovered {
213-
span:last-child {
213+
.value {
214214
color: #66a266;
215215
}
216216
}
217217
&.item_dead {
218-
span:last-child {
218+
.value {
219219
color: #b20000;
220220
}
221221
}
222222
}
223+
&_last-update {
224+
border-top: 1px solid #cccccc;
225+
margin-top: 5px;
226+
padding-top: 5px;
227+
228+
span {
229+
font-weight: 700;
230+
}
231+
}
223232
}
224233
</style>

components/Search/index.vue

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@
3737
:value="province" />
3838
</select>
3939
</div>
40+
<div
41+
v-if="hasSelected && hasSearched && country_case.length"
42+
class="search-results">
43+
<p>Cases <span>({{ country_case[0].properties.last_update }})</span></p>
44+
<Results
45+
:items="results"
46+
:duration="duration"
47+
:show-value="!!country_case.length" />
48+
</div>
4049
<button
4150
:disabled="!hasSelected"
4251
@click="onSearch">Search</button>
@@ -51,15 +60,6 @@
5160
<span>{{ suggestion }}</span>
5261
</li>
5362
</ul>
54-
<div
55-
v-if="hasSelected && hasSearched && country_case.length"
56-
class="search-results">
57-
<p class="">Cases</p>
58-
<Results
59-
:items="results"
60-
:duration="duration"
61-
:show-value="!!country_case.length" />
62-
</div>
6363
</div>
6464
</template>
6565

@@ -319,12 +319,21 @@ export default {
319319
font-size: 24px;
320320
321321
& > p{
322+
display: table;
322323
margin-top: 24px;
323324
margin-bottom: 12px;
324325
font-weight: 700;
325326
letter-spacing: 1px;
326-
color: #cccccc;
327+
color: #ffffff;
327328
text-transform: uppercase;
329+
330+
span {
331+
display: table-cell;
332+
padding-left: 8px;
333+
font-size: 16px;
334+
color: #f2f2f2;
335+
vertical-align: middle;
336+
}
328337
}
329338
}
330339
}

pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</div>
1313
<div class="overview">
1414
<Drawer>
15-
<DrawerItem title="COVID-19">
15+
<DrawerItem title="CASES">
1616
<Results
1717
:items="results"
1818
:duration="duration"

0 commit comments

Comments
 (0)