changed color picking, removed server pings
This commit is contained in:
parent
554bcb4bd3
commit
2ba725f232
|
@ -5,7 +5,7 @@ services:
|
|||
image: pixelbattle
|
||||
build: .
|
||||
ports:
|
||||
- 8089:8089
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- ./pb-data:/usr/src/app/data
|
||||
# - ./settings.json:/usr/src/app/settings.json
|
||||
|
|
|
@ -128,6 +128,11 @@ function redraw() {
|
|||
|
||||
// All the code that is making zooms and moving around cavnas is made with big help of http://phrogz.net/tmp/canvas_zoom_to_cursor.html. Thanks alot!
|
||||
window.onload = function() {
|
||||
colorInput.addEventListener("change", (e) => {
|
||||
console.log("changed")
|
||||
currentColor = e.target.value;
|
||||
}, false);
|
||||
|
||||
connect();
|
||||
var ctx = canvas.getContext("2d");
|
||||
trackTransforms(ctx);
|
||||
|
|
13
src/index.js
13
src/index.js
|
@ -143,13 +143,14 @@ server.on('connection', (client) => {
|
|||
});
|
||||
|
||||
|
||||
const pingClient = () => {
|
||||
clients.forEach(client => {
|
||||
client.send(JSON.stringify({}));
|
||||
});
|
||||
};
|
||||
// const pingClient = () => {
|
||||
// clients.forEach(client => {
|
||||
// client.send(JSON.stringify({}));
|
||||
// });
|
||||
// };
|
||||
|
||||
// setInterval(pingClient, 15000)
|
||||
|
||||
setInterval(pingClient, 15000)
|
||||
app.get('/', (req, res) => {
|
||||
res.render('index.pug', { root: __dirname, server: serverAddress, port: httpPort });
|
||||
})
|
||||
|
|
|
@ -13,7 +13,6 @@ html(lang='en')
|
|||
input(type="button" id="server-button" value="connect" onclick="connect()")
|
||||
p
|
||||
input(type="color" id="color")
|
||||
input(type="button" id="submicColor" value="change color" onclick="changeColor()")
|
||||
br
|
||||
| timer:
|
||||
b(id="timer")
|
||||
|
|
Loading…
Reference in New Issue