Kids math practice (SL/EN) in a Vite React app, wrapped with Capacitor for Android (net.bit76.matematika). Includes session refactor, i18n, and text-free difficulty icons with translated overlays.
Zabavna Matematika
Kids math practice game in Slovene. Players pick +, −, ×, and/or ÷, then play a short session. Difficulty changes how they answer, not which operations are allowed.
| Difficulty | Label | How you answer |
|---|---|---|
| Easy | Lahko | 4 large choice buttons |
| Medium | Srednje | 6 choice buttons |
| Hard | Težko | On-screen keypad + OK |
One game codebase: web in the browser, Android as a Capacitor shell around the same build. There is no backend. Settings, audio, and language (sl / en) stay in localStorage. The UI follows a saved language, otherwise the device (sl* → Slovene, everything else → English). Switch it in Settings (gear).
Play (browser)
From the repo root:
cd web
npm install
npm run dev
Or from the root: npm run dev (forwards into web/).
Open the URL Vite prints (usually http://localhost:5173).
- Wait for Nadaljuj after assets load.
- Tap which operations to practice and a difficulty.
- IGRAJ → confirm question count / ranges → play.
npm run build writes a static site to web/dist/.
npm run preview serves that build.
The app uses relative asset paths (base: './'), so dist/ can go in a subfolder on any static host.
Android
Same game, wrapped for phones and tablets. Details: docs/ANDROID.md.
cd web
npm install
npm run android
That builds the web app, syncs it into web/android/, and opens Android Studio. You need Android Studio + an SDK / emulator (or a device).
Project layout
ZabavnaMatematika/
README.md
LEVELS.md
docs/
package.json root shortcuts (dev, build, test, android)
web/ Vite + React game (the product)
src/
public/
capacitor.config.json
android/ Capacitor Android project (after first sync)
Docs
- LEVELS.md — what each difficulty does
- docs/DEVELOPMENT.md — architecture, session loop, tests
- docs/ANDROID.md — Play Store / Capacitor workflow
- web/public/privacy.html — privacy policy (Slovene)
Tests
npm test # from repo root, or: cd web && npm test
npm run smoke # needs Playwright; start preview first
npm run preview -- --host 127.0.0.1 --port 4175
# other terminal
set SMOKE_URL=http://127.0.0.1:4175/
npm run smoke
Playwright is not a project dependency. Install it locally if you want the smoke script (npm install --no-save playwright inside web/).