Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/section-header.blade.php
Joseph.Rawlings a7cb561053 Enhance UI transitions and loading effects across Proxmox views
- 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.
2025-12-17 19:50:05 -05:00

112 lines
6.1 KiB
PHP

{{--
Section Header Component - AdminLTE style
Usage:
<x-proxmox::ui.section-header title="Section Title" />
<x-proxmox::ui.section-header title="Title" subtitle="Subtitle" icon="ri-server-line">
<x-slot:actions>
<x-proxmox::ui.button>Action</x-proxmox::ui.button>
</x-slot:actions>
</x-proxmox::ui.section-header>
--}}
@props([
'title',
'subtitle' => null,
'icon' => null,
'iconColor' => null,
'actions' => null,
'helpText' => null,
'size' => 'lg',
])
@php
$titleSizes = [
'sm' => 'font-size: .875rem; font-weight: 600;',
'md' => 'font-size: 1rem; font-weight: 600;',
'lg' => 'font-size: 1.125rem; font-weight: 600;',
'xl' => 'font-size: 1.25rem; font-weight: 700;',
];
$titleStyle = $titleSizes[$size] ?? $titleSizes['lg'];
@endphp
<div {{ $attributes->class(['flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between group']) }}>
<div class="flex items-start gap-3.5">
@if($icon)
<div style="width: 2.75rem; height: 2.75rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: .5rem; background: rgba(13, 110, 253, 0.1);" class="transition-transform duration-300 group-hover:scale-105">
<x-dynamic-component :component="$icon" class="size-5 transition-colors duration-200" style="color: #0d6efd;" />
</div>
@endif
<div style="display: flex; flex-direction: column; gap: .25rem;">
<div class="flex min-w-0 items-center gap-2">
<h2 style="{{ $titleStyle }} color: #212529; margin: 0;">{{ $title }}</h2>
@if($helpText)
<div class="relative" x-data="{ open: false }" x-cloak>
<button
type="button"
@click="open = true"
style="color: #6c757d; transition: color .2s ease;"
onmouseover="this.style.color='#495057'"
onmouseout="this.style.color='#6c757d'"
>
<x-ri-question-line class="size-4.5" />
</button>
{{-- Help Modal --}}
<div
x-show="open"
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"
@click="open = false"
@keydown.escape.window="open = false"
class="fixed inset-0"
style="z-index: 99999; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); display: none;"
></div>
<div
x-show="open"
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.away="open = false"
class="fixed inset-0 flex items-center justify-center p-4"
style="z-index: 99999; display: none;"
>
<div class="modal-lte" style="max-height: 90vh; width: 100%; max-width: 32rem; overflow-y: auto; padding: 1.5rem; background: #fff; border-radius: .375rem; box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);">
<button @click="open = false" style="position: absolute; right: 1rem; top: 1rem; width: 2.25rem; height: 2.25rem; display: flex; align-items: center; justify-content: center; border-radius: .25rem; color: #6c757d; border: none; background: transparent; cursor: pointer; transition: background .2s ease, color .2s ease;" onmouseover="this.style.background='#f8f9fa'; this.style.color='#212529'" onmouseout="this.style.background='transparent'; this.style.color='#6c757d'">
<x-ri-close-line class="size-5" />
</button>
<div style="margin-bottom: 1.25rem; display: flex; align-items: center; gap: .875rem; padding-right: 2rem;">
@if($icon)
<div style="width: 2.75rem; height: 2.75rem; display: flex; align-items: center; justify-content: center; border-radius: .5rem; background: rgba(13, 110, 253, 0.1);">
<x-dynamic-component :component="$icon" class="size-5" style="color: #0d6efd;" />
</div>
@endif
<h3 style="font-size: 1.125rem; font-weight: 600; color: #212529; margin: 0;">{{ $title }}</h3>
</div>
<div style="font-size: .875rem; color: #6c757d; line-height: 1.5;">
{{ $helpText }}
</div>
</div>
</div>
</div>
@endif
</div>
@if($subtitle)
<p style="font-size: .875rem; color: #6c757d; margin: 0;">{{ $subtitle }}</p>
@endif
</div>
</div>
@if($actions)
<div class="flex flex-shrink-0 items-center gap-3">
{{ $actions }}
</div>
@endif
</div>