Public Access
feat(pwa): make the app installable
Manifest, gamepad icon (also the new favicon, instead of the Vite logo), iOS meta tags and the tab title ToBePlayed. No service worker, so a deploy never meets an old cached bundle. The title bar color follows light and dark mode. The README also lists adding a game by name.
This commit is contained in:
1 parent
444b03acee
commit
f8e6c2c970
12 files changed
+117
-3
No files matched your search
@@ -11,6 +11,8 @@ import {
|
||||
} from '../utils/appearance.js';
|
||||
|
||||
const DARK_MODE_STORAGE_KEY = 'tbp_dark_mode';
|
||||
// The --background of style.css; the installed app paints its title bar in this color.
|
||||
const THEME_COLORS = {dark: '#09090b', light: '#fafafa'};
|
||||
|
||||
const PreferencesContext = createContext(null);
|
||||
|
||||
@@ -28,6 +30,8 @@ export function PreferencesProvider({children}) {
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
document.querySelector('meta[name="theme-color"]')
|
||||
?.setAttribute('content', isDarkMode ? THEME_COLORS.dark : THEME_COLORS.light);
|
||||
localStorage.setItem(DARK_MODE_STORAGE_KEY, String(isDarkMode));
|
||||
}, [isDarkMode]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user