- Implemented page load animations using Alpine.js for smoother transitions in various views including firewall, help, index, network, overview, reinstall, server, statistics, storage, subdomain, and system. - Added opacity and translate effects to elements for improved visual feedback during loading. - Enhanced hover effects on cards and buttons for better user interaction. - Adjusted transition timings and delays for a more cohesive user experience.
116 lines
4.1 KiB
PHP
116 lines
4.1 KiB
PHP
{{--
|
|
Modal Component - AdminLTE Theme
|
|
Based on AdminLTE v4 Modal styling patterns
|
|
|
|
Usage:
|
|
<x-proxmox::ui.modal name="my-modal" title="Modal Title">Content</x-proxmox::ui.modal>
|
|
|
|
Open with: $dispatch('open-modal', { name: 'my-modal' })
|
|
Close with: $dispatch('close-modal', { name: 'my-modal' })
|
|
--}}
|
|
|
|
@props([
|
|
'name',
|
|
'title' => null,
|
|
'subtitle' => null,
|
|
'icon' => null,
|
|
'iconColor' => 'lte-text-primary',
|
|
'maxWidth' => 'md',
|
|
'closeable' => true,
|
|
'footer' => null,
|
|
])
|
|
|
|
@php
|
|
$maxWidthClasses = [
|
|
'sm' => 'max-w-sm',
|
|
'md' => 'max-w-md',
|
|
'lg' => 'max-w-lg',
|
|
'xl' => 'max-w-xl',
|
|
'2xl' => 'max-w-2xl',
|
|
'3xl' => 'max-w-3xl',
|
|
'4xl' => 'max-w-4xl',
|
|
'5xl' => 'max-w-5xl',
|
|
'full' => 'max-w-full mx-4',
|
|
];
|
|
$maxWidthClass = $maxWidthClasses[$maxWidth] ?? $maxWidthClasses['md'];
|
|
@endphp
|
|
|
|
<div
|
|
x-data="{ show: false }"
|
|
x-on:open-modal.window="if ($event.detail.name === '{{ $name }}') show = true"
|
|
x-on:close-modal.window="if ($event.detail.name === '{{ $name }}') show = false"
|
|
x-on:keydown.escape.window="@if($closeable) show = false @endif"
|
|
x-show="show"
|
|
x-cloak
|
|
class="fixed inset-0 z-99999 overflow-y-auto"
|
|
{{ $attributes }}
|
|
>
|
|
{{-- Backdrop --}}
|
|
<div
|
|
x-show="show"
|
|
x-transition:enter="transition ease-out duration-300"
|
|
x-transition:enter-start="opacity-0"
|
|
x-transition:enter-end="opacity-100"
|
|
x-transition:leave="transition ease-in duration-200"
|
|
x-transition:leave-start="opacity-100"
|
|
x-transition:leave-end="opacity-0"
|
|
@if($closeable) @click="show = false" @endif
|
|
class="lte-modal-backdrop backdrop-blur-sm"
|
|
></div>
|
|
|
|
{{-- Modal Panel --}}
|
|
<div class="fixed inset-0 flex items-center justify-center p-4">
|
|
<div
|
|
x-show="show"
|
|
x-transition:enter="transition ease-out duration-300"
|
|
x-transition:enter-start="opacity-0 scale-95 translate-y-4"
|
|
x-transition:enter-end="opacity-100 scale-100 translate-y-0"
|
|
x-transition:leave="transition ease-in duration-200"
|
|
x-transition:leave-start="opacity-100 scale-100 translate-y-0"
|
|
x-transition:leave-end="opacity-0 scale-95 translate-y-4"
|
|
@click.stop
|
|
class="lte-modal-content lte-slide-in-up w-full {{ $maxWidthClass }} max-h-[90vh] overflow-y-auto shadow-2xl"
|
|
>
|
|
{{-- Header --}}
|
|
@if($title || $closeable)
|
|
<div class="lte-modal-header">
|
|
<div class="flex items-center gap-3">
|
|
@if($icon)
|
|
<span class="lte-info-box-icon lte-bg-light rounded" style="width: 40px; height: 40px; font-size: 1rem;">
|
|
<x-dynamic-component :component="$icon" class="size-5 {{ $iconColor }}" />
|
|
</span>
|
|
@endif
|
|
<div>
|
|
@if($title)
|
|
<h5 class="lte-modal-title">{{ $title }}</h5>
|
|
@endif
|
|
@if($subtitle)
|
|
<p class="lte-text-muted" style="font-size: 0.875rem; margin: 0;">{{ $subtitle }}</p>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@if($closeable)
|
|
<button
|
|
@click="show = false"
|
|
class="lte-btn-close transition-all duration-200 hover:scale-110 hover:opacity-70"
|
|
aria-label="Close"
|
|
></button>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Content --}}
|
|
<div class="lte-modal-body">
|
|
{{ $slot }}
|
|
</div>
|
|
|
|
{{-- Footer --}}
|
|
@if($footer)
|
|
<div class="lte-modal-footer">
|
|
{{ $footer }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|