feat: enhance Proxmox layout with modern navigation styles, improved tab functionality, and mobile-friendly design elements for better user experience

This commit is contained in:
2025-12-04 09:55:10 -05:00
parent 38e7052900
commit 1fd6fea41f

View File

@@ -172,103 +172,275 @@
<div class="mb-10 mt-3">
<style>
.view-toggle-switch {
/* Modern Navigation Styles */
.proxmox-nav-container {
background: rgba(var(--background-secondary-rgb, 255, 255, 255), 0.6);
backdrop-filter: blur(12px);
border: 1px solid rgba(var(--neutral-rgb, 229, 231, 235), 0.3);
border-radius: 14px;
padding: 8px;
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.05),
0 0 0 1px rgba(0, 0, 0, 0.02);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .proxmox-nav-container {
background: rgba(var(--background-secondary-rgb, 31, 41, 55), 0.8);
border-color: rgba(var(--neutral-rgb, 75, 85, 99), 0.4);
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.3),
0 0 0 1px rgba(255, 255, 255, 0.05);
}
.proxmox-nav-tabs {
display: flex;
gap: 4px;
flex-wrap: wrap;
flex: 1;
}
.proxmox-tab-link {
position: relative;
display: inline-block;
width: 36px;
height: 20px;
margin: 0 12px;
font-size: 0.8125rem;
font-weight: 600;
padding: 10px 16px;
border-radius: 10px;
letter-spacing: -0.01em;
white-space: nowrap;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid transparent;
overflow: hidden;
}
.view-toggle-switch input {
.proxmox-tab-link::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg,
rgba(37, 99, 235, 0.08),
rgba(59, 130, 246, 0.05));
opacity: 0;
width: 0;
height: 0;
transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 0;
}
.view-toggle-slider {
position: absolute;
.proxmox-tab-link:hover::before {
opacity: 1;
}
.proxmox-tab-link span {
position: relative;
z-index: 1;
}
.proxmox-tab-link:hover {
transform: translateY(-1px);
border-color: rgba(37, 99, 235, 0.15);
}
.proxmox-tab-link.active {
background: linear-gradient(135deg,
rgba(37, 99, 235, 0.12),
rgba(59, 130, 246, 0.08));
border-color: rgba(37, 99, 235, 0.25);
box-shadow:
0 2px 8px rgba(37, 99, 235, 0.15),
inset 0 1px 0 rgba(255, 255, 255, 0.1);
color: rgb(37, 99, 235);
}
.dark .proxmox-tab-link.active {
background: linear-gradient(135deg,
rgba(59, 130, 246, 0.18),
rgba(37, 99, 235, 0.12));
border-color: rgba(59, 130, 246, 0.35);
color: rgb(96, 165, 250);
}
.proxmox-tab-link:not(.active) {
color: rgba(var(--base-rgb, 0, 0, 0), 0.65);
}
.dark .proxmox-tab-link:not(.active) {
color: rgba(var(--base-rgb, 255, 255, 255), 0.65);
}
/* Modern Toggle Switch */
.modern-toggle-container {
display: inline-flex;
align-items: center;
gap: 12px;
padding: 6px 12px;
background: rgba(var(--background-rgb, 255, 255, 255), 0.5);
border: 1px solid rgba(var(--neutral-rgb, 229, 231, 235), 0.4);
border-radius: 12px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .modern-toggle-container {
background: rgba(var(--background-rgb, 17, 24, 39), 0.6);
border-color: rgba(var(--neutral-rgb, 75, 85, 99), 0.5);
}
.modern-toggle-label {
font-size: 0.75rem;
font-weight: 600;
letter-spacing: 0.02em;
text-transform: uppercase;
transition: all 0.2s ease;
user-select: none;
}
.modern-toggle-label.inactive {
color: rgba(var(--base-rgb, 0, 0, 0), 0.4);
}
.modern-toggle-label.active {
color: rgb(37, 99, 235);
}
.dark .modern-toggle-label.active {
color: rgb(96, 165, 250);
}
.dark .modern-toggle-label.inactive {
color: rgba(var(--base-rgb, 255, 255, 255), 0.4);
}
.modern-toggle-switch {
position: relative;
width: 48px;
height: 26px;
background: linear-gradient(135deg,
rgba(156, 163, 175, 0.4),
rgba(209, 213, 219, 0.4));
border-radius: 13px;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #e5e7eb;
transition: 0.3s;
border-radius: 20px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid rgba(var(--neutral-rgb, 156, 163, 175), 0.2);
box-shadow:
inset 0 1px 3px rgba(0, 0, 0, 0.1),
0 1px 2px rgba(0, 0, 0, 0.05);
}
.view-toggle-slider:before {
.dark .modern-toggle-switch {
background: linear-gradient(135deg,
rgba(55, 65, 81, 0.6),
rgba(75, 85, 99, 0.6));
border-color: rgba(var(--neutral-rgb, 75, 85, 99), 0.4);
}
.modern-toggle-switch.active {
background: linear-gradient(135deg,
rgb(37, 99, 235),
rgb(59, 130, 246));
border-color: rgba(37, 99, 235, 0.3);
box-shadow:
0 0 0 3px rgba(37, 99, 235, 0.1),
inset 0 1px 3px rgba(0, 0, 0, 0.15),
0 2px 6px rgba(37, 99, 235, 0.25);
}
.dark .modern-toggle-switch.active {
background: linear-gradient(135deg,
rgb(59, 130, 246),
rgb(96, 165, 250));
box-shadow:
0 0 0 3px rgba(59, 130, 246, 0.15),
inset 0 1px 3px rgba(0, 0, 0, 0.2),
0 2px 8px rgba(59, 130, 246, 0.3);
}
.modern-toggle-handle {
position: absolute;
content: "";
height: 16px;
width: 16px;
top: 2px;
left: 2px;
bottom: 2px;
background-color: white;
transition: 0.3s;
width: 20px;
height: 20px;
background: linear-gradient(135deg,
rgb(255, 255, 255),
rgb(249, 250, 251));
border-radius: 50%;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
box-shadow:
0 2px 4px rgba(0, 0, 0, 0.15),
0 0 0 1px rgba(0, 0, 0, 0.05);
}
.view-toggle-switch input:checked + .view-toggle-slider {
background-color: #2563eb;
.modern-toggle-switch.active .modern-toggle-handle {
transform: translateX(22px);
box-shadow:
0 3px 8px rgba(0, 0, 0, 0.2),
0 0 0 1px rgba(255, 255, 255, 0.1);
}
.view-toggle-switch input:checked + .view-toggle-slider:before {
transform: translateX(16px);
}
.view-toggle-switch input:disabled + .view-toggle-slider {
opacity: 0.5;
.modern-toggle-switch.disabled {
opacity: 0.4;
cursor: not-allowed;
}
.dark .view-toggle-slider {
background-color: #374151;
/* Animation for tab transitions */
@keyframes tabSlideIn {
from {
opacity: 0;
transform: translateY(-8px);
}
.dark .view-toggle-switch input:checked + .view-toggle-slider {
background-color: #2563eb;
}
</style>
<div class="hidden lg:flex flex-row gap-2 items-baseline">
<style>
.proxmox-tab-link {
font-size: 0.8125rem; /* text-[13px] */
font-weight: 600;
padding: 0.35rem 0.6rem;
border-radius: 0.4rem;
letter-spacing: -0.01em;
gap: 0.35rem;
white-space: nowrap;
to {
opacity: 1;
transform: translateY(0);
}
}
.proxmox-tab-wrapper {
animation: tabSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
</style>
<div class="hidden lg:block">
<div class="proxmox-nav-container">
<div class="flex items-center justify-between gap-4">
<div class="proxmox-nav-tabs">
@foreach($tabs as $tab)
@php
$isAdvancedTab = $tab['advanced'] ?? false;
@endphp
<div class="flex flex-col items-center"
<div class="proxmox-tab-wrapper"
@if($isAdvancedTab)
x-show="isAdvancedView"
x-transition
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
@endif>
<a href="{{ $tab['route'] }}" wire:navigate
class="flex items-center proxmox-tab-link justify-center hover:bg-background-secondary/80 transition-colors duration-200 {{ $view === $tab['view'] ? 'text-base' : 'text-base/70' }}">
{{ $tab['label'] }}
class="proxmox-tab-link {{ $view === $tab['view'] ? 'active' : '' }}">
<span>{{ $tab['label'] }}</span>
</a>
@if($view === $tab['view'])
<span class="block h-0.5 w-full mt-1 rounded-full bg-base"></span>
@else
<span class="block h-0.5 w-full mt-1 rounded-full bg-transparent"></span>
@endif
</div>
@endforeach
<div class="ml-auto" style="padding-top: 0.5rem;">
<label class="inline-flex items-center" :class="isAdvancedOnlyView ? 'opacity-50 cursor-not-allowed pointer-events-none' : 'cursor-pointer'">
<span class="select-none text-sm font-medium text-gray-700 dark:text-gray-300">Standard</span>
<label class="view-toggle-switch">
<input
type="checkbox"
:checked="isAdvancedView"
@change="!isAdvancedOnlyView && toggleView()"
:disabled="isAdvancedOnlyView">
<span class="view-toggle-slider"></span>
</label>
<span class="select-none text-sm font-medium text-gray-700 dark:text-gray-300">Advanced</span>
</label>
</div>
<div class="modern-toggle-container"
:class="isAdvancedOnlyView ? 'opacity-50 cursor-not-allowed pointer-events-none' : ''">
<span class="modern-toggle-label"
:class="!isAdvancedView ? 'active' : 'inactive'">
Standard
</span>
<div class="modern-toggle-switch"
:class="{ 'active': isAdvancedView, 'disabled': isAdvancedOnlyView }"
@click="!isAdvancedOnlyView && toggleView()">
<div class="modern-toggle-handle"></div>
</div>
<span class="modern-toggle-label"
:class="isAdvancedView ? 'active' : 'inactive'">
Advanced
</span>
</div>
</div>
</div>
</div>
@@ -300,28 +472,165 @@
}
});
">
<div class="flex gap-2">
<style>
.mobile-nav-button {
background: rgba(var(--background-secondary-rgb, 255, 255, 255), 0.6);
backdrop-filter: blur(12px);
border: 1px solid rgba(var(--neutral-rgb, 229, 231, 235), 0.3);
border-radius: 12px;
padding: 12px 16px;
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.05),
0 0 0 1px rgba(0, 0, 0, 0.02);
transition: all 0.2s ease;
}
.dark .mobile-nav-button {
background: rgba(var(--background-secondary-rgb, 31, 41, 55), 0.8);
border-color: rgba(var(--neutral-rgb, 75, 85, 99), 0.4);
}
.mobile-nav-button:active {
transform: scale(0.98);
}
.mobile-dropdown {
background: rgba(var(--background-secondary-rgb, 255, 255, 255), 0.95);
backdrop-filter: blur(16px);
border: 1px solid rgba(var(--neutral-rgb, 229, 231, 235), 0.3);
border-radius: 14px;
box-shadow:
0 4px 16px rgba(0, 0, 0, 0.1),
0 0 0 1px rgba(0, 0, 0, 0.03);
}
.dark .mobile-dropdown {
background: rgba(var(--background-secondary-rgb, 31, 41, 55), 0.95);
border-color: rgba(var(--neutral-rgb, 75, 85, 99), 0.4);
box-shadow:
0 4px 16px rgba(0, 0, 0, 0.3),
0 0 0 1px rgba(255, 255, 255, 0.05);
}
.mobile-tab-item {
padding: 12px 16px;
transition: all 0.2s ease;
border-left: 3px solid transparent;
}
.mobile-tab-item:hover {
background: rgba(37, 99, 235, 0.08);
border-left-color: rgba(37, 99, 235, 0.3);
}
.mobile-tab-item.active {
background: rgba(37, 99, 235, 0.12);
border-left-color: rgb(37, 99, 235);
font-weight: 600;
}
.dark .mobile-tab-item.active {
background: rgba(59, 130, 246, 0.15);
border-left-color: rgb(96, 165, 250);
}
.mobile-toggle-compact {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
background: rgba(var(--background-rgb, 255, 255, 255), 0.5);
border: 1px solid rgba(var(--neutral-rgb, 229, 231, 235), 0.4);
border-radius: 10px;
}
.dark .mobile-toggle-compact {
background: rgba(var(--background-rgb, 17, 24, 39), 0.6);
border-color: rgba(var(--neutral-rgb, 75, 85, 99), 0.5);
}
.mobile-toggle-label-compact {
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.03em;
}
.mobile-toggle-switch-compact {
width: 40px;
height: 22px;
background: linear-gradient(135deg,
rgba(156, 163, 175, 0.4),
rgba(209, 213, 219, 0.4));
border-radius: 11px;
position: relative;
transition: all 0.3s ease;
border: 1px solid rgba(var(--neutral-rgb, 156, 163, 175), 0.2);
}
.mobile-toggle-switch-compact.active {
background: linear-gradient(135deg,
rgb(37, 99, 235),
rgb(59, 130, 246));
}
.dark .mobile-toggle-switch-compact.active {
background: linear-gradient(135deg,
rgb(59, 130, 246),
rgb(96, 165, 250));
}
.mobile-toggle-handle-compact {
position: absolute;
top: 1px;
left: 1px;
width: 18px;
height: 18px;
background: white;
border-radius: 50%;
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.mobile-toggle-switch-compact.active .mobile-toggle-handle-compact {
transform: translateX(18px);
}
</style>
<div class="flex gap-3">
<button @click="open = !open"
class="flex items-center gap-2 bg-background-secondary border border-neutral px-4 py-2 rounded-lg flex-1 justify-between">
<span>{{ $tabs[array_search($view, array_column($tabs, 'view'))]['label'] ?? __('Menu') }}</span>
class="mobile-nav-button flex items-center gap-3 flex-1 justify-between font-semibold">
<span class="text-sm">{{ $tabs[array_search($view, array_column($tabs, 'view'))]['label'] ?? __('Menu') }}</span>
<x-ri-menu-line class="size-5" />
</button>
<label class="inline-flex items-center flex-shrink-0" :class="isAdvancedOnlyView ? 'opacity-50 cursor-not-allowed pointer-events-none' : 'cursor-pointer'">
<span class="select-none text-sm font-medium text-gray-700 dark:text-gray-300">Standard</span>
<label class="view-toggle-switch">
<input
type="checkbox"
:checked="isAdvancedView"
@change="!isAdvancedOnlyView && toggleView()"
:disabled="isAdvancedOnlyView">
<span class="view-toggle-slider"></span>
</label>
<span class="select-none text-sm font-medium text-gray-700 dark:text-gray-300">Advanced</span>
</label>
<div class="mobile-toggle-compact flex-shrink-0"
:class="isAdvancedOnlyView ? 'opacity-50 pointer-events-none' : ''">
<span class="mobile-toggle-label-compact"
:class="!isAdvancedView ? 'text-base' : 'text-base/40'">
Std
</span>
<div class="mobile-toggle-switch-compact"
:class="{ 'active': isAdvancedView }"
@click="!isAdvancedOnlyView && toggleView()">
<div class="mobile-toggle-handle-compact"></div>
</div>
<div x-show="open" x-transition @click.outside="open = false"
class="mt-2 bg-background-secondary border border-neutral rounded-lg shadow-lg overflow-hidden">
<div class="flex flex-col divide-y divide-neutral/40">
<span class="mobile-toggle-label-compact"
:class="isAdvancedView ? 'text-base' : 'text-base/40'">
Adv
</span>
</div>
</div>
<div x-show="open"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
@click.outside="open = false"
class="mobile-dropdown mt-3 overflow-hidden">
<div class="flex flex-col">
@foreach($tabs as $tab)
@php
$isAdvancedTab = $tab['advanced'] ?? false;
@@ -331,11 +640,11 @@
x-transition
@endif>
<a href="{{ $tab['route'] }}" wire:navigate
class="flex items-center justify-between px-4 py-2 hover:bg-background-secondary/80 transition-colors duration-200 {{ $view === $tab['view'] ? 'text-base font-semibold' : 'text-base/70' }}"
class="mobile-tab-item flex items-center justify-between {{ $view === $tab['view'] ? 'active text-base' : 'text-base/70' }}"
@click="open = false">
{{ $tab['label'] }}
<span>{{ $tab['label'] }}</span>
@if($view === $tab['view'])
<x-ri-check-line class="size-4 text-base" />
<x-ri-check-line class="size-4 text-primary" />
@endif
</a>
</div>