|
|
|
@ -19,23 +19,17 @@
|
|
|
|
|
// Split the data into separate parts
|
|
|
|
|
const [node, value] = data.split(' ');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (node === 'node3' && value === '15') {
|
|
|
|
|
// Change the background color to red
|
|
|
|
|
document.body.style.backgroundColor = 'red';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (node === 'node4' && value === '21') {
|
|
|
|
|
} else if (node === 'node4' && value === '21') {
|
|
|
|
|
// Change the background color to blue
|
|
|
|
|
document.body.style.backgroundColor = 'blue';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
// Restore the default background color
|
|
|
|
|
document.body.style.backgroundColor = 'white';
|
|
|
|
|
document.body.style.backgroundColor = rgb(26, 26, 26);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
function sendMessage() {
|
|
|
|
|
const inputField = document.getElementById('input');
|
|
|
|
|
const message = inputField.value;
|
|
|
|
|