You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
578 B
16 lines
578 B
<div class="centered-circle"></div>
|
|
|
|
<script>
|
|
ws = new WebSocket("ws://localhost/server")
|
|
ws.onmessage = event => {
|
|
if (event.data == "user_start_message") {
|
|
document.body.style.backgroundColor = "white"
|
|
document.querySelector('.centered-circle')
|
|
.style.backgroundColor = "black"
|
|
} else if (event.data == "user_end_message") {
|
|
document.body.style.backgroundColor = "black"
|
|
document.querySelector('.centered-circle')
|
|
.style.backgroundColor = "white"
|
|
}
|
|
}
|
|
</script> |