This commit is contained in:
ct
2025-07-15 05:11:25 +08:00
parent b7e5f42f7a
commit 8b29b6d6b3
12 changed files with 132 additions and 175 deletions

View File

@@ -24,7 +24,7 @@ public function index()
]; ];
}); });
return Inertia::render('home', [ return Inertia::render('home/home', [
'stats' => $stats, 'stats' => $stats,
]); ]);
} }

View File

@@ -1,7 +1,7 @@
import AuthUser from '@/modules/auth/auth-user';
import Footer from '@/pages/front/partials/Footer.jsx';
import { Head } from '@inertiajs/react';
import React from 'react'; import React from 'react';
import { Head } from '@inertiajs/react';
import AuthUser from '@/modules/auth/auth-user';
import Footer from '@/pages/home/partials/Footer.jsx';
interface PrivacyProps { interface PrivacyProps {
content: string; content: string;
@@ -14,9 +14,12 @@ const Privacy: React.FC<PrivacyProps> = ({ content, title }) => {
<Head title={title} /> <Head title={title} />
<div className="container mx-auto px-4 py-8"> <div className="container mx-auto px-4 py-8">
<div className="mx-auto max-w-4xl"> <div className="max-w-4xl mx-auto">
<div className="rounded-lg bg-white p-8 shadow-lg dark:bg-neutral-900"> <div className="bg-white dark:bg-neutral-900 rounded-lg shadow-lg p-8">
<div className="max-w-none" dangerouslySetInnerHTML={{ __html: content }} /> <div
className="max-w-none"
dangerouslySetInnerHTML={{ __html: content }}
/>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,7 +1,7 @@
import AuthUser from '@/modules/auth/auth-user';
import Footer from '@/pages/front/partials/Footer.jsx';
import { Head } from '@inertiajs/react';
import React from 'react'; import React from 'react';
import { Head } from '@inertiajs/react';
import AuthUser from '@/modules/auth/auth-user';
import Footer from '@/pages/home/partials/Footer.jsx';
interface TermsProps { interface TermsProps {
content: string; content: string;
@@ -14,9 +14,12 @@ const Terms: React.FC<TermsProps> = ({ content, title }) => {
<Head title={title} /> <Head title={title} />
<div className="container mx-auto px-4 py-8"> <div className="container mx-auto px-4 py-8">
<div className="mx-auto max-w-4xl"> <div className="max-w-4xl mx-auto">
<div className="rounded-lg bg-white p-8 shadow-lg dark:bg-neutral-900"> <div className="bg-white dark:bg-neutral-900 rounded-lg shadow-lg p-8">
<div className="max-w-none" dangerouslySetInnerHTML={{ __html: content }} /> <div
className="max-w-none"
dangerouslySetInnerHTML={{ __html: content }}
/>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,42 +0,0 @@
import AuthUser from '@/modules/auth/auth-user';
import FAQDiscord from '@/pages/front/partials/FAQDiscord.jsx';
import Features from '@/pages/front/partials/Features.jsx';
import Footer from '@/pages/front/partials/Footer.jsx';
import Hero from '@/pages/front/partials/Hero.jsx';
import { useEffect, useState } from 'react';
const Home = () => {
const [isClient, setIsClient] = useState(false);
const [Editor, setEditor] = useState(null);
useEffect(() => {
setIsClient(true);
// Dynamically import Editor only on client-side to avoid SSR issues with Konva
import('@/modules/editor/editor.jsx').then((module) => {
setEditor(() => module.default);
});
}, []);
return (
<div className="min-h-[100vh] bg-neutral-50 pb-10 dark:bg-black">
<div className="to-muted/10 w-full bg-gradient-to-b from-transparent dark:from-transparent dark:to-neutral-900">
{isClient && Editor ? (
<Editor />
) : (
<div className="flex h-96 items-center justify-center">
<div className="text-muted-foreground">Loading editor...</div>
</div>
)}
</div>
<div className="space-y-16">
<Hero />
<Features />
<FAQDiscord />
</div>
<Footer />
<AuthUser />
</div>
);
};
export default Home;

View File

@@ -0,0 +1,25 @@
import AuthUser from '@/modules/auth/auth-user';
import Editor from '@/modules/editor/editor.jsx';
import FAQDiscord from './partials/FAQDiscord.jsx';
import Features from './partials/Features.jsx';
import Footer from './partials/Footer.jsx';
import Hero from './partials/Hero.jsx';
const Home = () => {
return (
<div className="min-h-[100vh] bg-neutral-50 pb-10 dark:bg-black">
<div className="to-muted/10 w-full bg-gradient-to-b from-transparent dark:from-transparent dark:to-neutral-900">
<Editor />
</div>
<div className="space-y-16">
<Hero />
<Features />
<FAQDiscord />
</div>
<Footer />
<AuthUser />
</div>
);
};
export default Home;

View File

@@ -2,12 +2,7 @@ import { createInertiaApp } from '@inertiajs/react';
import createServer from '@inertiajs/react/server'; import createServer from '@inertiajs/react/server';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import ReactDOMServer from 'react-dom/server'; import ReactDOMServer from 'react-dom/server';
import { ErrorBoundary } from 'react-error-boundary';
import { Toaster } from 'sonner';
import { type RouteName, route } from 'ziggy-js'; import { type RouteName, route } from 'ziggy-js';
import { AxiosProvider } from './plugins/AxiosContext';
import { GA4Provider } from './plugins/GA4Context';
import { MittProvider } from './plugins/MittContext';
const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
@@ -29,34 +24,7 @@ createServer((page) =>
}); });
/* eslint-enable */ /* eslint-enable */
const app = ( return <App {...props} />;
<ErrorBoundary
FallbackComponent={DetailedErrorFallback}
onError={(error, errorInfo) => {
// Log to console for debugging
console.error('Error caught by boundary:', error, errorInfo);
// You could also send to an error reporting service here
// e.g., Sentry, LogRocket, etc.
}}
onReset={() => {
// Optional: Clear any error state in your app
console.log('Error boundary reset');
}}
>
<GA4Provider>
<MittProvider>
<AxiosProvider>
<Toaster position="top-right" />
{/* <AuthDialog /> */}
<App {...props} />
</AxiosProvider>
</MittProvider>
</GA4Provider>
</ErrorBoundary>
);
return app;
}, },
}), }),
); );

File diff suppressed because one or more lines are too long

View File

@@ -36,95 +36,95 @@ export default defineConfig({
optimizeDeps: { optimizeDeps: {
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util'] exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util']
}, },
// build: { build: {
// rollupOptions: { rollupOptions: {
// output: { output: {
// manualChunks: { manualChunks: {
// // React MUST be first and separate to avoid dependency issues // React MUST be first and separate to avoid dependency issues
// 'react-vendor': ['react', 'react-dom'], 'react-vendor': ['react', 'react-dom'],
// // Heavy libraries that can be safely separated // Heavy libraries that can be safely separated
// 'ffmpeg': ['@ffmpeg/ffmpeg', '@ffmpeg/util'], 'ffmpeg': ['@ffmpeg/ffmpeg', '@ffmpeg/util'],
// 'motion': ['motion'], 'motion': ['motion'],
// 'canvas': ['konva', 'react-konva', 'react-konva-utils'], 'canvas': ['konva', 'react-konva', 'react-konva-utils'],
// 'charts': ['recharts'], 'charts': ['recharts'],
// // UI libraries that depend on React // UI libraries that depend on React
// 'radix-ui': [ 'radix-ui': [
// '@radix-ui/react-accordion', '@radix-ui/react-accordion',
// '@radix-ui/react-alert-dialog', '@radix-ui/react-alert-dialog',
// '@radix-ui/react-aspect-ratio', '@radix-ui/react-aspect-ratio',
// '@radix-ui/react-avatar', '@radix-ui/react-avatar',
// '@radix-ui/react-checkbox', '@radix-ui/react-checkbox',
// '@radix-ui/react-collapsible', '@radix-ui/react-collapsible',
// '@radix-ui/react-context-menu', '@radix-ui/react-context-menu',
// '@radix-ui/react-dialog', '@radix-ui/react-dialog',
// '@radix-ui/react-dropdown-menu', '@radix-ui/react-dropdown-menu',
// '@radix-ui/react-hover-card', '@radix-ui/react-hover-card',
// '@radix-ui/react-label', '@radix-ui/react-label',
// '@radix-ui/react-menubar', '@radix-ui/react-menubar',
// '@radix-ui/react-navigation-menu', '@radix-ui/react-navigation-menu',
// '@radix-ui/react-popover', '@radix-ui/react-popover',
// '@radix-ui/react-progress', '@radix-ui/react-progress',
// '@radix-ui/react-radio-group', '@radix-ui/react-radio-group',
// '@radix-ui/react-scroll-area', '@radix-ui/react-scroll-area',
// '@radix-ui/react-select', '@radix-ui/react-select',
// '@radix-ui/react-separator', '@radix-ui/react-separator',
// '@radix-ui/react-slider', '@radix-ui/react-slider',
// '@radix-ui/react-slot', '@radix-ui/react-slot',
// '@radix-ui/react-switch', '@radix-ui/react-switch',
// '@radix-ui/react-tabs', '@radix-ui/react-tabs',
// '@radix-ui/react-toggle', '@radix-ui/react-toggle',
// '@radix-ui/react-toggle-group', '@radix-ui/react-toggle-group',
// '@radix-ui/react-tooltip' '@radix-ui/react-tooltip'
// ], ],
// // Form libraries // Form libraries
// 'forms': ['react-hook-form', '@hookform/resolvers', 'zod'], 'forms': ['react-hook-form', '@hookform/resolvers', 'zod'],
// // UI utilities // UI utilities
// 'ui-utils': [ 'ui-utils': [
// 'tailwind-merge', 'tailwind-merge',
// 'class-variance-authority', 'class-variance-authority',
// 'clsx', 'clsx',
// 'lucide-react', 'lucide-react',
// 'sonner', 'sonner',
// 'cmdk', 'cmdk',
// 'next-themes' 'next-themes'
// ], ],
// // Other React components // Other React components
// 'react-components': [ 'react-components': [
// 'react-day-picker', 'react-day-picker',
// 'react-error-boundary', 'react-error-boundary',
// 'embla-carousel-react', 'embla-carousel-react',
// 'react-resizable-panels' 'react-resizable-panels'
// ], ],
// // Non-React utilities // Non-React utilities
// 'utils': [ 'utils': [
// 'date-fns', 'date-fns',
// 'axios', 'axios',
// 'mitt', 'mitt',
// 'zustand', 'zustand',
// 'embla-carousel-autoplay' 'embla-carousel-autoplay'
// ], ],
// // Inertia // Inertia
// 'inertia': ['@inertiajs/react'] 'inertia': ['@inertiajs/react']
// } }
// } }
// }, },
// // Temporarily increase limit while optimizing // Temporarily increase limit while optimizing
// chunkSizeWarningLimit: 1000, chunkSizeWarningLimit: 1000,
// // Additional optimizations // Additional optimizations
// minify: 'esbuild', minify: 'esbuild',
// target: 'es2020', target: 'es2020',
// // Enable source maps for better debugging (optional) // Enable source maps for better debugging (optional)
// sourcemap: false, sourcemap: false,
// }, },
server: { server: {
headers: { headers: {
'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Opener-Policy': 'same-origin',