refactor: remove designers table migration and update layout structure for improved readability and organization

This commit is contained in:
pacnpal
2025-03-25 11:33:47 -04:00
parent 8eac13d51b
commit 86263db9d9
3 changed files with 54 additions and 236 deletions

View File

@@ -1,27 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('designers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->text('description')->nullable();
$table->string('website')->nullable();
$table->date('founded_date')->nullable();
$table->string('headquarters')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('designers');
}
};

View File

@@ -1,38 +1,22 @@
<x-app-layout> @extends('layouts.app')
@section('title', 'ThrillWiki - Your Ultimate Theme Park Guide')
<div class="flex flex-col items-center justify-center min-h-[70vh] text-center">
<div class="w-full max-w-4xl px-4">
<h1 class="mb-8 text-6xl font-bold text-white">
Welcome to ThrillWiki
</h1>
<p class="mb-16 text-2xl text-gray-300"> @section('content')
Your ultimate guide to theme parks and attractions worldwide <div class="container mx-auto px-4 py-8">
</p> <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="bg-white rounded-lg shadow p-6">
<h3 class="text-xl font-bold mb-2">Total Parks</h3>
<p class="text-3xl font-bold text-blue-600">{{ $total_parks }}</p>
</div>
<div class="flex items-center justify-center gap-4"> <div class="bg-white rounded-lg shadow p-6">
<a href="{{ route('parks.index') }}" class="px-10 py-4 text-xl font-semibold text-white transition-transform bg-indigo-600 rounded-lg hover:scale-105"> <h3 class="text-xl font-bold mb-2">Total Attractions</h3>
Explore Parks <p class="text-3xl font-bold text-green-600">{{ $total_attractions }}</p>
</a> </div>
<a href="{{ route('rides.index') }}" class="px-10 py-4 text-xl font-semibold text-white transition-transform border rounded-lg hover:scale-105 border-white/20">
View Rides
</a>
</div>
<div class="grid grid-cols-1 gap-8 mt-20 sm:grid-cols-3"> <div class="bg-white rounded-lg shadow p-6">
<div class="p-8 text-center rounded-lg bg-gray-900/50"> <h3 class="text-xl font-bold mb-2">Total Roller Coasters</h3>
<div class="text-6xl font-bold text-white">{{ $total_parks ?? 0 }}</div> <p class="text-3xl font-bold text-purple-600">{{ $total_coasters }}</p>
<div class="mt-3 text-xl text-gray-300">Theme Parks</div>
</div>
<div class="p-8 text-center rounded-lg bg-gray-900/50">
<div class="text-6xl font-bold text-white">{{ $total_attractions ?? 0 }}</div>
<div class="mt-3 text-xl text-gray-300">Attractions</div>
</div>
<div class="p-8 text-center rounded-lg bg-gray-900/50">
<div class="text-6xl font-bold text-white">{{ $total_coasters ?? 0 }}</div>
<div class="mt-3 text-xl text-gray-300">Roller Coasters</div>
</div>
</div>
</div> </div>
</div> </div>
</x-app-layout> </div>
@endsection

View File

@@ -1,183 +1,44 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}" /> <meta name="csrf-token" content="{{ csrf_token() }}">
<title>@yield('title', 'ThrillWiki')</title>
<!-- Google Fonts --> <title>{{ config('app.name', 'ThrillWiki') }}</title>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
<!-- Prevent flash of wrong theme --> <!-- Scripts -->
<script> @vite(['resources/css/app.css', 'resources/js/app.js'])
let theme = localStorage.getItem("theme");
if (!theme) {
theme = window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark"
: "light";
localStorage.setItem("theme", theme);
}
if (theme === "dark") {
document.documentElement.classList.add("dark");
}
</script>
<!-- HTMX --> <!-- Styles -->
<script src="https://unpkg.com/htmx.org@1.9.6"></script> @livewireStyles
</head>
<body class="font-sans antialiased bg-gray-100">
<div class="min-h-screen">
<nav class="bg-white border-b border-gray-100">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex">
<div class="flex-shrink-0 flex items-center">
<a href="{{ route('home') }}" class="text-2xl font-bold text-gray-800">
ThrillWiki
</a>
</div>
</div>
<!-- Scripts and Styles (loaded via Vite) --> <div class="flex items-center">
@vite(['resources/js/app.js', 'resources/css/app.css']) @livewire('auth-menu-component')
</div>
<!-- Font Awesome -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
/>
<style>
.dropdown-menu {
position: absolute;
right: 0;
margin-top: 0.5rem;
width: 12rem;
border-radius: 0.375rem;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
0 4px 6px -2px rgba(0, 0, 0, 0.05);
z-index: 50;
overflow: hidden;
}
.htmx-indicator {
display: none;
}
.htmx-request .htmx-indicator {
display: block;
}
.htmx-request.htmx-indicator {
display: block;
}
</style>
@stack('styles')
</head>
<body
class="flex flex-col min-h-screen text-gray-900 bg-gradient-to-br from-white via-blue-50 to-indigo-50 dark:from-gray-950 dark:via-blue-950 dark:to-purple-950 dark:text-white"
>
<!-- Header -->
<header class="sticky top-0 z-40 bg-gray-900 shadow-lg">
<nav class="container mx-auto">
<div class="flex items-center justify-between h-20 px-6">
<!-- Logo -->
<div class="flex items-center">
<a href="{{ route('home') }}" class="text-2xl font-bold text-white transition-transform hover:scale-105">
<span class="text-gradient">ThrillWiki</span>
</a>
</div>
<!-- Navigation Links (Always Visible) -->
<div class="hidden lg:flex items-center space-x-8">
<a href="{{ route('parks.index') }}" class="nav-link">
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2L2 9L12 16L22 9L12 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M2 9V20L12 16" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M22 9V20L12 16" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span>Parks</span>
</a>
<a href="{{ route('rides.index') }}" class="nav-link">
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22 12H18L15 21L9 3L6 12H2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span>Rides</span>
</a>
</div>
<!-- Search Bar -->
<div class="flex-1 max-w-xl mx-8 hidden lg:block">
<form action="{{ route('search') }}" method="get" class="w-full">
<div class="relative">
<input
type="text"
name="q"
placeholder="Search parks and rides..."
class="w-full px-4 py-2 text-gray-200 bg-gray-800/50 border border-gray-700/50 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary placeholder-gray-400"
/>
<button type="submit" class="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400">
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none">
<path d="M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
</form>
</div>
<!-- Right Side Menu -->
<div class="flex items-center space-x-6">
<!-- Theme Toggle -->
<livewire:theme-toggle-component />
<!-- User Menu -->
@auth
@if(auth()->user()->can('access-moderation'))
<a href="{{ route('moderation.dashboard') }}" class="flex items-center gap-2 text-gray-300 hover:text-white">
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span>Moderation</span>
</a>
@endif
<livewire:user-menu-component />
@else
<livewire:auth-menu-component />
@endauth
<!-- Mobile Menu -->
<livewire:mobile-menu-component />
</div>
</div>
</nav>
</header>
<!-- Flash Messages -->
@if (session('status'))
<div class="fixed top-0 right-0 z-50 p-4 space-y-4">
<div class="alert alert-success">
{{ session('status') }}
</div>
</div>
@endif
<!-- Main Content -->
<main class="container flex-grow px-6 py-8 mx-auto">
{{ $slot }}
</main>
<!-- Footer -->
<footer
class="mt-auto border-t bg-white/90 dark:bg-gray-800/90 backdrop-blur-lg border-gray-200/50 dark:border-gray-700/50"
>
<div class="container px-6 py-6 mx-auto">
<div class="flex items-center justify-between">
<div class="text-gray-600 dark:text-gray-400">
<p>&copy; {{ date('Y') }} ThrillWiki. All rights reserved.</p>
</div>
<div class="space-x-4">
<a
href="{{ route('terms') }}"
class="text-gray-600 transition-colors hover:text-primary dark:text-gray-400 dark:hover:text-primary"
>Terms</a>
<a
href="{{ route('privacy') }}"
class="text-gray-600 transition-colors hover:text-primary dark:text-gray-400 dark:hover:text-primary"
>Privacy</a>
</div> </div>
</div> </div>
</div> </nav>
</footer>
@stack('scripts') <!-- Page Content -->
</body> <main>
@yield('content')
</main>
</div>
@livewireScripts
</body>
</html> </html>