Sum Pair
+A target sum appears above six different numbers. Exactly one pair adds up to it. Tap those two tiles. A hit grows your streak; a miss resets it.
+ +Press Start, then tap the pair that adds up.
+—
+ +diff --git a/README.md b/README.md index fff02f3..6c72ed8 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ The home page lists one **Games Hub** card (`games/`). Individual games live on - **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 - **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 - **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 diff --git a/assets/site.css b/assets/site.css index 229cec2..9fb7e26 100644 --- a/assets/site.css +++ b/assets/site.css @@ -1311,6 +1311,78 @@ body[data-tool="collab"] .site-footer { display: none; } transform: none; } +/* Sum Pair */ +.sum-stage { + display: flex; + flex-direction: column; + align-items: center; + gap: 1.1rem; + width: min(100%, 420px); + margin: 0 auto; +} +.sum-target { + margin: 0; + font-size: clamp(2.4rem, 10vw, 3.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; +} +.sum-target.ok { color: #4ade80; } +.sum-target.err { color: #f87171; } +.sum-grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.75rem; + width: 100%; +} +.sum-cell { + min-height: 88px; + min-width: 0; + padding: 0.65rem 0.35rem; + border-radius: 16px; + border: 1px solid var(--color-line); + background: linear-gradient(145deg, #1c2844, #121a2c); + color: var(--color-text); + font-family: inherit; + font-size: 1.65rem; + 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, box-shadow 0.12s ease; +} +.sum-cell:hover:not(:disabled) { + border-color: rgba(255, 195, 0, 0.55); + color: var(--color-accent); +} +.sum-cell:active:not(:disabled) { + transform: scale(0.97); +} +.sum-cell:disabled { cursor: default; } +.sum-cell.is-selected { + border-color: #ffc300; + color: var(--color-accent, #ffc300); + box-shadow: 0 0 0 3px rgba(255, 195, 0, 0.35); + background: linear-gradient(145deg, #2a2410, #1c2844); +} +.sum-cell.is-correct { + border-color: rgba(74, 222, 128, 0.7); + background: rgba(74, 222, 128, 0.14); + color: #4ade80; + box-shadow: none; +} +.sum-cell.is-miss { + border-color: rgba(248, 113, 113, 0.7); + background: rgba(248, 113, 113, 0.12); + color: #f87171; + box-shadow: none; +} + @media (max-width: 420px) { .memory-grid, @@ -1386,4 +1458,11 @@ body[data-tool="collab"] .site-footer { display: none; } .pop-grid { gap: 0.55rem; } .pop-cell { min-height: 84px; border-radius: 14px; } + .sum-grid { gap: 0.55rem; } + .sum-cell { + min-height: 76px; + font-size: 1.4rem; + border-radius: 14px; + } + } diff --git a/games/index.html b/games/index.html index adc667d..bedd75e 100644 --- a/games/index.html +++ b/games/index.html @@ -4,7 +4,7 @@
One cell lights gold on a 3×3 grid. Tap it before it fades. Best streak stays local.
+ +A target sum and six numbers. Tap the one pair that adds up. Best streak stays local.
+Multiple-choice on India, Tamil Nadu, science, tech, and more. Switch topic or level anytime.
diff --git a/games/sum/index.html b/games/sum/index.html new file mode 100644 index 0000000..c071875 --- /dev/null +++ b/games/sum/index.html @@ -0,0 +1,263 @@ + + + + + +A target sum appears above six different numbers. Exactly one pair adds up to it. Tap those two tiles. A hit grows your streak; a miss resets it.
+ +Press Start, then tap the pair that adds up.
+—
+ +