Added timer
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Copyright John Salguero All rights Reserved
|
||||
//const socket = new WebSocket("ws://localhost:8000/ws");
|
||||
const socket = new WebSocket("ws://10.0.0.50:8000/ws");
|
||||
let problemData = null;
|
||||
@@ -13,15 +14,16 @@ socket.onopen = () => {
|
||||
|
||||
socket.onmessage = (event) => {
|
||||
const msg = JSON.parse(event.data);
|
||||
console.log("Received problem:", msg);
|
||||
|
||||
if (msg.type === "generated_problem") {
|
||||
|
||||
problemData = msg.data;
|
||||
stepIndex = 0;
|
||||
|
||||
showProblem();
|
||||
|
||||
// start animation sequence
|
||||
startSteps();
|
||||
initial_duration = msg.time;
|
||||
startTimer(msg.time);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user