testwsio / public /index.html
ulduldp's picture
Update public/index.html
5631958 verified
raw
history blame contribute delete
782 Bytes
<!DOCTYPE html>
<html>
<head><title>Voice Chat</title></head>
<body>
<h2>🎤 Voice Chat</h2>
<input id="name" placeholder="Enter your name"><br><br>
<input id="room" placeholder="Enter room code"><br><br>
<button onclick="createRoom()">Create Room</button>
<button onclick="joinRoom()">Join Room</button>
<script>
function createRoom() {
const name = document.getElementById("name").value;
const room = Math.random().toString(36).substr(2, 6);
location.href = `/room.html?room=${room}&name=${name}`;
}
function joinRoom() {
const name = document.getElementById("name").value;
const room = document.getElementById("room").value;
location.href = `/room.html?room=${room}&name=${name}`;
}
</script>
</body>
</html>