initial commit
This commit is contained in:
25
js/app.js
Normal file
25
js/app.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import { i18n } from './i18n.js';
|
||||
|
||||
async function initApp() {
|
||||
const savedTheme = localStorage.getItem('theme');
|
||||
if (savedTheme) {
|
||||
document.documentElement.dataset.theme = savedTheme;
|
||||
}
|
||||
|
||||
await i18n.init();
|
||||
|
||||
await import('./components/app-shell.js');
|
||||
|
||||
document.getElementById('app').innerHTML = '<app-shell></app-shell>';
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
try {
|
||||
const registration = await navigator.serviceWorker.register('/service-worker.js');
|
||||
console.log('SW registered:', registration.scope);
|
||||
} catch (error) {
|
||||
console.log('SW registration failed:', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initApp();
|
||||
Reference in New Issue
Block a user