feat: implement custom homepage and replace default welcome route
This commit is contained in:
parent
2098570a23
commit
f2be0157a3
11
app/Http/Controllers/HomepageController.php
Normal file
11
app/Http/Controllers/HomepageController.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
class HomepageController extends Controller
|
||||
{
|
||||
public function __invoke()
|
||||
{
|
||||
return inertia('homepage');
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,7 @@ createInertiaApp({
|
||||
title: (title) => (title ? `${title} - ${appName}` : appName),
|
||||
layout: (name) => {
|
||||
switch (true) {
|
||||
case name === 'welcome':
|
||||
case name === 'welcome' || name === 'homepage':
|
||||
return null;
|
||||
case name.startsWith('auth/'):
|
||||
return AuthLayout;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Link, usePage } from '@inertiajs/react';
|
||||
import AppLogoIcon from '@/components/app-logo-icon';
|
||||
import { home } from '@/routes';
|
||||
import type { AuthLayoutProps } from '@/types';
|
||||
import { Link, usePage } from '@inertiajs/react';
|
||||
|
||||
export default function AuthSplitLayout({
|
||||
children,
|
||||
|
||||
74
resources/js/pages/homepage.tsx
Normal file
74
resources/js/pages/homepage.tsx
Normal file
@ -0,0 +1,74 @@
|
||||
import { Head, Link, usePage } from '@inertiajs/react';
|
||||
import { dashboard, login } from '@/routes';
|
||||
|
||||
export default function Homepage() {
|
||||
const { auth } = usePage().props as any;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head title="Welcome to VN Group" />
|
||||
<div className="relative min-h-screen overflow-hidden bg-[#0a0a0a] font-sans text-white selection:bg-orange-500/30">
|
||||
{/* Background Blobs */}
|
||||
<div className="absolute top-[-10%] left-[-10%] h-[500px] w-[500px] rounded-full bg-orange-600/20 blur-[120px]"></div>
|
||||
<div className="absolute bottom-[-10%] right-[-10%] h-[500px] w-[500px] rounded-full bg-blue-600/10 blur-[120px]"></div>
|
||||
|
||||
<div className="relative z-10 flex min-h-screen flex-col">
|
||||
{/* Header */}
|
||||
<header className="flex items-center justify-between px-8 py-6 lg:px-12">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="h-8 w-8 rounded-lg bg-gradient-to-br from-orange-500 to-red-600 shadow-lg shadow-orange-500/20"></div>
|
||||
<span className="text-xl font-bold tracking-tight">VN Group</span>
|
||||
</div>
|
||||
<nav className="flex items-center gap-6">
|
||||
{auth.user ? (
|
||||
<Link
|
||||
href={dashboard()}
|
||||
className="rounded-full bg-white/5 px-6 py-2 text-sm font-medium transition-all hover:bg-white/10 hover:ring-1 hover:ring-white/20"
|
||||
>
|
||||
Dashboard
|
||||
</Link>
|
||||
) : (
|
||||
<Link
|
||||
href={login()}
|
||||
className="rounded-full bg-orange-600 px-6 py-2 text-sm font-medium transition-all hover:bg-orange-500 hover:shadow-lg hover:shadow-orange-600/20"
|
||||
>
|
||||
Login
|
||||
</Link>
|
||||
)}
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
{/* Main Content */}
|
||||
<main className="flex flex-1 flex-col items-center justify-center px-6 text-center">
|
||||
<div className="animate-in fade-in slide-in-from-bottom-8 duration-1000">
|
||||
<h2 className="mb-2 text-sm font-semibold uppercase tracking-[0.3em] text-orange-500">
|
||||
Premium Experience
|
||||
</h2>
|
||||
<h1 className="mb-6 bg-gradient-to-b from-white to-white/60 bg-clip-text text-6xl font-extrabold tracking-tight text-transparent lg:text-8xl">
|
||||
Hello World.
|
||||
</h1>
|
||||
<p className="mx-auto max-w-2xl text-lg leading-relaxed text-zinc-400">
|
||||
Welcome to the next generation of our platform. We've built something beautiful
|
||||
for you to explore. Stay tuned for more updates.
|
||||
</p>
|
||||
|
||||
<div className="mt-10 flex items-center justify-center gap-4">
|
||||
<button className="group relative rounded-full bg-white px-8 py-3 text-sm font-bold text-black transition-all hover:scale-105 active:scale-95">
|
||||
Get Started
|
||||
</button>
|
||||
<button className="rounded-full border border-white/10 bg-white/5 px-8 py-3 text-sm font-bold transition-all hover:bg-white/10">
|
||||
Learn More
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{/* Footer */}
|
||||
<footer className="px-8 py-10 text-center text-sm text-zinc-600 lg:px-12">
|
||||
<p>© {new Date().getFullYear()} VN Group. All rights reserved.</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
6
routes/homepage.php
Normal file
6
routes/homepage.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\HomepageController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::get('/', HomepageController::class)->name('homepage');
|
||||
@ -1,14 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Laravel\Fortify\Features;
|
||||
|
||||
Route::inertia('/', 'welcome', [
|
||||
'canRegister' => Features::enabled(Features::registration()),
|
||||
])->name('home');
|
||||
|
||||
use App\Http\Controllers\AnalysisController;
|
||||
use App\Http\Controllers\DashboardController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware(['auth', 'verified'])->group(function () {
|
||||
Route::get('dashboard', DashboardController::class)->name('dashboard');
|
||||
@ -20,3 +14,4 @@
|
||||
require __DIR__.'/finance.php';
|
||||
require __DIR__.'/system.php';
|
||||
require __DIR__.'/manage.php';
|
||||
require __DIR__.'/homepage.php';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user