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;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
.ball {
|
.ball {
|
||||||
-webkit-transition: left 0.5s linear, top 0.5s linear;
|
-webkit-transition: left 0.1s linear, top 0.1s linear;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
.ball .bullet {
|
.ball .bullet {
|
||||||
|
@ -133,8 +133,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawEnd(line){
|
function drawEnd(line){
|
||||||
console.log(JSON.stringify(line));
|
|
||||||
drawRemove(line);
|
drawRemove(line);
|
||||||
|
line.line_kind = 1;
|
||||||
|
var packet = {
|
||||||
|
command: 'add line',
|
||||||
|
data: line
|
||||||
|
};
|
||||||
|
websocket.send(JSON.stringify(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawRemove(line){
|
function drawRemove(line){
|
||||||
|
@ -149,8 +154,11 @@
|
||||||
name: myName,
|
name: myName,
|
||||||
size: {width: window.innerWidth, height: window.innerHeight}
|
size: {width: window.innerWidth, height: window.innerHeight}
|
||||||
};
|
};
|
||||||
|
var packet = {
|
||||||
websocket.send(JSON.stringify(myself));
|
command: 'update user',
|
||||||
|
data: myself
|
||||||
|
};
|
||||||
|
websocket.send(JSON.stringify(packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("load", init, false);
|
window.addEventListener("load", init, false);
|
||||||
|
|
Reference in a new issue