-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
40 lines (34 loc) · 832 Bytes
/
index.html
File metadata and controls
40 lines (34 loc) · 832 Bytes
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
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body{
background:black;
color:white;
font-size:60px;
padding:50px;
font-family:Arial, 'Malgun Gothic';
}
</style>
</head>
<body>
<div id="content">
</div>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
<script>
function show(html){
d3.select('#content').html(html)
}
document.addEventListener('DOMContentLoaded', () =>{
let socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on('connect', function() {
socket.on('update', function(html){
console.log('updated')
show(html);
})
});
})
</script>
</body>
</html>