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 @@ -84,6 +84,7 @@ The home page lists one **Games Hub** card (`games/`). Individual games live on
- **Odd One Out** (`games/odd/`) — four tiles, three match; tap the different shape or color; best streak
- **Higher or Lower** (`games/higher/`) — guess if the next number is higher or lower; best streak
- **Quick Math** (`games/math/`) — mental arithmetic; tap the right answer; best streak
- **Find Number** (`games/find/`) — spot the target number in a 4×4 grid; 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
70 changes: 70 additions & 0 deletions assets/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,70 @@ body[data-tool="collab"] .site-footer { display: none; }
padding: 0.85rem 1rem;
}

/* Find Number */
.find-stage {
display: flex;
flex-direction: column;
align-items: center;
gap: 1.1rem;
width: min(100%, 420px);
margin: 0 auto;
}
.find-target {
margin: 0;
font-size: clamp(2.8rem, 12vw, 4rem);
font-weight: 900;
line-height: 1;
letter-spacing: -0.03em;
color: var(--color-gold, #ffc300);
min-height: 1.1em;
text-align: center;
font-variant-numeric: tabular-nums;
}
.find-target.ok { color: #4ade80; }
.find-target.err { color: #f87171; }
.find-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 0.55rem;
width: 100%;
}
.find-cell {
min-height: 68px;
min-width: 0;
padding: 0.55rem 0.3rem;
border-radius: 14px;
border: 1px solid var(--color-line);
background: var(--color-card);
color: var(--color-text);
font-family: inherit;
font-size: 1.2rem;
font-weight: 800;
font-variant-numeric: tabular-nums;
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease, color 0.12s ease;
}
.find-cell:hover:not(:disabled) {
border-color: rgba(255, 195, 0, 0.55);
color: var(--color-accent);
}
.find-cell:active:not(:disabled) {
transform: scale(0.97);
}
.find-cell:disabled { cursor: default; }
.find-cell.is-correct {
border-color: rgba(74, 222, 128, 0.7);
background: rgba(74, 222, 128, 0.14);
color: #4ade80;
}
.find-cell.is-miss {
border-color: rgba(248, 113, 113, 0.7);
background: rgba(248, 113, 113, 0.12);
color: #f87171;
}


@media (max-width: 420px) {
.memory-grid,
Expand Down Expand Up @@ -1261,4 +1325,10 @@ body[data-tool="collab"] .site-footer { display: none; }
font-size: 1rem;
}

.find-cell {
min-height: 56px;
font-size: 1.05rem;
padding: 0.45rem 0.2rem;
}

}
190 changes: 190 additions & 0 deletions games/find/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Find Number | RMKR Toolkit</title>
<meta name="description" content="Find the target number in a 4×4 grid. 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="find">
<main class="wrap page-main" id="main">
<a class="game-back" href="../">← Focus Games</a>
<h1 class="page-title">Find Number</h1>
<p class="page-lead">A target from 1–99 is shown. Sixteen different numbers fill a 4×4 grid, and exactly one matches. Tap the <strong>matching</strong> cell. 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 matching number.</p>
<div class="game-board-wrap">
<div class="find-stage" id="stage" aria-live="polite" aria-label="Find Number board">
<p class="find-target" id="target" hidden>—</p>
<div class="find-grid" id="grid" hidden aria-label="Number grid"></div>
</div>
</div>
</main>
<script>
(function () {
var KEY = "rmkr-game-find-best";
var streak = 0;
var busy = false;
var playing = false;
var roundId = 0;
var target = null;
var targetEl = document.getElementById("target");
var gridEl = document.getElementById("grid");
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 goal = randInt(1, 99);
var used = {};
used[goal] = true;
var cells = [goal];
while (cells.length < 16) {
var n = randInt(1, 99);
if (used[n]) continue;
used[n] = true;
cells.push(n);
}
return { target: goal, cells: shuffle(cells) };
}
function setCellsEnabled(on) {
var buttons = gridEl.querySelectorAll("button");
for (var i = 0; i < buttons.length; i++) buttons[i].disabled = !on;
}
function showBoard() {
targetEl.hidden = false;
gridEl.hidden = false;
}
function renderRound(round) {
target = round.target;
targetEl.textContent = String(round.target);
targetEl.classList.remove("ok", "err");
gridEl.innerHTML = "";
round.cells.forEach(function (n) {
var btn = document.createElement("button");
btn.type = "button";
btn.className = "find-cell";
btn.textContent = String(n);
btn.setAttribute("aria-label", "Number " + n);
btn.addEventListener("click", function () { onPick(n, btn); });
gridEl.appendChild(btn);
});
}
function onPick(picked, btn) {
if (!playing || busy || target == null) return;
busy = true;
setCellsEnabled(false);
var id = roundId;
var correct = picked === target;
if (correct) {
streak += 1;
renderStreak();
var best = saveBest(streak);
renderBest();
targetEl.classList.add("ok");
btn.classList.add("is-correct");
setNote(
"Correct — " + picked + ". Streak " + streak +
(best === streak ? " — new best!" : "."),
"ok"
);
setTimeout(function () {
if (!playing || id !== roundId) return;
var next = makeRound();
renderRound(next);
setNote("Tap " + next.target + ".");
busy = false;
}, 450);
return;
}
targetEl.classList.add("err");
btn.classList.add("is-miss");
var buttons = gridEl.querySelectorAll("button");
for (var i = 0; i < buttons.length; i++) {
if (Number(buttons[i].textContent) === target) {
buttons[i].classList.add("is-correct");
}
}
var ended = streak;
streak = 0;
renderStreak();
setNote(
"Wrong — " + target + " was the match" +
(ended > 0 ? ". Streak reset from " + ended + "." : ". Press Start."),
"err"
);
startBtn.textContent = "Play again";
playing = false;
busy = false;
}
function startGame() {
roundId += 1;
playing = true;
busy = false;
streak = 0;
renderStreak();
renderBest();
startBtn.textContent = "Restart";
showBoard();
var round = makeRound();
renderRound(round);
setNote("Tap " + round.target + ".");
}
startBtn.addEventListener("click", startGame);
renderBest();
renderStreak();
})();
</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, 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, 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 @@ -57,6 +57,10 @@ <h3>Higher or Lower</h3>
<h3>Quick Math</h3>
<p>Add or subtract small numbers. Tap the right answer from four choices. Best streak stays local.</p>
</a>
<a class="tool-card ai-card-accent" href="find/">
<h3>Find Number</h3>
<p>A target from 1–99. Tap the matching cell in a 4×4 grid. 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
Loading