Detailing fungsi semua modul dari bugs error
This commit is contained in:
@@ -33,5 +33,70 @@
|
||||
</div>
|
||||
|
||||
@livewireScripts
|
||||
|
||||
@if(session()->has('success') || session()->has('error') || session()->has('info') || session()->has('warning') || $errors->any())
|
||||
<div x-data="{ show: true }"
|
||||
x-show="show"
|
||||
x-init="setTimeout(() => show = false, 5000)"
|
||||
x-transition:enter="transform ease-out duration-300 transition"
|
||||
x-transition:enter-start="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-10"
|
||||
x-transition:enter-end="translate-y-0 opacity-100 sm:translate-x-0"
|
||||
x-transition:leave="transition ease-in duration-200"
|
||||
x-transition:leave-start="opacity-100 sm:translate-x-0"
|
||||
x-transition:leave-end="opacity-0 sm:translate-x-10"
|
||||
class="fixed top-5 right-5 z-[9999] flex w-full max-w-sm overflow-hidden bg-white rounded-xl shadow-2xl border border-slate-100"
|
||||
style="display: none;">
|
||||
|
||||
@if(session('success'))
|
||||
<div class="flex items-center justify-center w-12 bg-emerald-500">
|
||||
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>
|
||||
</div>
|
||||
@elseif(session('error') || $errors->any())
|
||||
<div class="flex items-center justify-center w-12 bg-red-500">
|
||||
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
|
||||
</div>
|
||||
@elseif(session('info'))
|
||||
<div class="flex items-center justify-center w-12 bg-blue-500">
|
||||
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
||||
</div>
|
||||
@elseif(session('warning'))
|
||||
<div class="flex items-center justify-center w-12 bg-amber-500">
|
||||
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="px-4 py-3 -mx-3 w-full">
|
||||
<div class="mx-3">
|
||||
@if(session('success')) <span class="font-bold text-emerald-500">Berhasil!</span>
|
||||
@elseif(session('error') || $errors->any()) <span class="font-bold text-red-500">Gagal Menyimpan!</span>
|
||||
@elseif(session('info')) <span class="font-bold text-blue-500">Informasi</span>
|
||||
@elseif(session('warning')) <span class="font-bold text-amber-500">Peringatan</span>
|
||||
@endif
|
||||
|
||||
<p class="text-sm text-slate-600 mt-1 font-medium line-clamp-2">
|
||||
@if($errors->any())
|
||||
{{ $errors->first() }}
|
||||
@else
|
||||
{{ session('success') ?? session('error') ?? session('info') ?? session('warning') }}
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ml-auto flex items-start px-2 py-2 shrink-0">
|
||||
<button @click="show = false" class="text-slate-400 hover:text-slate-600 focus:outline-none transition-colors">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="absolute bottom-0 left-0 h-1
|
||||
{{ session('success') ? 'bg-emerald-200' : (session('error') || $errors->any() ? 'bg-red-200' : (session('info') ? 'bg-blue-200' : 'bg-amber-200')) }}
|
||||
w-full"
|
||||
x-data="{ width: '100%' }"
|
||||
x-init="setTimeout(() => width = '0%', 50)"
|
||||
:style="`width: ${width}; transition: width 5s linear;`">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user