This commit is contained in:
赵鑫 2022-09-01 14:03:56 +08:00
parent 1197a942f5
commit dd20ee101a

View File

@ -145,6 +145,13 @@
const action = led.classList.toggle('on') ? 'on' : 'off'
client.emit('action', { action, x, y })
}
client.on('leds', (array) => {
const leds = document.querySelectorAll('.led')
for (let i = 0; i < 64; i++) {
if (array[i] == 1) led.classList.add('on')
else led.classList.remove('on')
}
})
</script>
</body>