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 @@ -91,6 +91,7 @@ The home page lists one **Games Hub** card (`games/`). Individual games live on
- **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
- **Same as Last** (`games/same/`) — shapes appear one at a time; tap Same or Different versus the previous shape; 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
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, middle arrow, 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, same as last, 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 @@ -85,6 +85,10 @@ <h3>Count the Dots</h3>
<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="same/">
<h3>Same as Last</h3>
<p>Shapes appear one by one. Tap Same if it matches the previous shape. A gentle working-memory warm-up.</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
88 changes: 88 additions & 0 deletions games/same/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Same as Last | RMKR Toolkit</title>
<meta name="description" content="Shapes appear one at a time. Tap Same if it matches the one before. 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="same">
<main class="wrap page-main" id="main">
<a class="game-back" href="../">← Focus Games</a>
<h1 class="page-title">Same as Last</h1>
<p class="page-lead">Shapes appear one at a time. Remember each one, then tap <strong>Same</strong> if the new shape matches the one just before it, or <strong>Different</strong> if it doesn't.</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. Keyboard: S or ← for Same, D or → for Different.</p>
<div class="game-board-wrap">
<div class="even-stage" id="stage" aria-live="polite" aria-label="Same as Last board">
<div class="arrow-row" id="field" hidden aria-label="Shape"></div>
<div class="even-actions" id="actions" hidden></div>
</div>
</div>
</main>
<script>
(function () {
var KEY = "rmkr-game-same-best";
var SHAPES = [["●", "circle"], ["■", "square"], ["▲", "triangle"], ["◆", "diamond"], ["★", "star"]];
var streak = 0, playing = false, busy = true, prev = -1, cur = -1;
var field = document.getElementById("field"), actions = document.getElementById("actions"), 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 show(i) { field.textContent = SHAPES[i][0]; field.setAttribute("aria-label", "Shape: " + SHAPES[i][1]); }
function next() {
prev = cur;
cur = Math.random() < 0.4 ? prev : (prev + 1 + Math.floor(Math.random() * (SHAPES.length - 1))) % SHAPES.length;
field.textContent = "";
setTimeout(function () { if (!playing) return; show(cur); busy = false; setNote("Same as the last shape, or different?"); }, 250);
}
function guess(same) {
if (!playing || busy) return;
busy = true;
if (same === (cur === prev)) {
streak += 1; var best = saveBest(streak); render();
setNote("Correct. Streak " + streak + (best === streak ? " — new best!" : "."), "ok");
setTimeout(next, 300);
return;
}
var ended = streak; streak = 0; playing = false; render();
setNote("Not quite — the last shape was a " + SHAPES[prev][1] + (ended > 0 ? ". Streak reset from " + ended + "." : ". Press Play again."), "err");
startBtn.textContent = "Play again";
}
[[true, "Same"], [false, "Different"]].forEach(function (p) {
var b = document.createElement("button");
b.type = "button"; b.className = "btn even-btn"; b.textContent = p[1];
b.addEventListener("click", function () { guess(p[0]); });
actions.appendChild(b);
});
document.addEventListener("keydown", function (e) {
var k = e.key.toLowerCase();
if (k === "s" || e.key === "ArrowLeft") { e.preventDefault(); guess(true); }
else if (k === "d" || e.key === "ArrowRight") { e.preventDefault(); guess(false); }
});
startBtn.addEventListener("click", function () {
playing = true; busy = true; streak = 0; render();
field.hidden = false; actions.hidden = false; startBtn.textContent = "Restart";
cur = Math.floor(Math.random() * SHAPES.length); show(cur);
setNote("Remember this shape…");
setTimeout(function () { if (playing) next(); }, 1200);
});
render();
})();
</script>
</body>
</html>
Loading