diff --git a/html/index.html b/html/index.html
index 30139fe..dc190b5 100644
--- a/html/index.html
+++ b/html/index.html
@@ -1,67 +1,112 @@
+
-
-
-
-
-
- Waiting for players...
- Players in Lobby:
-
-
-
+ Multiplayer Word Search Game
+
+
+
+
+
+
+
+
Waiting for players...
+
Players in Lobby:
+
+
+
+
+
-
+ connection.onclose = function () {
+ document.getElementById("topMessage").innerHTML = "Server Offline";
+ };
+ connection.onmessage = function (evt) {
+ var msg = JSON.parse(evt.data);
+ if (msg.action === "updateLobby") {
+ updateLobby(msg.players);
+ document.getElementById("lobby-status").innerHTML = "Waiting for other players...";
+ }
+ };
+
+ function updateLobby(players) {
+ var playersList = "Players in Lobby: " + players.join(", ");
+ document.getElementById("players-in-lobby").innerHTML = playersList;
+ }
+
+ document.getElementById("joinButton").addEventListener("click", function() {
+ var username = document.getElementById("username").value.trim();
+ if (username) {
+ var joinRequest = {
+ action: "join",
+ username: username
+ };
+ connection.send(JSON.stringify(joinRequest));
+ document.getElementById("lobby-status").innerHTML = "Trying to join the game...";
+ } else {
+ alert("Please enter a username.");
+ }
+ });
+
+