Added timer

This commit is contained in:
2026-05-04 15:32:19 -04:00
parent fbe46b8215
commit 93f0fa7c09
8 changed files with 203 additions and 83 deletions

View File

@@ -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);
}
};