Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ The home page lists one **Games Hub** card (`games/`). Individual games live on
- **Missing Number** (`games/missing/`) — fill the blank in a short +1/+2/+3 sequence; best streak
- **Even or Odd** (`games/even/`) — say whether a number from 1–99 is even or odd; best streak
- **Count the Dots** (`games/dots/`) — 3–9 dots flash briefly; tap the count (flash shortens as the streak grows); best streak
- **Middle Arrow** (`games/arrow/`) — tap the direction of the middle arrow while ignoring the flankers; time limit tightens with the streak; best streak
- **Casual Quiz** (`games/quiz/`) — multiple-choice on India, Tamil Nadu, science, technology, and more, plus a General mix. Switch topic or level anytime. Marks stay in `localStorage`. Questions live only in `games/quiz/questions.json`.

#### How to add or change quiz questions
Expand Down
10 changes: 10 additions & 0 deletions assets/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -1595,3 +1595,13 @@ body[data-tool="collab"] .site-footer { display: none; }
border-radius: 50%;
background: #d4af37;
}

.arrow-row {
font-size: clamp(2rem, 11vw, 3.4rem);
letter-spacing: 0.15em;
text-align: center;
color: #d4af37;
min-height: 1.4em;
margin: 0 auto 1rem;
user-select: none;
}
101 changes: 101 additions & 0 deletions games/arrow/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Middle Arrow | RMKR Toolkit</title>
<meta name="description" content="Five arrows appear. Tap the way the middle one points. Best streak saved locally.">
<link rel="icon" type="image/svg+xml" href="../../assets/favicon.svg">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../../assets/site.css">
<script src="../../assets/site.js" defer></script>
</head>
<body data-root="../../" data-tool="arrow">
<main class="wrap page-main" id="main">
<a class="game-back" href="../">← Focus Games</a>
<h1 class="page-title">Middle Arrow</h1>
<p class="page-lead">Five arrows appear in a row. Ignore the outer ones and tap the way the <strong>middle</strong> arrow points. Answer within the time limit to keep your streak.</p>

<div class="game-hud">
<div class="game-hud-stats">
<span>Streak: <strong id="streak">0</strong></span>
<span>Best: <strong id="best">—</strong></span>
</div>
<div class="game-hud-actions">
<button type="button" class="btn btn-gold" id="startBtn">Start</button>
</div>
</div>
<p class="game-note" id="note" role="status">Press Start, then tap ← or → for the middle arrow. Arrow keys work too.</p>
<div class="game-board-wrap">
<div class="even-stage" id="stage" aria-live="polite" aria-label="Middle Arrow board">
<div class="arrow-row" id="field" hidden aria-label="Arrows"></div>
<div class="even-actions" id="actions" hidden></div>
</div>
</div>
</main>
<script>
(function () {
var KEY = "rmkr-game-arrow-best";
var streak = 0, playing = false, busy = false, dir = 0, timer = null;
var field = document.getElementById("field");
var actions = document.getElementById("actions");
var startBtn = document.getElementById("startBtn");
function loadBest() { try { var v = parseInt(localStorage.getItem(KEY) || "", 10); return v > 0 ? v : null; } catch (e) { return null; } }
function saveBest(n) { var c = loadBest(); if (c == null || n > c) { try { localStorage.setItem(KEY, String(n)); } catch (e) {} return n; } return c; }
function setNote(m, k) { var el = document.getElementById("note"); el.textContent = m; el.className = "game-note" + (k ? " " + k : ""); }
function render() { document.getElementById("streak").textContent = String(streak); var b = loadBest(); document.getElementById("best").textContent = b == null ? "—" : String(b); }
function limitMs() { return Math.max(900, 2500 - streak * 80); }
function sym(d) { return d < 0 ? "←" : "→"; }
function round() {
dir = Math.random() < 0.5 ? -1 : 1;
var flank = Math.random() < 0.5 ? dir : -dir;
var s = "";
for (var i = 0; i < 5; i++) s += sym(i === 2 ? dir : flank);
field.textContent = s;
field.setAttribute("aria-label", "Middle arrow points " + (dir < 0 ? "left" : "right"));
setNote("Which way does the middle arrow point?");
busy = false;
clearTimeout(timer);
timer = setTimeout(function () { if (playing && !busy) end("Too slow"); }, limitMs());
}
function end(why) {
clearTimeout(timer);
var ended = streak; streak = 0; playing = false; busy = false; render();
setNote(why + " — the middle arrow pointed " + (dir < 0 ? "left" : "right") + (ended > 0 ? ". Streak reset from " + ended + "." : ". Press Play again."), "err");
startBtn.textContent = "Play again";
}
function guess(d) {
if (!playing || busy) return;
busy = true; clearTimeout(timer);
if (d === dir) {
streak += 1; var best = saveBest(streak); render();
setNote("Correct. Streak " + streak + (best === streak ? " — new best!" : "."), "ok");
field.textContent = "";
setTimeout(function () { if (playing) round(); }, 350);
return;
}
end("Not quite");
}
[[-1, "← Left"], [1, "Right →"]].forEach(function (p) {
var b = document.createElement("button");
b.type = "button"; b.className = "btn even-btn"; b.textContent = p[1];
b.setAttribute("aria-label", p[0] < 0 ? "Left" : "Right");
b.addEventListener("click", function () { guess(p[0]); });
actions.appendChild(b);
});
document.addEventListener("keydown", function (e) {
if (e.key === "ArrowLeft") { e.preventDefault(); guess(-1); }
else if (e.key === "ArrowRight") { e.preventDefault(); guess(1); }
});
startBtn.addEventListener("click", function () {
playing = true; streak = 0; render();
field.hidden = false; actions.hidden = false;
startBtn.textContent = "Restart";
round();
});
render();
})();
</script>
</body>
</html>
6 changes: 5 additions & 1 deletion games/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Focus Games | RMKR Toolkit</title>
<meta name="description" content="Simple browser focus games — memory, sequence, number slide, word scramble, reaction tap, tap order, color clash, odd one out, higher or lower, quick math, find-the-number, pop light, sum pair, missing number, even or odd, count the dots, and a casual quiz. No accounts, works offline after load.">
<meta name="description" content="Simple browser focus games — memory, sequence, number slide, word scramble, reaction tap, tap order, color clash, odd one out, higher or lower, quick math, find-the-number, pop light, sum pair, missing number, even or odd, count the dots, middle arrow, and a casual quiz. No accounts, works offline after load.">
<link rel="icon" type="image/svg+xml" href="../assets/favicon.svg">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap" rel="stylesheet">
Expand Down Expand Up @@ -81,6 +81,10 @@ <h3>Even or Odd</h3>
<h3>Count the Dots</h3>
<p>A few dots flash briefly. Tap how many you saw. Gets a little faster as your streak grows.</p>
</a>
<a class="tool-card ai-card-accent" href="arrow/">
<h3>Middle Arrow</h3>
<p>Five arrows in a row. Tap the way the middle one points and ignore the rest. Quick focus training.</p>
</a>
<a class="tool-card ai-card-accent" href="quiz/">
<h3>Casual Quiz</h3>
<p>Multiple-choice on India, Tamil Nadu, science, tech, and more. Switch topic or level anytime.</p>
Expand Down
Loading