-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
77 lines (72 loc) · 3.59 KB
/
index.html
File metadata and controls
77 lines (72 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Decentralized Discord — Chat Demo</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: monospace; background: #1a1a2e; color: #e0e0e0; padding: 1rem; }
h1 { font-size: 1.2rem; margin-bottom: 1rem; color: #00d4ff; }
h2 { font-size: 1rem; margin-bottom: 0.5rem; color: #7b8cde; }
section { margin-bottom: 1rem; padding: 0.75rem; background: #16213e; border-radius: 4px; }
#status span { display: block; margin-bottom: 0.25rem; }
.label { color: #888; }
.row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.row input { flex: 1; background: #0f3460; color: #e0e0e0; border: 1px solid #333; border-radius: 2px; padding: 0.3rem 0.5rem; font-family: monospace; }
.row button, #send-form button { background: #0f3460; color: #00d4ff; border: 1px solid #00d4ff; border-radius: 2px; cursor: pointer; padding: 0.3rem 0.75rem; font-family: monospace; }
.row button:disabled, #send-form button:disabled { opacity: 0.4; cursor: default; }
.separator { color: #555; text-align: center; margin: 0.25rem 0; }
#room-info { margin-top: 0.5rem; word-break: break-all; font-size: 0.85rem; }
#peers { min-height: 2rem; }
.peer { padding: 0.25rem 0; }
.peer button { margin-left: 0.5rem; background: #0f3460; color: #e0e0e0; border: 1px solid #00d4ff; border-radius: 2px; cursor: pointer; padding: 0.1rem 0.5rem; }
#log { max-height: 300px; overflow-y: auto; font-size: 0.85rem; }
#log div { padding: 0.15rem 0; border-bottom: 1px solid #1a1a2e; }
.log-system { color: #7b8cde; }
.log-sent { color: #00d4ff; }
.log-received { color: #4ecca3; }
#send-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
#send-form input { flex: 1; background: #0f3460; color: #e0e0e0; border: 1px solid #333; border-radius: 2px; padding: 0.3rem 0.5rem; font-family: monospace; }
</style>
</head>
<body>
<h1>Chat Demo</h1>
<section id="status">
<h2>Identity</h2>
<span><span class="label">PeerId:</span> <span id="peer-id">generating...</span></span>
<span><span class="label">Fingerprint:</span> <span id="fingerprint">—</span></span>
<span><span class="label">Relay:</span> <span id="relay-status">disconnected</span></span>
</section>
<section>
<h2>Room</h2>
<div id="room-controls">
<div class="row">
<input id="room-name" type="text" placeholder="Room name..." autocomplete="off" />
<button id="create-room-btn">Create</button>
</div>
<div class="separator">— or —</div>
<div class="row">
<input id="room-id-input" type="text" placeholder="Paste room ID to join..." autocomplete="off" />
<button id="join-room-btn">Join</button>
</div>
</div>
<div id="room-info" style="display: none;">
<span class="label">Room ID:</span> <span id="room-id"></span>
</div>
</section>
<section>
<h2>Connected Peers</h2>
<div id="peers"><span class="label">No peers yet</span></div>
</section>
<section>
<h2>Messages</h2>
<div id="log"></div>
<form id="send-form">
<input id="message-input" type="text" placeholder="Type a message..." autocomplete="off" />
<button type="submit" id="send-btn" disabled>Send</button>
</form>
</section>
<script type="module" src="/src/main.ts"></script>
</body>
</html>