forked from quic-issues/427e7578-d7bf-49c8-aee9-2dd999e25316
Implement P2P polling app with Yjs and WebRTC
Uses Yjs CRDTs for conflict-free shared state and y-webrtc for peer-to-peer data exchange. Users can add poll options and vote/unvote, with all changes syncing in real-time across connected peers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
33
index.html
Normal file
33
index.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>P2P Poll</title>
|
||||
<link rel="stylesheet" href="/src/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<header>
|
||||
<h1>P2P Poll</h1>
|
||||
<div id="status">
|
||||
<span id="connection-status" class="connecting">Connecting...</span>
|
||||
<span id="peer-count">1 peer</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<div id="add-option">
|
||||
<input type="text" id="option-input" placeholder="Add a poll option..." maxlength="100">
|
||||
<button id="add-btn">Add</button>
|
||||
</div>
|
||||
|
||||
<div id="poll-options"></div>
|
||||
|
||||
<p id="empty-state">No options yet. Add one above!</p>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user