changed color picking, removed server pings

This commit is contained in:
leca 2024-04-06 15:26:38 +03:00
parent 554bcb4bd3
commit 2ba725f232
4 changed files with 13 additions and 8 deletions

View File

@ -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

View File

@ -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);

View File

@ -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 });
})

View File

@ -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")