28 lines
554 B
HTML
28 lines
554 B
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>Pomodoro Timer</title>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<h1>Pomodoro Timer</h1>
|
||
|
<div id="timer">Connecting to server...</div>
|
||
|
|
||
|
<script>
|
||
|
var ws = new WebSocket("ws://localhost:8080/ws");
|
||
|
|
||
|
ws.onmessage = function (event) {
|
||
|
document.getElementById("timer").innerText = event.data;
|
||
|
};
|
||
|
|
||
|
ws.onclose = function () {
|
||
|
document.getElementById("timer").innerText = "Connection closed.";
|
||
|
};
|
||
|
</script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|