Akki-jaiswal / Akki-jaiswal/pong-game

theme selection does not change UI; duplicate theme systems in code

Aperta
#207 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
22
Fork
116
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.