index.html 7.72 KB
Newer Older
1
2
<html>
    <head>
3
        <meta charset="utf-8"/>
Michał Woźniak's avatar
fix    
Michał Woźniak committed
4
        <script src="./wtf_wikipedia-client.min.js"></script>
Michał Woźniak's avatar
charts!    
Michał Woźniak committed
5
        <script src="./Chart.bundle.min.js"></script>
Michał Woźniak's avatar
fix    
Michał Woźniak committed
6
        <script src="./covid.js"></script>
Michał Woźniak's avatar
Michał Woźniak committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
        <style>
            @font-face {
                font-family: "Play Regular";
                src: url(./Play/Play-Regular.ttf);
            }
            @font-face {
                font-family: "Play Bold";
                src: url(./Play/Play-Bold.ttf);
            }
            body {
                background: #444;
                color: springgreen;
                font-family: "Play Regular";
                padding:0px;
                margin:0px;
                font-size: 16pt;
Michał Woźniak's avatar
Michał Woźniak committed
23
24
25
                display: flex;
                flex-direction: column;
                min-height:100vh;
Michał Woźniak's avatar
Michał Woźniak committed
26
27
28
29
30
31
32
33
34
35
            }
            body > * {
                padding-left:5vw;
                padding-right:5vw;
            }
            body > * > * {
                text-shadow: none;
            }
            h1 {
                text-align:center;
Michał Woźniak's avatar
Michał Woźniak committed
36
37
38
39
40
41
                padding-top:2em;
                padding-bottom:0.7em;
                font-family: "Play Regular";
                font-weight: normal;
                font-size: 260%;
                text-shadow:-1px -1px 1px black, 1px 1px 0px #888;
Michał Woźniak's avatar
Michał Woźniak committed
42
            }
Michał Woźniak's avatar
Michał Woźniak committed
43
            h2, h3, h4, h5, h6, h7, strong {
Michał Woźniak's avatar
Michał Woźniak committed
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
                font-family: "Play Bold";
            }
            a {
                color: yellow;
            }
            
            #covid-stats {
                display: grid;
                grid-auto-flow: column;
                background: springgreen;
                color: #444;
            }
            #covid-stats > * {
                margin:0em;
                padding:0.5em;
                display: grid;
            }
            #covid-stats .value {
                font-weight: bold;
                font-family: "Play Bold";
Michał Woźniak's avatar
Michał Woźniak committed
64
                align-self: end;
Michał Woźniak's avatar
Michał Woźniak committed
65
            }
Michał Woźniak's avatar
Michał Woźniak committed
66
            #covid-stats h2,
67
            .site-data-container h2 {
Michał Woźniak's avatar
Michał Woźniak committed
68
69
70
71
72
                font-size: 140%;
                font-family: "Play Regular";
                font-weight: bold;
                text-transform: uppercase;
            }
Michał Woźniak's avatar
Michał Woźniak committed
73
74
            #covid-stats h2 {
                color: #444;
Michał Woźniak's avatar
Michał Woźniak committed
75
                opacity: 0.4;
Michał Woźniak's avatar
Michał Woźniak committed
76
77
            }
            .sources {
Michał Woźniak's avatar
Michał Woźniak committed
78
79
80
81
82
83
                font-size: 80%;
                font-style: italic;
                margin-top: 0.4em;
                text-align: right;
                opacity: 0.5;
            }
84
            .site-data {
Michał Woźniak's avatar
Michał Woźniak committed
85
                display: grid;
Michał Woźniak's avatar
Michał Woźniak committed
86
                grid-template-columns: auto auto auto;
Michał Woźniak's avatar
Michał Woźniak committed
87
88
                grid-template-rows: auto auto auto;
                grid-template-areas: 
Michał Woźniak's avatar
Michał Woźniak committed
89
90
91
                    "auto auto auto"
                    "auto auto auto"
                    "sources sources sources";
Michał Woźniak's avatar
Michał Woźniak committed
92
93
94
                grid-auto-flow: row;
                padding-top:1em;
                padding-bottom:1em;
Michał Woźniak's avatar
Michał Woźniak committed
95
            }
96
            .site-data > * {
Michał Woźniak's avatar
Michał Woźniak committed
97
                display: grid;
Michał Woźniak's avatar
Michał Woźniak committed
98
99
100
                margin:0px;
                padding:0.5em;
            }
101
            .site-data > h2 {
Michał Woźniak's avatar
Michał Woźniak committed
102
103
                grid-area: header;
            }
104
            .site-data > .sources {
Michał Woźniak's avatar
Michał Woźniak committed
105
                grid-area: sources;
Michał Woźniak's avatar
Michał Woźniak committed
106
            }
107
            .site-data > * .value {
Michał Woźniak's avatar
Michał Woźniak committed
108
109
110
                font-weight: bold;
                font-family: "Play Bold";
            }
111
            #sites-data-container {
Michał Woźniak's avatar
Michał Woźniak committed
112
                flex-grow:1;
113
114
115
116
117
118
119
                display: flex;
                flex-direction: row;
                align-items:flex-start;
                justify-content: center;
                flex-wrap: wrap;
            }
            #sites-data-container .site-data-container {
Michał Woźniak's avatar
Michał Woźniak committed
120
                display: flex;
Michał Woźniak's avatar
Michał Woźniak committed
121
                flex-direction: column;
122
123
                align-items:center;
                width:23em;
Michał Woźniak's avatar
Michał Woźniak committed
124
            }
Michał Woźniak's avatar
Michał Woźniak committed
125
126
127
128
129
130
131
132
            footer {
                font-size: 70%;
                text-align:center;
                opacity:0.8;
                line-height:150%;
                font-family: Monospace;
                background: black;
            }
133
            .site-data-container .sites-select {
Michał Woźniak's avatar
Michał Woźniak committed
134
135
136
137
138
139
140
141
142
143
                display: inline;
                -moz-appearance: none;
                -webkit-appearance: none;
                appearance: none;
                border:dotted 1px springgreen;
                padding:0.25em;
                background:none;
                color:springgreen;
                font-family: inherit;
                font-size:inherit;
144
                min-width:15em;
Michał Woźniak's avatar
Michał Woźniak committed
145
            }
146
            .site-data-container .sites-select option {
147
148
                font-size:70%;
            }
149
            .site-data-container h2 {
Michał Woźniak's avatar
Michał Woźniak committed
150
151
                position:relative;
            }
152
            .site-data-container h2::after {
Michał Woźniak's avatar
Michał Woźniak committed
153
154
155
156
157
158
159
                position:absolute;
                right:0.5em;
                top:0.25em;
                content: "▾";
                display: block;
                color: springgreen;
            }
160
161
            #add-site-container {
                order:99;
162
163
                width:0px;
                height:0px;
164
165
166
167
168
169
            }
            #add-site {
                font-size: 250%;
                text-decoration: none;
                border: dotted 1px springgreen;
                width: 1em;
170
                height: 0.97em;
171
172
173
174
175
                line-height: 90%;
                outline:none;
                text-align: Center;
                margin-top: 0.47em;
                color: springgreen;
Michał Woźniak's avatar
Michał Woźniak committed
176
177
178
179
                display:none;
            }
            #add-site.visible {
                display: inline-block;
180
            }
Michał Woźniak's avatar
charts!    
Michał Woźniak committed
181
182
183
            #the-chart {
                height:50vh;
            }
Michał Woźniak's avatar
Michał Woźniak committed
184
        </style>
185
186
    </head>
    <body>
187
188
189
190
191
192
193
194
        <h1>Scary COVID-19 data</h1>
        <div id="covid-stats">
            <h2>Global stats</h2>
            <div id="confirmed"><span class="label">Confirmed cases:</span> <span class="value"></span></div>
            <div id="deaths"><span class="label">Deaths:</span> <span class="value"></span></div>
            <div id="recovered"><span class="label">Recovered:</span> <span class="value"></span></div>
            <div id="mortality"><span class="label">Mortality rate:</span> <span class="value"></span></div>
        </div>
Michał Woźniak's avatar
Michał Woźniak committed
195
        <div class="sources"><a href="https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic">source</a></div>
196
        <div id="sites-data-container">
197
            <div id="add-site-container"><a href="#add-site" id="add-site">+</a></div>
198
199
200
201
202
203
            <div class="site-data-container">
                <h2><select class="sites-select" tabindex="1">
                    <option value="select one">(select an area)</option>
                </select></h2>
                <div class="site-data">
                </div>
Michał Woźniak's avatar
Michał Woźniak committed
204
            </div>
205
        </div>
Michał Woźniak's avatar
charts!    
Michał Woźniak committed
206
207
208
        <div id="the-chart-container">
            <canvas id="the-chart"></canvas>
        </div>
209
        <p><strong>Disclaimer:</strong> this is all back-of-the-napkin math using data from Wikipedia. Take with a grain (or preferably, a spoonfull) of salt. Check your own sources; some great resources: <a href="http://covid.hi.is/">University of Iceland's COVID data model</a> (and its <a href="https://github.com/bgautijonsson/covid19/">sources</a>).</p>
210
        <footer>
Michał Woźniak's avatar
Michał Woźniak committed
211
            <p>cobbled together by <a href="https://mastodon.social/@rysiek/">@rysiek</a>; <a href="https://git.rys.io/rysiek/covid/">code is here</a>; license: <a href="./LICENSE">Affero GPL</a><br/>
Michał Woźniak's avatar
charts!    
Michał Woźniak committed
212
            uses <a href="https://github.com/spencermountain/wtf_wikipedia"><code>wtf_wikipedia</code></a> and <a href="https://www.chartjs.org/">Charts.js</a> (both <a href="./LICENSE.wtf_wikipedia-charts.js.txt">MIT-licensed</a>) and the Play font (licensed under the <a href="./Play/OFL.txt">OFL</a>)<br/>
Michał Woźniak's avatar
Michał Woźniak committed
213
            data from Wikipedia</p>
214
        </footer>
215
216
    </body>
</html>