MultiplayerMinesweeper/client/scripts/interface/game/connection.js

15 lines
343 B
JavaScript
Raw Permalink Normal View History

const statusElement = document.getElementById("status")
export function updateConnectionStatus(connection) {
statusElement.textContent = `Server Connection: ${connection}`
switch (connection) {
case "connected":
statusElement.style.color = "green";
break;
case "disconnected":
statusElement.style.color = "red";
break;
}
}