Akki-jaiswal / Akki-jaiswal/pong-game
theme selection does not change UI; duplicate theme systems in code
- 主要言語
- JavaScript
- スター
- 22
- フォーク
- 116
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Changing the Theme selector does not reliably update the UI. The codebase contains two different theme systems in the same module (class-based body classes and variables-only manager). They conflict and the main game page doesn’t consistently initialize a single theme manager.
Steps to Reproduce
Open the game.
Change the Theme dropdown to Neon Retro, Dark Mode, or Ocean Blue.
Expected Behavior
Body class/variables update and the canvas/control styles change immediately; choice persists across reloads.
Actual Behavior
Theme does not change or changes inconsistently.
Root Cause
theme.js defines two managers and two exports; both attempt to control theming.
The main page imports only the game script and may not initialize theming first
Proposed Fix
Choose one approach and remove the other (recommend keeping class-based manager that toggles body classes, aligned with themes.css).
Ensure index.html loads the theme script before the game script.
Keep localStorage persistence and sync selector value on load.
コントリビューションガイド
評価
この issue はまだ評価されていません。