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 image: pixelbattle
build: . build: .
ports: ports:
- 8089:8089 - 8080:8080
volumes: volumes:
- ./pb-data:/usr/src/app/data - ./pb-data:/usr/src/app/data
# - ./settings.json:/usr/src/app/settings.json # - ./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! // 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() { window.onload = function() {
colorInput.addEventListener("change", (e) => {
console.log("changed")
currentColor = e.target.value;
}, false);
connect(); connect();
var ctx = canvas.getContext("2d"); var ctx = canvas.getContext("2d");
trackTransforms(ctx); trackTransforms(ctx);

View File

@ -143,13 +143,14 @@ server.on('connection', (client) => {
}); });
const pingClient = () => { // const pingClient = () => {
clients.forEach(client => { // clients.forEach(client => {
client.send(JSON.stringify({})); // client.send(JSON.stringify({}));
}); // });
}; // };
// setInterval(pingClient, 15000)
setInterval(pingClient, 15000)
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.render('index.pug', { root: __dirname, server: serverAddress, port: httpPort }); 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()") input(type="button" id="server-button" value="connect" onclick="connect()")
p p
input(type="color" id="color") input(type="color" id="color")
input(type="button" id="submicColor" value="change color" onclick="changeColor()")
br br
| timer: | timer:
b(id="timer") b(id="timer")