Added command to add line :D
This commit is contained in:
parent
63dc472372
commit
6f590990ca
1 changed files with 12 additions and 4 deletions
16
index.html
16
index.html
|
@ -20,7 +20,7 @@
|
|||
border: 1px solid black;
|
||||
}
|
||||
.ball {
|
||||
-webkit-transition: left 0.5s linear, top 0.5s linear;
|
||||
-webkit-transition: left 0.1s linear, top 0.1s linear;
|
||||
position: absolute;
|
||||
}
|
||||
.ball .bullet {
|
||||
|
@ -133,8 +133,13 @@
|
|||
}
|
||||
|
||||
function drawEnd(line){
|
||||
console.log(JSON.stringify(line));
|
||||
drawRemove(line);
|
||||
line.line_kind = 1;
|
||||
var packet = {
|
||||
command: 'add line',
|
||||
data: line
|
||||
};
|
||||
websocket.send(JSON.stringify(packet));
|
||||
}
|
||||
|
||||
function drawRemove(line){
|
||||
|
@ -149,8 +154,11 @@
|
|||
name: myName,
|
||||
size: {width: window.innerWidth, height: window.innerHeight}
|
||||
};
|
||||
|
||||
websocket.send(JSON.stringify(myself));
|
||||
var packet = {
|
||||
command: 'update user',
|
||||
data: myself
|
||||
};
|
||||
websocket.send(JSON.stringify(packet));
|
||||
}
|
||||
|
||||
window.addEventListener("load", init, false);
|
||||
|
|
Reference in a new issue