Initialer Laravel Commit für BetiX
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

This commit is contained in:
2026-04-04 18:01:50 +02:00
commit 0280278978
374 changed files with 65210 additions and 0 deletions

49
resources/js/app.ts Normal file
View File

@@ -0,0 +1,49 @@
import { createInertiaApp } from '@inertiajs/vue3';
import axios from 'axios';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import type { DefineComponent } from 'vue';
import { createApp, h } from 'vue';
import '../css/app.css';
import { initializeTheme } from './composables/useAppearance';
import { initializePrimaryColor } from './composables/usePrimaryColor';
import { i18n, initI18n } from './i18n';
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
// Configure Axios to include CSRF token
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
const token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
axios.defaults.headers.common['X-CSRF-TOKEN'] = (token as HTMLMetaElement).content;
}
createInertiaApp({
title: (title) => (title ? `${title} - ${appName}` : appName),
resolve: (name) =>
resolvePageComponent(
`./pages/${name}.vue`,
import.meta.glob<DefineComponent>('./pages/**/*.vue', { eager: false }),
),
setup({ el, App, props, plugin }) {
const initialLocale = ((props as any).initialPage?.props?.locale) || 'en';
const app = createApp({ render: () => h(App, props) });
// Initialize i18n with the server-provided locale, then mount
initI18n(initialLocale).finally(() => {
app.use(plugin).use(i18n).mount(el);
});
},
progress: {
color: '#df006a',
},
});
// This will set light / dark mode on page load...
initializeTheme();
// Apply saved primary color (main accent) on page load...
initializePrimaryColor();
// Initialize casino data-theme before first paint to avoid flash
try {
const t = localStorage.getItem('casino-theme');
document.documentElement.setAttribute('data-theme', t === 'light' ? 'light' : 'dark');
} catch {}