feat: Website (#15)
Add a basic website that shows the current flutgrid state Co-authored-by: Noa Aarts <noa@voorwaarts.nl>
This commit is contained in:
parent
6c9de45c6a
commit
7f04b39a15
12 changed files with 1095 additions and 75 deletions
13
test.js
Normal file
13
test.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const ws = new WebSocket("ws://127.0.0.1:3000/imgstream?canvas=0");
|
||||
console.log("Connecting");
|
||||
ws.onopen = () => {
|
||||
console.log("Connected");
|
||||
}
|
||||
ws.onmessage = (msg) => {
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(msg.data);
|
||||
reader.onloadend = function() {
|
||||
var base64data = reader.result;
|
||||
document.getElementById("image").src = base64data;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue