88 lines
3.6 KiB
HTML
88 lines
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>The Button</title>
|
|
<link rel="stylesheet" href="/style.css">
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<h1>THE BUTTON</h1>
|
|
|
|
<section id="timer-section">
|
|
<div id="countdown" class="zone-green">--:--:--.--</div>
|
|
<div id="zone-label"></div>
|
|
<div id="zone-bar"><div id="zone-marker"></div></div>
|
|
</section>
|
|
|
|
<section id="button-section">
|
|
<button id="the-button" class="zone-green" disabled>PRESS</button>
|
|
<p id="press-result" aria-live="polite"></p>
|
|
</section>
|
|
|
|
<section id="register-section" hidden>
|
|
<h2>Log in or join the game</h2>
|
|
<form id="register-form">
|
|
<input id="name-input" maxlength="24" placeholder="Your name" required autocomplete="username">
|
|
<input id="password-input" type="password" minlength="8" maxlength="128" placeholder="Password (8+ chars)" required autocomplete="current-password">
|
|
<button type="submit" value="login">Log in</button>
|
|
<button type="submit" value="register">Sign up</button>
|
|
</form>
|
|
<p id="register-error" class="error"></p>
|
|
</section>
|
|
|
|
<section id="me-section" hidden>
|
|
<h2>Your score: <span id="my-name"></span></h2>
|
|
<button id="logout-button" type="button">Log out</button>
|
|
<p id="my-subscribed" hidden>You're on the mailing list. Thanks!</p>
|
|
<p>Total points: <strong id="my-points">0</strong> · Presses: <strong id="my-presses">0</strong></p>
|
|
<table id="my-zones" class="zone-table"></table>
|
|
<details>
|
|
<summary>Your press history</summary>
|
|
<table id="my-history"></table>
|
|
</details>
|
|
</section>
|
|
|
|
<section id="stats-section" hidden>
|
|
<h2>Game over — final global stats</h2>
|
|
<div id="stats-summary"></div>
|
|
<h3>Presses per zone</h3>
|
|
<table id="stats-zones" class="zone-table"></table>
|
|
<h3>Leaderboard</h3>
|
|
<table id="stats-leaderboard"></table>
|
|
<details>
|
|
<summary>Full press log</summary>
|
|
<table id="stats-log"></table>
|
|
</details>
|
|
</section>
|
|
|
|
<section id="rules">
|
|
<h2>Rules</h2>
|
|
<ul>
|
|
<li>A 24 hour countdown resets whenever anyone presses the button.</li>
|
|
<li>If the countdown reaches zero, the game is over forever.</li>
|
|
<li>The lower the countdown when you press, the more points you score.</li>
|
|
<li>Zones: <span id="rules-zones"></span></li>
|
|
<li>Each press scores the fixed point value of the zone it lands in.</li>
|
|
<li>Global stats are published when the game ends.</li>
|
|
<li>Inspired by the original <a href="https://en.wikipedia.org/wiki/The_Button_(Reddit)">Reddit "The Button"</a> experiment.</li>
|
|
</ul>
|
|
</section>
|
|
|
|
<section id="mailing-list" hidden>
|
|
<h2>Join the mailing list to keep up with <a href="https://www.eom.dev/">Eric</a>'s projects</h2>
|
|
<form id="subscribe-form">
|
|
<input id="sub-first" maxlength="50" placeholder="First name" required autocomplete="given-name">
|
|
<input id="sub-last" maxlength="50" placeholder="Last name (optional)" autocomplete="family-name">
|
|
<input id="sub-email" type="email" maxlength="254" placeholder="Email" required autocomplete="email">
|
|
<input id="sub-phone" type="tel" maxlength="25" placeholder="Phone (optional)" autocomplete="tel">
|
|
<button type="submit">Sign up</button>
|
|
</form>
|
|
<p id="subscribe-result" aria-live="polite"></p>
|
|
</section>
|
|
</main>
|
|
<script src="/app.js"></script>
|
|
</body>
|
|
</html>
|