forked from quic-issues/427e7578-d7bf-49c8-aee9-2dd999e25316
55 lines
1.7 KiB
HTML
55 lines
1.7 KiB
HTML
<!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="styles.css" />
|
|
<!-- Gun.js via CDN for quick start -->
|
|
<script src="https://unpkg.com/gun/gun.js"></script>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>P2P Poll</h1>
|
|
|
|
<section id="setup" class="card">
|
|
<h2>Start or Join Poll</h2>
|
|
<div class="field">
|
|
<label for="pollId">Poll ID (share with peer):</label>
|
|
<input id="pollId" type="text" placeholder="e.g. my-poll-123" />
|
|
</div>
|
|
<button id="loadPollBtn">Load Poll</button>
|
|
<button id="createPollBtn">Create New Poll</button>
|
|
<p class="note">Tip: You can run two instances and connect by using the same Poll ID.</p>
|
|
</section>
|
|
|
|
<section id="poll" class="card" style="display:none;">
|
|
<h2>Poll</h2>
|
|
<div class="field">
|
|
<label for="pollTitle">Poll Title</label>
|
|
<input id="pollTitle" type="text" placeholder="Poll Title" />
|
|
<button id="setTitleBtn">Set Title</button>
|
|
</div>
|
|
|
|
<div id="options" class="options">
|
|
<!-- dynamic options will render here -->
|
|
</div>
|
|
|
|
<div class="field">
|
|
<input id="newOption" type="text" placeholder="Add a new option" />
|
|
<button id="addOptionBtn">Add Option</button>
|
|
</div>
|
|
|
|
<div class="summary">
|
|
<p>Total votes: <span id="totalVotes">0</span></p>
|
|
</div>
|
|
|
|
<div class="share">
|
|
<p>Share Poll ID with peer: <code id="pollIdDisplay"></code></p>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<script src="app.js"></script>
|
|
</body>
|
|
</html> |