Add admin role with an admin-only hand range study page

- Optional ADMIN_KEY (6 digits, distinct from ACCESS_KEY): entering it on the
  key screen signs in as admin (role-specific HMAC cookie; member cookies
  stay valid). Logged-in members can open /key?admin to enter it.
- /range (range chart + color/category quiz, ported from poker-hand and
  restyled to the site design) and its files under admin/ are served only to
  admins; everyone else gets 404. Card images cached privately for a day.
- Lobby shows a link to the page for admins only (GET /api/me).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
agomizi1cmandClaude Opus 5.5 committed 2026-10-16 12:13:14 +09:00
1 parent 1e1ac4e91d
commit e89d867f85
64 files changed
+477 -19

No files matched your search

+75
View File
@@ -0,0 +1,75 @@
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="theme-color" content="#24493b">
<meta name="robots" content="noindex, nofollow">
<title>ハンドレンジ - Hold'em Night</title>
<link rel="icon" href="/assets/favicon.ico">
<link rel="stylesheet" href="/assets/style.css">
<link rel="stylesheet" href="/range/files/range.css">
</head>
<body>
<main class="wrap range-wrap">
<div class="topbar">
<a class="icon-btn" href="/" aria-label="ロビーへ戻る">←</a>
<h1>ハンドレンジ</h1>
</div>
<div class="seg" id="tabs">
<button type="button" class="seg-btn active" data-view="range">レンジ表</button>
<button type="button" class="seg-btn" data-view="quiz">クイズ</button>
</div>
<!-- レンジ表 -->
<section id="view-range">
<div class="range-matrix" id="matrix" aria-label="13×13 ハンドレンジ表"></div>
<div class="range-legend" id="legend"></div>
<div class="card mt-12" id="selected">
<div class="sel-hand">—</div>
<div class="hint">セルをタップすると分類を確認できます</div>
</div>
<button type="button" class="btn btn-orange btn-block mt-12" id="start-from-range">クイズを始める</button>
</section>
<!-- クイズ -->
<section id="view-quiz" hidden>
<div class="label">問題数(全169ハンドからランダム)</div>
<div class="seg" id="count">
<button type="button" class="seg-btn active" data-count="10">10問</button>
<button type="button" class="seg-btn" data-count="20">20問</button>
<button type="button" class="seg-btn" data-count="0">全問</button>
</div>
<div class="quiz-progress"><i id="progress-bar"></i></div>
<div class="quiz-stats">
<span id="q-count">開始前</span>
<span id="q-score">正解 0 / 0</span>
<span id="q-accuracy">正答率 --</span>
</div>
<div class="card quiz-hand">
<div class="quiz-cards">
<img id="card-1" alt="" hidden>
<img id="card-2" alt="" hidden>
</div>
<div class="quiz-hand-name" id="q-hand">?</div>
<div class="hint" id="q-prompt">「開始」を押してください</div>
</div>
<div class="quiz-answers" id="answers"></div>
<div class="quiz-feedback" id="feedback" aria-live="polite" hidden></div>
<div class="row mt-12">
<button type="button" class="btn btn-dark" id="start-quiz">開始</button>
<button type="button" class="btn btn-blue" id="next-question" disabled>次の問題 →</button>
</div>
</section>
</main>
<script src="/range/files/range.js"></script>
</body>
</html>