58 lines
2.9 KiB
HTML
58 lines
2.9 KiB
HTML
|
|
<!doctype html>
|
||
|
|
<html lang="en">
|
||
|
|
<head>
|
||
|
|
<meta charset="utf-8">
|
||
|
|
<title>typo</title>
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
|
|
<meta name="description" content="A typing test built from your own code — real snippets from real repos.">
|
||
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||
|
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Inter:wght@400;500;600&display=swap" rel="stylesheet" />
|
||
|
|
<link rel="stylesheet" href="style.css">
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div id="app">
|
||
|
|
<div class="header-row">
|
||
|
|
<h1>typo</h1>
|
||
|
|
<button class="help-btn" id="help-btn" title="How this works">?</button>
|
||
|
|
</div>
|
||
|
|
<p class="hint">real code, from real repos — type it as fast and cleanly as you can</p>
|
||
|
|
|
||
|
|
<div class="card" id="game-card">
|
||
|
|
<div class="source-line" id="source-line">loading a snippet…</div>
|
||
|
|
<pre class="code-display" id="code-display"></pre>
|
||
|
|
<textarea id="typing-input" class="sr-input" autocomplete="off" autocapitalize="off" autocorrect="off" spellcheck="false" aria-label="Type the code shown above"></textarea>
|
||
|
|
|
||
|
|
<div class="stat-row" id="stat-row">
|
||
|
|
<div class="stat"><span class="stat-value" id="stat-wpm">0</span><span class="stat-label">wpm</span></div>
|
||
|
|
<div class="stat"><span class="stat-value" id="stat-acc">100%</span><span class="stat-label">accuracy</span></div>
|
||
|
|
<div class="stat"><span class="stat-value" id="stat-kps">0.0</span><span class="stat-label">keys/sec</span></div>
|
||
|
|
<div class="stat"><span class="stat-value" id="stat-time">0.0s</span><span class="stat-label">time</span></div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="actions">
|
||
|
|
<button class="btn btn-primary" id="restart-btn">new snippet</button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="modal-overlay" id="help-modal" hidden>
|
||
|
|
<div class="modal-card">
|
||
|
|
<div class="modal-header">
|
||
|
|
<span>how it works</span>
|
||
|
|
<button class="help-btn" id="close-help">×</button>
|
||
|
|
</div>
|
||
|
|
<ul>
|
||
|
|
<li>Every snippet is real code pulled from real, shipped repos — flit, wisp, keep, stash, delve-term, goonk itself.</li>
|
||
|
|
<li>Click the code block and start typing. Timing starts on your first keystroke, not on page load.</li>
|
||
|
|
<li><strong>WPM</strong> = (correct characters / 5) / minutes elapsed — the standard typing-test formula.</li>
|
||
|
|
<li><strong>Accuracy</strong> = correct keystrokes / total keystrokes, including ones you backspaced over.</li>
|
||
|
|
<li>Mistakes are highlighted in place. You can backspace to fix them or keep going — either way, they count against accuracy.</li>
|
||
|
|
<li>Tabs in the original source are shown as two spaces, so you never need to press Tab.</li>
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<script src="app.js"></script>
|
||
|
|
</body>
|
||
|
|
</html>
|