128 lines
8.2 KiB
PHP
128 lines
8.2 KiB
PHP
<nav x-data="{ open: false }" class="bg-white/80 backdrop-blur-md border-b border-slate-100 sticky top-0 z-50 shadow-sm">
|
|
@php
|
|
// Mengambil data branding dari database
|
|
$appLogo = \App\Models\Setting::where('key', 'app_logo')->value('value');
|
|
$appName = \App\Models\Setting::where('key', 'app_name')->value('value') ?? 'ILY Aregau';
|
|
@endphp
|
|
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex justify-between h-20"> <div class="flex">
|
|
<div class="shrink-0 flex items-center">
|
|
<a href="{{ route('dashboard') }}" class="flex items-center gap-4 group">
|
|
<div class="flex items-center justify-center transition-transform duration-300 group-hover:scale-105">
|
|
@if($appLogo)
|
|
<img src="{{ Storage::url($appLogo) }}"
|
|
alt="Logo {{ $appName }}"
|
|
class="h-16 w-auto max-w-[200px] object-contain object-left">
|
|
@else
|
|
<div class="w-12 h-12 bg-indigo-600 rounded-xl flex items-center justify-center text-white font-black text-sm shadow-lg">
|
|
{{ strtoupper(substr($appName, 0, 2)) }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="hidden md:flex flex-col border-l-2 border-slate-100 pl-4">
|
|
<span class="text-lg font-black text-slate-800 uppercase tracking-tighter leading-none">{{ $appName }}</span>
|
|
<span class="text-[10px] font-bold text-indigo-600 uppercase tracking-[0.2em] mt-1 italic">Cattery Management</span>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
<div class="hidden space-x-2 sm:-my-px sm:ms-10 sm:flex items-center">
|
|
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" class="text-[10px] font-black uppercase tracking-widest px-4 py-2 rounded-xl transition-all duration-200">
|
|
<i class="fas fa-th-large mr-2 opacity-50 group-hover:opacity-100"></i> {{ __('Dashboard') }}
|
|
</x-nav-link>
|
|
|
|
@if(Auth::user()->role === 'admin')
|
|
<x-nav-link :href="route('admin.settings.index')" :active="request()->routeIs('admin.settings.*')" class="text-[10px] font-black uppercase tracking-widest px-4 py-2 rounded-xl text-rose-500 hover:text-rose-600 transition-all duration-200">
|
|
<i class="fas fa-cog mr-2 opacity-50"></i> {{ __('Settings') }}
|
|
</x-nav-link>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="hidden sm:flex sm:items-center sm:ms-6">
|
|
<x-dropdown align="right" width="56">
|
|
<x-slot name="trigger">
|
|
<button class="inline-flex items-center gap-3 px-4 py-2 border-2 border-slate-50 text-xs leading-4 font-bold rounded-2xl text-slate-500 bg-slate-50/50 hover:bg-white hover:border-indigo-100 hover:text-indigo-600 focus:outline-none transition-all duration-200 shadow-sm active:scale-95">
|
|
<div class="w-7 h-7 bg-indigo-100 text-indigo-600 rounded-lg flex items-center justify-center font-black ring-2 ring-white">
|
|
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
|
|
</div>
|
|
<div class="uppercase tracking-tighter">{{ Auth::user()->name }}</div>
|
|
<i class="fas fa-chevron-down text-[10px] ml-1 opacity-30"></i>
|
|
</button>
|
|
</x-slot>
|
|
|
|
<x-slot name="content">
|
|
<div class="px-4 py-3 border-b border-slate-50">
|
|
<p class="text-[8px] font-black text-slate-400 uppercase tracking-widest">Signed in as</p>
|
|
<p class="text-xs font-bold text-slate-800 truncate">{{ Auth::user()->email }}</p>
|
|
</div>
|
|
<x-dropdown-link :href="route('profile.edit')" class="text-xs font-bold py-3 hover:bg-indigo-50 transition-colors">
|
|
<i class="fas fa-user-circle mr-2 opacity-40"></i> {{ __('My Profile') }}
|
|
</x-dropdown-link>
|
|
|
|
<div class="h-px bg-slate-50 my-1"></div>
|
|
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<x-dropdown-link :href="route('logout')" class="text-xs font-bold py-3 text-rose-500 hover:bg-rose-50 transition-colors" onclick="event.preventDefault(); this.closest('form').submit();">
|
|
<i class="fas fa-sign-out-alt mr-2 opacity-40"></i> {{ __('Log Out') }}
|
|
</x-dropdown-link>
|
|
</form>
|
|
</x-slot>
|
|
</x-dropdown>
|
|
</div>
|
|
|
|
<div class="-me-2 flex items-center sm:hidden">
|
|
<button @click="open = ! open" class="inline-flex items-center justify-center p-2.5 rounded-xl text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-200 active:scale-90">
|
|
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
|
|
<path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
|
<path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div x-show="open"
|
|
x-transition:enter="transition ease-out duration-200"
|
|
x-transition:enter-start="opacity-0 -translate-y-4"
|
|
x-transition:enter-end="opacity-100 translate-y-0"
|
|
class="hidden sm:hidden bg-white border-t border-slate-100">
|
|
<div class="pt-2 pb-3 space-y-1 px-4">
|
|
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" class="rounded-xl font-black text-[10px] uppercase tracking-widest py-3">
|
|
<i class="fas fa-th-large mr-3"></i> {{ __('Dashboard') }}
|
|
</x-responsive-nav-link>
|
|
|
|
@if(Auth::user()->role === 'admin')
|
|
<x-responsive-nav-link :href="route('admin.settings.index')" :active="request()->routeIs('admin.settings.*')" class="rounded-xl font-black text-[10px] uppercase tracking-widest text-rose-500 py-3">
|
|
<i class="fas fa-cog mr-3"></i> {{ __('System Settings') }}
|
|
</x-responsive-nav-link>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="pt-4 pb-4 border-t border-slate-100 bg-slate-50/50">
|
|
<div class="flex items-center px-6 gap-4">
|
|
<div class="w-12 h-12 bg-indigo-600 text-white rounded-2xl flex items-center justify-center font-black shadow-lg shadow-indigo-100 ring-4 ring-white">
|
|
{{ strtoupper(substr(Auth::user()->name, 0, 1)) }}
|
|
</div>
|
|
<div class="overflow-hidden">
|
|
<div class="font-black text-sm text-slate-800 uppercase tracking-tighter">{{ Auth::user()->name }}</div>
|
|
<div class="font-bold text-[10px] text-slate-400 truncate">{{ Auth::user()->email }}</div>
|
|
</div>
|
|
</div>
|
|
<div class="mt-4 space-y-1 px-4">
|
|
<x-responsive-nav-link :href="route('profile.edit')" class="rounded-xl font-bold text-xs uppercase tracking-widest py-3">
|
|
<i class="fas fa-user-circle mr-3"></i> {{ __('Profile Settings') }}
|
|
</x-responsive-nav-link>
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<x-responsive-nav-link :href="route('logout')" class="rounded-xl font-black text-xs uppercase tracking-widest text-rose-500 py-3" onclick="event.preventDefault(); this.closest('form').submit();">
|
|
<i class="fas fa-sign-out-alt mr-3"></i> {{ __('Sign Out') }}
|
|
</x-responsive-nav-link>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav> |