-
Notifications
You must be signed in to change notification settings - Fork 2
/
conductor.html
93 lines (77 loc) · 2.45 KB
/
conductor.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
92
<style>
.selected {
background-color: lightblue;
}
</style>
<button id="play-btn">play</button>
<script>
function init() {
console.log("loading");
let play_btn = document.getElementById('play-btn');
play_btn.addEventListener("click", () => {
console.log("click");
if( !play_btn.classList.contains("selected") )
{
play_btn.classList.add("selected");
play_btn.innerHTML = "stop";
drawsocket.sendRoomMessage({
"*" : {
key: "tween",
val: {
id: "score-anim",
cmd: "start"
},
timetag: Date.now() + drawsocket.sync.offset
}
})
}
else
{
play_btn.classList.remove("selected");
play_btn.innerHTML = "play";
drawsocket.sendRoomMessage({
"*" : {
key: "tween",
val: {
id: "score-anim",
cmd: "stop"
}
}
})
}
});
}
init();
/*
<button id="playbutton" class="button ready" onclick="if( !this.classList.contains('ready') )
{
this.classList.add('ready');
drawsocket.input({
key: 'tween',
val: [ {
id: 'score-anim',
cmd : 'play'
}, {
id: 'miniscore-anim',
cmd : 'play'
} ],
timetag: Date.now()
});
} else {
this.classList.remove('ready');
let starttime = document.getElementById('userinput');
drawsocket.input({
key: 'tween',
val: [{
id: 'score-anim',
cmd: 'pause',
time: starttime.value
}, {
id: 'miniscore-anim',
cmd : 'pause',
time: starttime.value
}]
});
}" style="float: left;">play</button>
*/
</script>