Files
thebet365/apps/player/src/main.ts
Mars fa06fee64c fix(player+admin): 移动端 PWA 安全区、防缩放与局域网调试
玩家端适配主屏幕 safe-area、底部导航滚动隐藏与全屏布局;双端禁止页面缩放并开放 Vite host 供手机联调。
2026-06-22 17:58:51 +08:00

45 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import { createI18n } from 'vue-i18n';
import App from './App.vue';
import router from './router/index.ts';
import './styles.css';
import {
loadLocaleMessages,
markLocaleLoaded,
readStoredLocale,
type PlayerLocale,
} from './i18n/index.ts';
/** iOS Safari阻止双指捏合缩放配合 viewport 保持页面比例稳定 */
if (typeof window !== 'undefined') {
document.addEventListener('gesturestart', (event) => event.preventDefault());
}
async function bootstrap() {
const initialLocale = readStoredLocale();
const initialMessages = await loadLocaleMessages(initialLocale);
const i18n = createI18n({
legacy: false,
locale: initialLocale,
fallbackLocale: ['en-US', 'zh-CN'],
messages: {
[initialLocale]: initialMessages as Record<string, string>,
},
});
markLocaleLoaded(initialLocale);
createApp(App).use(createPinia()).use(router).use(i18n).mount('#app');
const loader = document.getElementById('app-loading');
if (loader) {
loader.style.opacity = '0';
loader.style.transition = 'opacity 0.3s ease';
setTimeout(() => loader.remove(), 350);
}
}
bootstrap();