@AlephZero/

PeerJS Chat

HTML, CSS, JS

No description

fork
loading
Files
  • index.html
  • script.js
  • style.css
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>PeerJS</title>

    <link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
    <link href="style.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/peerjs.min.js"></script>
    <script src="script.js"></script>
</head>
<body>
    <p>Your ID: <span id="my-id"></span></p>
    <button onclick="startChat()">Start Chat</button>
    <div id="chat">

    </div>
    <p><input type="text" id="new-message-input"><button onclick="sendMessage()">Send Message</button></p>
</body>
</html>
result
console