-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
74 lines (74 loc) · 1.84 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>untitled</title>
<style type="text/css">
body {
color: white;
background-color: black;
font-family: sans-serif;
}
#slides, #notes {
display: flex;
}
#slides > div, #notes > div {
flex-basis: 50%;
margin: 0.5em;
padding: 1em;
border: 1px solid #666;
}
#slide2, #nnotes {
opacity: 0.5;
}
img {
max-width: 100%;
max-height: 400px;
}
</style>
</head>
<body>
<div id="slides">
<div id="slide1"></div>
<div id="slide2"></div>
</div>
<div>
<span id="curr"></span> / <span id="tot"></span>
</div>
<div id="notes">
<div id="cnotes"></div>
<div id="nnotes"></div>
</div>
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io();
var slide1 = document.getElementById('slide1');
var slide2 = document.getElementById('slide2');
var notes = document.getElementById('cnotes');
var nnotes = document.getElementById('nnotes');
var curr = document.getElementById('curr');
var tot = document.getElementById('tot');
socket.on('slide', function(data) {
slide1.innerHTML = data.current;
slide2.innerHTML = data.next;
notes.innerHTML = data.notes;
nnotes.innerHTML = data.nextNotes;
curr.innerHTML = data.num;
tot.innerHTML = data.total;
});
document.addEventListener('keyup', function(e) {
console.log(e.which);
switch(e.which) {
case 39:
case 40:
socket.emit('next');
break;
case 37:
case 38:
socket.emit('prev');
break;
}
});
</script>
</body>
</html>