A static mini-game for event booths: answer 5 VCT history questions with a 10s timer per question. Faster answers earn more points. Scores are saved locally in your browser (no external services).
- 5-question quiz: 1 easy → 3 medium → 1 hard
- 10s timer per question; time-left scoring
- 30-question JSON bank
- Local leaderboard (browser localStorage only), top 50
- Deterministic tie-breaking via insertion order (newer wins)
- Cross-tab auto-refresh of leaderboard (BroadcastChannel + storage event)
- Duplicate-save protection per attempt; Save button disables after success
- Choices shuffled per question without breaking correctness; 1–4 shortcuts
- Accessible UI and responsive layout
- index.html — single-page app shell
- styles/main.css — visual styles
- js/app.js — wiring views & events
- js/quiz.js — selection, timer, scoring
- js/ui.js — DOM helpers
- js/validators.js — username & score validation
- js/storage.js — leaderboard API (localStorage)
- data/questions.json — 30 questions (easy/medium/hard)
Open directly or use a simple local server.
Double-click index.html or run:
Start-Process "$PWD\index.html"If you have Python:
python -m http.server 5500- Storage key:
vct-quiz-scores(array of{ username, score, created_at, seq, attemptId }) - Sequence key:
vct-quiz-scores-seq(monotonic counter for tie-breaking) - Fetch returns the top 50 sorted by score desc, then
seqdesc - Cross-tab updates: posts to
BroadcastChannel("vct-quiz-events")and touches avct-quiz-pingkey as a fallback - Device-local only: clearing site data removes all saved scores
- Base per difficulty: easy 100, medium 200, hard 400
- Score per question:
base × (timeLeft / 10)(rounded) - Timeouts yield 0 points
- Total score is sum of 5 questions
- When a score is saved or cleared, other open tabs listening on the leaderboard view refresh automatically.
- Uses
BroadcastChannelwhere supported; falls back to thestorageevent.
- Static hosting friendly. GitHub Pages recommended.
- Ensure Pages is enabled for the repository (source:
mainbranch).
- Content based on widely known VCT results up to 2024.
- Questions will be adjusted over time to reflect new events.
- Event: Cloud9 × JetBrains — Booth Mini-Game
- Built by: @sunrayyourdev