game-programming-patterns
game-programming-patterns copied to clipboard
[WIP] Dark theme
Hi. This PR:
- adds a small button on top of every page. This small button is responsible for toggling between dark and light themes.
- persists the user's current choice in the local storage, so the latest selection is persistent across page refreshes and navigations.
- implements a (n almost) well-looking dark theme.
- fixes two minor bugs in script.js.
- reads changes from the user's preferences to enable dark or light themes based on the user's system preferences.
TODO:
- Improve the structure of the
asset/dark-styles.scssfile to use meaningful variables and better order of styles. - Maybe better icons for light and dark themes.
ONLINE DEMO
https://aghardeshir.github.io/game-programming-patterns/html/command.html
VIDEO DEMO
dark-theme-for-game-programming-patterns.webm
VIDEO DEMO FOR READING THEME FROM SYSTEM SETTINGS
@munificent? You explicitly mentioned you won't be actively maintaining this repository anymore. But I thought of mentioning you, as I believe this PR is a must-have and helps in reading the book easier.