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 @@ -87,6 +87,7 @@ The home page lists one **Games Hub** card (`games/`). Individual games live on
- **Find Number** (`games/find/`) — spot the target number in a 4×4 grid; best streak
- **Pop Light** (`games/pop/`) — tap the gold cell on a 3×3 grid before it fades; best streak
- **Sum Pair** (`games/sum/`) — tap the one pair of numbers that adds to the target; best streak
- **Missing Number** (`games/missing/`) — fill the blank in a short +1/+2/+3 sequence; 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
71 changes: 71 additions & 0 deletions assets/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,66 @@ body[data-tool="collab"] .site-footer { display: none; }
color: #f87171;
}


/* Missing Number */
.missing-stage {
display: flex;
flex-direction: column;
align-items: center;
gap: 1.1rem;
width: min(100%, 360px);
margin: 0 auto;
}
.missing-seq {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 0.55rem;
width: 100%;
}
.missing-seq.ok .missing-slot.is-blank { color: #4ade80; border-color: rgba(74, 222, 128, 0.7); }
.missing-seq.err .missing-slot.is-blank { color: #f87171; border-color: rgba(248, 113, 113, 0.7); }
.missing-slot {
display: flex;
align-items: center;
justify-content: center;
min-height: 72px;
border-radius: 14px;
border: 1px solid rgba(255, 195, 0, 0.28);
background: rgba(255, 195, 0, 0.06);
font-size: clamp(1.6rem, 7vw, 2.2rem);
font-weight: 900;
color: var(--color-gold, #ffc300);
letter-spacing: -0.02em;
}
.missing-slot.is-blank {
border-style: dashed;
background: rgba(255, 255, 255, 0.04);
color: rgba(255, 255, 255, 0.55);
}
.missing-choices {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.7rem;
width: 100%;
}
.missing-choice {
min-height: 64px;
font-size: 1.25rem;
font-weight: 800;
padding: 0.9rem 1rem;
border-radius: 14px;
}
.missing-choice.is-correct {
border-color: rgba(74, 222, 128, 0.7);
background: rgba(74, 222, 128, 0.14);
color: #4ade80;
}
.missing-choice.is-miss {
border-color: rgba(248, 113, 113, 0.7);
background: rgba(248, 113, 113, 0.12);
color: #f87171;
}

/* Higher or Lower */
.higher-stage {
display: flex;
Expand Down Expand Up @@ -1444,6 +1504,17 @@ body[data-tool="collab"] .site-footer { display: none; }
padding: 0.8rem 0.85rem;
}

.missing-slot {
min-height: 60px;
font-size: 1.35rem;
border-radius: 12px;
}
.missing-choice {
min-height: 60px;
font-size: 1.15rem;
padding: 0.8rem 0.85rem;
}

.higher-btn {
min-height: 56px;
font-size: 1rem;
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, 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, 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 @@ -69,6 +69,10 @@ <h3>Pop Light</h3>
<h3>Sum Pair</h3>
<p>A target sum and six numbers. Tap the one pair that adds up. Best streak stays local.</p>
</a>
<a class="tool-card ai-card-accent" href="missing/">
<h3>Missing Number</h3>
<p>A short sequence with one blank. Tap the missing number from four choices. Best streak stays local.</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
222 changes: 222 additions & 0 deletions games/missing/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Missing Number | RMKR Toolkit</title>
<meta name="description" content="Spot the blank in a short number sequence and tap the missing value. 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="missing">
<main class="wrap page-main" id="main">
<a class="game-back" href="../">← Focus Games</a>
<h1 class="page-title">Missing Number</h1>
<p class="page-lead">A short ascending sequence shows four slots with one blank. Tap the <strong>missing</strong> number from four choices. Keep a streak going.</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 the missing number.</p>
<div class="game-board-wrap">
<div class="missing-stage" id="stage" aria-live="polite" aria-label="Missing Number board">
<div class="missing-seq" id="seq" hidden aria-label="Number sequence"></div>
<div class="missing-choices" id="choices" hidden aria-label="Answer choices"></div>
</div>
</div>
</main>
<script>
(function () {
var KEY = "rmkr-game-missing-best";
var streak = 0;
var busy = false;
var playing = false;
var answer = null;
var seqEl = document.getElementById("seq");
var choicesEl = document.getElementById("choices");
var startBtn = document.getElementById("startBtn");

function loadBest() {
try {
var v = parseInt(localStorage.getItem(KEY) || "", 10);
return Number.isFinite(v) && v > 0 ? v : null;
} catch (e) { return null; }
}
function saveBest(n) {
var cur = loadBest();
if (cur == null || n > cur) {
try { localStorage.setItem(KEY, String(n)); } catch (e) {}
return n;
}
return cur;
}
function setNote(msg, kind) {
var el = document.getElementById("note");
el.textContent = msg || "";
el.className = "game-note" + (kind ? " " + kind : "");
}
function renderBest() {
var b = loadBest();
document.getElementById("best").textContent = b == null ? "—" : String(b);
}
function renderStreak() {
document.getElementById("streak").textContent = String(streak);
}
function randInt(min, max) {
return min + Math.floor(Math.random() * (max - min + 1));
}
function shuffle(arr) {
var a = arr.slice();
for (var i = a.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var t = a[i];
a[i] = a[j];
a[j] = t;
}
return a;
}
function makeRound() {
var step = [1, 2, 3][randInt(0, 2)];
var maxStart = Math.max(1, 30 - step * 3);
var start = randInt(1, maxStart);
var values = [start, start + step, start + step * 2, start + step * 3];
var blankAt = randInt(0, 3);
var ans = values[blankAt];
var wrongs = {};
var tries = 0;
while (Object.keys(wrongs).length < 3 && tries < 50) {
tries += 1;
var delta = randInt(1, 4);
var sign = Math.random() < 0.5 ? -1 : 1;
var w = ans + sign * delta;
if (w === ans || w < 1 || w > 30 || wrongs[w]) continue;
// Avoid accidentally matching another slot in the sequence
if (values.indexOf(w) !== -1 && w !== ans) continue;
wrongs[w] = true;
}
while (Object.keys(wrongs).length < 3) {
var fill = ans + Object.keys(wrongs).length + 1;
if (fill !== ans && fill >= 1 && fill <= 30 && !wrongs[fill] && values.indexOf(fill) === -1) {
wrongs[fill] = true;
} else {
var alt = ans - (Object.keys(wrongs).length + 1);
if (alt !== ans && alt >= 1 && !wrongs[alt] && values.indexOf(alt) === -1) wrongs[alt] = true;
else wrongs[ans + 5 + Object.keys(wrongs).length] = true;
}
}
var choices = shuffle([ans].concat(Object.keys(wrongs).map(Number)));
return { values: values, blankAt: blankAt, answer: ans, choices: choices };
}
function setChoicesEnabled(on) {
var buttons = choicesEl.querySelectorAll("button");
for (var i = 0; i < buttons.length; i++) buttons[i].disabled = !on;
}
function showBoard() {
seqEl.hidden = false;
choicesEl.hidden = false;
}
function renderRound(round) {
answer = round.answer;
seqEl.innerHTML = "";
seqEl.classList.remove("ok", "err");
for (var i = 0; i < round.values.length; i++) {
var slot = document.createElement("span");
slot.className = "missing-slot" + (i === round.blankAt ? " is-blank" : "");
if (i === round.blankAt) {
slot.textContent = "?";
slot.setAttribute("aria-label", "Missing number");
} else {
slot.textContent = String(round.values[i]);
slot.setAttribute("aria-label", "Number " + round.values[i]);
}
seqEl.appendChild(slot);
}
choicesEl.innerHTML = "";
round.choices.forEach(function (n) {
var btn = document.createElement("button");
btn.type = "button";
btn.className = "btn missing-choice";
btn.textContent = String(n);
btn.setAttribute("aria-label", "Answer " + n);
btn.addEventListener("click", function () { onPick(n, btn); });
choicesEl.appendChild(btn);
});
}
function onPick(picked, btn) {
if (!playing || busy || answer == null) return;
busy = true;
setChoicesEnabled(false);
var correct = picked === answer;
if (correct) {
streak += 1;
renderStreak();
var best = saveBest(streak);
renderBest();
seqEl.classList.add("ok");
btn.classList.add("is-correct");
var blank = seqEl.querySelector(".is-blank");
if (blank) blank.textContent = String(answer);
setNote(
"Correct — missing was " + answer +
". Streak " + streak + (best === streak ? " — new best!" : "."),
"ok"
);
setTimeout(function () {
if (!playing) return;
var next = makeRound();
renderRound(next);
setNote("Which number is missing?");
busy = false;
}, 500);
return;
}
seqEl.classList.add("err");
btn.classList.add("is-miss");
var buttons = choicesEl.querySelectorAll("button");
for (var i = 0; i < buttons.length; i++) {
if (Number(buttons[i].textContent) === answer) {
buttons[i].classList.add("is-correct");
}
}
var blankMiss = seqEl.querySelector(".is-blank");
if (blankMiss) blankMiss.textContent = String(answer);
var ended = streak;
streak = 0;
renderStreak();
setNote(
"Wrong — missing was " + answer +
(ended > 0 ? ". Streak reset from " + ended + "." : ". Press Start."),
"err"
);
startBtn.textContent = "Play again";
playing = false;
busy = false;
}
function startGame() {
playing = true;
busy = false;
streak = 0;
renderStreak();
renderBest();
startBtn.textContent = "Restart";
showBoard();
var round = makeRound();
renderRound(round);
setNote("Which number is missing?");
}
startBtn.addEventListener("click", startGame);
renderBest();
renderStreak();
})();
</script>
</body>
</html>
Loading