forked from zbraniecki/covid19-timeseries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
91 lines (91 loc) · 3.31 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
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="./style/index.css" >
<meta property="og:image" content="https://labs.braniecki.net/covid19-timeseries/thumbnail.png"/>
<script src="./js/helpers.js"></script>
<script src="./js/regions.js"></script>
<script src="https://vuejs.org/js/vue.min.js"></script>
<script src="./js/index.js"></script>
<title>COVID-19 Regional Relative Timeseries</title>
</head>
<body>
<div id="app" style="display: none">
<div id="main">
<table id="legend" cellspacing="0" cellpadding="0">
<tr>
<td style="background-color: rgb(221, 238, 255)">{{ data.legend.min }}</td>
<td style="background-color: #ccffcc">Today</td>
<td>
|
<a href="https://github.com/zbraniecki/covid19-timeseries">Github repo<a/>
|
</td>
<td>
<a href="https://github.com/pomber/covid19">Data source</a> / Inspired by <a href="https://twitter.com/Nathan510edge">@Nathan510edge</a>
</td>
</tr>
</table>
<table id="data" cellspacing="0" cellpadding="0">
<thead>
<td class="relDay" style="font-size: 0.7em">Δ Day</td>
<td class="value" v-for="item in data.main.regions" :key="item" colspan="2">
{{ item }}
</td>
</thead>
<tr>
<td class="relDay"></td>
<template v-for="sample in data.main.regions">
<td class="day">Date</td>
<td class="value">#</td>
</template>
</tr>
<tr v-for="item in data.main.days">
<td class="relDay">{{ item.num }}</td>
<template v-for="sample in item.values">
<template v-if="sample">
<td
class="day"
v-bind:class="{ below: sample.min, today: sample.isToday, quarantine: sample.quarantine }">
{{ sample.date.toLocaleDateString(undefined, { month: "numeric", day: "numeric" }) }}
</td>
<td
class="value"
v-bind:class="{ below: sample.min, quarantine: sample.quarantine }"
v-bind:style="sample.min ? {} : { backgroundColor: sample.color }">
{{ sample.value }}
</td>
</template>
<template v-else>
<td class="day empty"></td>
<td class="value empty"></td>
</template>
</template>
</tr>
</table>
</div>
<div id="sidebar">
<p>Type</p>
<select id="typeSelect">
<option
v-for="item in data.select.types"
v-bind:selected="data.selectedType === item.id"
v-bind:value="item.id"
:key="item.id">
{{ item.name }}
</option>
</select>
<p>Regions</p>
<select multiple id="regionSelect">
<option
v-for="item in data.select.regions"
v-bind:selected="data.main.regions.includes(item.name)"
v-bind:value="item.name"
:key="item">
{{ item.name }} -- {{ item.value }}
</option>
</select>
</div>
</div>
</body>
</html>