-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
executable file
·125 lines (102 loc) · 2.65 KB
/
main.html
File metadata and controls
executable file
·125 lines (102 loc) · 2.65 KB
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
<!doctype html>
<html lang="en">
<head>
<title>32151183</title>
<meta charset="utf-8">
<style type="text/css">
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
background: #000000 url(loading.gif) center center no-repeat;
color: #ffffff;
font-family: sans-serif;
font-size: 13px;
line-height: 20px;
height: 100%;
}
#info {
font-size: 11px;
position: absolute;
bottom: 5px;
background-color: rgba(0, 0, 0, 0.9);
border-radius: 3px;
right: 10px;
padding: 10px;
}
a {
color: #aaa;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.bull {
padding: 0px 5px;
color: #555;
}
#title {
position: absolute;
top: 20px;
width: 320px;
left: 20px;
background-color: rgba(0, 0, 0, 0.2);
font: 20px/20px Georgia;
padding: 15px;
}
#ce span {
display: none;
}
#ce {
width: 107px;
height: 55px;
display: block;
position: absolute;
bottom: 15px;
left: 20px;
background: url(/globe/ce.png);
}
</style>
</head>
<body>
<div id="container">
</div>
<div id="info">
<h1>Powered by</h1> <a href="http://www.chromeexperiments.com/globe"><h1>WebGL Globe</h1></a> <span
class="bull">•</span> <h1>Data from </h1> <a href="https://github.com/CSSEGISandData/COVID-19"><h1>Johns Hopkins Hospital</h1>
</a><span class="bull">•</span> <h1>Processed by</h1> <a href="https://github.com/anthonyftwang/webgl-globe-covid19"> <h1>Chan Gyeong Kim</h1>
</a>
<h1>
Information about the United States has been added separately.
</h1>
</div>
<div id="title">
COVID-19 Confirmed Cases
</div>
<script type="text/javascript" src="./third-party/Detector.js"></script>
<script type="text/javascript" src="./third-party/three.min.js"></script>
<script type="text/javascript" src="./globe.js"></script>
<script type="text/javascript">
var globe = DAT.Globe(document.getElementById('container'));
var xhr = new XMLHttpRequest();
xhr.open('GET', './test.json', true);
xhr.onreadystatechange = function(e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText);
window.data = data;
for ( var i = 0; i < data.length; i ++ ) {
globe.addData( data[i][1], {format: 'magnitude', name: data[i][0]} );
}
globe.createPoints();
globe.animate();
document.body.style.backgroundImage = 'none'; // remove loading
}
}
};
xhr.send(null);
</script>
</body>
</html>