2021-12-30 22:40:57 +00:00
|
|
|
// Uncomment when debugging and using Preact's DevTools WebExtension.
|
|
|
|
// import 'preact/debug';
|
|
|
|
|
2022-01-01 14:27:01 +00:00
|
|
|
import '@fontsource/inter/latin.css';
|
|
|
|
|
2021-12-30 22:40:57 +00:00
|
|
|
import {html, render} from 'htm/preact';
|
|
|
|
import {Router} from 'preact-router';
|
|
|
|
|
|
|
|
import HomePage from './pages/home.js';
|
|
|
|
import NotFoundPage from './pages/not-found.js';
|
|
|
|
import ReleasePage from './pages/release.js';
|
2022-01-15 19:31:51 +00:00
|
|
|
import SettingsPage from './pages/settings.js';
|
2022-01-14 19:17:52 +00:00
|
|
|
import {getThemeByCssClass, themeContext} from './utilities/themes.js';
|
2022-01-13 19:44:37 +00:00
|
|
|
|
2022-01-14 19:17:52 +00:00
|
|
|
const activeTheme = getThemeByCssClass(
|
|
|
|
window.localStorage.getItem('theme') ?? '',
|
|
|
|
);
|
2022-01-13 19:44:37 +00:00
|
|
|
|
|
|
|
document.body.classList.value = activeTheme.cssClass;
|
2021-12-30 22:40:57 +00:00
|
|
|
|
|
|
|
render(
|
|
|
|
html`
|
2022-01-13 19:44:37 +00:00
|
|
|
<${themeContext.Provider} value=${activeTheme}>
|
|
|
|
<${Router}>
|
|
|
|
<${HomePage} path="/" />
|
2022-01-15 19:31:51 +00:00
|
|
|
<${SettingsPage} path="/settings" />
|
2022-01-13 19:44:37 +00:00
|
|
|
<${ReleasePage} path="/release/:mbid" />
|
|
|
|
<${NotFoundPage} default />
|
|
|
|
<//>
|
2021-12-30 22:40:57 +00:00
|
|
|
<//>
|
|
|
|
`,
|
|
|
|
document.body,
|
|
|
|
);
|