This commit is contained in:
赵鑫 2022-09-05 10:38:29 +08:00
parent a59169aa7f
commit fce603b392

View File

@ -143,7 +143,9 @@
function turnon(led) {
const { x, y } = led.dataset
const color = led.classList.toggle('on') ? [0, 0, 0] : [255, 255, 255]
client.emit('operation', { action: 'setPixel', x, y, color })
const action = { action: 'setPixel', x, y, color }
console.log(action)
client.emit('operation', action)
}
// client.on('leds', (array) => {
// const leds = document.querySelectorAll('.led')