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 @@ -81,6 +81,7 @@ The home page lists one **Games Hub** card (`games/`). Individual games live on
- **Reaction Tap** (`games/reaction/`) — wait for gold, tap fast; best average ms
- **Tap Order** (`games/order/`) — tap 1–9 in order on a 3×3 grid; best time
- **Color Clash** (`games/colors/`) — Stroop-style: tap the ink color, not the word; best streak
- **Odd One Out** (`games/odd/`) — four tiles, three match; tap the different shape or color; 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
77 changes: 77 additions & 0 deletions assets/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,66 @@ body[data-tool="collab"] .site-footer { display: none; }
color: var(--color-error);
}


/* Odd One Out */
.odd-grid {
display: grid;
grid-template-columns: repeat(2, minmax(120px, 1fr));
gap: 0.75rem;
width: min(100%, 360px);
margin: 0 auto;
}
.odd-tile {
display: flex;
align-items: center;
justify-content: center;
min-height: 96px;
min-width: 0;
padding: 0.85rem;
border-radius: 16px;
border: 1px solid var(--color-line);
background: var(--color-card);
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}
.odd-tile:hover:not(:disabled) {
border-color: rgba(255, 195, 0, 0.55);
}
.odd-tile:active:not(:disabled) {
transform: scale(0.98);
}
.odd-tile:disabled { cursor: default; }
.odd-shape {
display: block;
width: 52px;
height: 52px;
flex: 0 0 auto;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}
.odd-shape--circle {
border-radius: 50%;
}
.odd-shape--square {
border-radius: 10px;
}
.odd-shape--triangle {
width: 54px;
height: 48px;
border-radius: 0;
clip-path: polygon(50% 6%, 4% 94%, 96% 94%);
box-shadow: none;
}
.odd-tile.is-correct {
border-color: rgba(74, 222, 128, 0.55);
background: rgba(74, 222, 128, 0.12);
}
.odd-tile.is-miss {
border-color: rgba(248, 113, 113, 0.7);
background: rgba(248, 113, 113, 0.12);
}

@media (max-width: 420px) {
.memory-grid,
.slide-grid {
Expand Down Expand Up @@ -1089,5 +1149,22 @@ body[data-tool="collab"] .site-footer { display: none; }
padding: 0.75rem 0.85rem;
font-size: 0.98rem;
}
.odd-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
width: 100%;
gap: 0.65rem;
}
.odd-tile {
min-height: 84px;
padding: 0.7rem;
}
.odd-shape {
width: 46px;
height: 46px;
}
.odd-shape--triangle {
width: 48px;
height: 42px;
}

}
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, 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, 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 @@ -45,6 +45,10 @@ <h3>Tap Order</h3>
<h3>Color Clash</h3>
<p>A color word in the wrong ink. Tap the ink color, not the word. Best streak stays local.</p>
</a>
<a class="tool-card ai-card-accent" href="odd/">
<h3>Odd One Out</h3>
<p>Four tiles: three match, one differs in shape or color. Tap the odd one. 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
199 changes: 199 additions & 0 deletions games/odd/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Odd One Out | RMKR Toolkit</title>
<meta name="description" content="Four tiles appear. Three match; one is different. Tap the odd one. 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="odd">
<main class="wrap page-main" id="main">
<a class="game-back" href="../">← Focus Games</a>
<h1 class="page-title">Odd One Out</h1>
<p class="page-lead">Four tiles appear. Three match; one is different. Tap the <strong>odd one</strong>. 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 tile that does not match.</p>
<div class="game-board-wrap">
<div class="odd-grid" id="stage" aria-live="polite" aria-label="Odd one out tiles"></div>
</div>
</main>
<script>
(function () {
var KEY = "rmkr-game-odd-best";
var COLORS = [
{ id: "gold", name: "gold", hex: "#ffc300" },
{ id: "red", name: "red", hex: "#f87171" },
{ id: "blue", name: "blue", hex: "#60a5fa" },
{ id: "green", name: "green", hex: "#4ade80" },
{ id: "violet", name: "violet", hex: "#c084fc" }
];
var SHAPES = [
{ id: "circle", name: "circle" },
{ id: "square", name: "square" },
{ id: "triangle", name: "triangle" }
];
var streak = 0;
var busy = false;
var playing = false;
var oddIndex = -1;
var stageEl = document.getElementById("stage");
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 shuffle(arr) {
for (var i = arr.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var t = arr[i];
arr[i] = arr[j];
arr[j] = t;
}
return arr;
}
function pickOther(list, id) {
var pool = list.filter(function (item) { return item.id !== id; });
return pool[Math.floor(Math.random() * pool.length)];
}
function buildRound() {
var baseShape = SHAPES[Math.floor(Math.random() * SHAPES.length)];
var baseColor = COLORS[Math.floor(Math.random() * COLORS.length)];
var differBy = Math.random() < 0.5 ? "shape" : "color";
var oddShape = baseShape;
var oddColor = baseColor;
if (differBy === "shape") {
oddShape = pickOther(SHAPES, baseShape.id);
} else {
oddColor = pickOther(COLORS, baseColor.id);
}
var tiles = [
{ shape: baseShape, color: baseColor, odd: false },
{ shape: baseShape, color: baseColor, odd: false },
{ shape: baseShape, color: baseColor, odd: false },
{ shape: oddShape, color: oddColor, odd: true }
];
shuffle(tiles);
return tiles;
}
function clearBoard() {
stageEl.innerHTML = "";
}
function nextRound() {
busy = false;
var tiles = buildRound();
oddIndex = -1;
clearBoard();
tiles.forEach(function (tile, i) {
if (tile.odd) oddIndex = i;
var btn = document.createElement("button");
btn.type = "button";
btn.className = "odd-tile";
btn.setAttribute("data-index", String(i));
btn.setAttribute(
"aria-label",
tile.color.name + " " + tile.shape.name
);
var shape = document.createElement("span");
shape.className = "odd-shape odd-shape--" + tile.shape.id;
shape.style.backgroundColor = tile.color.hex;
shape.setAttribute("aria-hidden", "true");
btn.appendChild(shape);
btn.addEventListener("click", onPick);
stageEl.appendChild(btn);
});
setNote("Find the odd one out.");
}
function onPick(ev) {
if (!playing || busy) return;
var btn = ev.currentTarget;
var idx = parseInt(btn.getAttribute("data-index") || "-1", 10);
busy = true;
var buttons = stageEl.querySelectorAll(".odd-tile");
if (idx === oddIndex) {
btn.classList.add("is-correct");
streak += 1;
renderStreak();
var best = saveBest(streak);
renderBest();
setNote(
"Correct. Streak " + streak + (best === streak ? " — new best!" : "."),
"ok"
);
setTimeout(function () {
if (playing) nextRound();
}, 450);
return;
}
btn.classList.add("is-miss");
for (var i = 0; i < buttons.length; i++) {
if (parseInt(buttons[i].getAttribute("data-index") || "-1", 10) === oddIndex) {
buttons[i].classList.add("is-correct");
}
buttons[i].disabled = true;
}
var ended = streak;
streak = 0;
renderStreak();
setNote(
ended > 0
? "Miss — press Start. Streak reset from " + ended + "."
: "Miss — press Start.",
"err"
);
startBtn.textContent = "Play again";
playing = false;
busy = false;
}
function startGame() {
playing = true;
streak = 0;
renderStreak();
renderBest();
startBtn.textContent = "Restart";
nextRound();
}
startBtn.addEventListener("click", startGame);
renderBest();
renderStreak();
clearBoard();
})();
</script>
</body>
</html>
Loading