41 lines
1.8 KiB
HTML
41 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>BridgeSwarm – Chat</title>
|
||
<link rel="stylesheet" href="style.css">
|
||
<script>
|
||
if (location.protocol === 'file:') {
|
||
document.documentElement.innerHTML =
|
||
'<body style="margin:0;font:15px/1.5 Segoe UI,system-ui,sans-serif;background:#0f1419;color:#e7ecf3">' +
|
||
'<div style="max-width:36rem;margin:10vh auto;padding:24px;background:#1a2332;border:1px solid #2a3548;border-radius:14px">' +
|
||
'<h1 style="margin:0 0 10px;font-size:1.25rem">Open this demo over HTTP</h1>' +
|
||
'<p style="color:#8b9bb4">Browsers treat each <code>file://</code> URL as a unique security origin, so local demos break.</p>' +
|
||
'<p>From the BridgeSwarm repo root run:</p>' +
|
||
'<pre style="padding:12px;background:#0f1419;border-radius:10px;color:#2dd4bf">npm run examples</pre>' +
|
||
'<p style="color:#8b9bb4">Then open <code>http://127.0.0.1:4173/</code></p>' +
|
||
'</div></body>';
|
||
}
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<h1>BridgeSwarm – Chat</h1>
|
||
<p class="status" id="status">Load the extension, then join a topic. Open this page in another tab or device to chat.</p>
|
||
<div class="row">
|
||
<input type="text" id="topic" placeholder="Topic (e.g. my-chat-room)" value="bridge-swarm-demo">
|
||
<button class="primary" id="btnJoin">Join</button>
|
||
<button class="danger" id="btnLeave" disabled>Leave</button>
|
||
</div>
|
||
<div class="peers" id="peers">Peers: 0</div>
|
||
<div class="peers" id="publicKey">Your public key: (join to generate)</div>
|
||
<div class="row">
|
||
<input type="text" id="message" placeholder="Type a message..." disabled>
|
||
<button class="primary" id="btnSend" disabled>Send</button>
|
||
</div>
|
||
<div class="log" id="log"></div>
|
||
|
||
<script src="app.js"></script>
|
||
</body>
|
||
</html>
|