115 lines
4.4 KiB
PHP
115 lines
4.4 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="{{ auth()->check() && userSetting('dark_mode', 'false') === 'true' ? 'dark' : '' }}">
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
|
|
<title>{{ config('app.name', 'Laravel') }}</title>
|
|
|
|
<!-- Fonts -->
|
|
<link rel="preconnect" href="https://fonts.bunny.net">
|
|
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
|
|
|
<!-- FontAwesome -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
|
|
<!-- Custom CSS for dark mode -->
|
|
<link href="{{ asset('css/dark-mode.css') }}" rel="stylesheet">
|
|
|
|
<!-- Scripts -->
|
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
@livewireStyles
|
|
|
|
@php
|
|
// Impostazioni utente per colori personalizzati
|
|
$userBgColor = auth()->check() ? userSetting('bg_color', '#ffffff') : '#ffffff';
|
|
$userTextColor = auth()->check() ? userSetting('text_color', '#1e293b') : '#1e293b';
|
|
$userAccentColor = auth()->check() ? userSetting('accent_color', '#6366f1') : '#6366f1';
|
|
$userSidebarBg = auth()->check() ? userSetting('sidebar_bg_color', '#fde047') : '#fde047';
|
|
$userSidebarText = auth()->check() ? userSetting('sidebar_text_color', '#1e293b') : '#1e293b';
|
|
$userSidebarAccent = auth()->check() ? userSetting('sidebar_accent_color', '#6366f1') : '#6366f1';
|
|
@endphp
|
|
|
|
<style>
|
|
:root {
|
|
--user-bg-color: {{ $userBgColor }};
|
|
--user-text-color: {{ $userTextColor }};
|
|
--user-accent-color: {{ $userAccentColor }};
|
|
--user-sidebar-bg: {{ $userSidebarBg }};
|
|
--user-sidebar-text: {{ $userSidebarText }};
|
|
--user-sidebar-accent: {{ $userSidebarAccent }};
|
|
}
|
|
|
|
/* Applica automaticamente i colori personalizzati */
|
|
.bg-white { background-color: var(--user-bg-color) !important; }
|
|
.text-gray-900 { color: var(--user-text-color) !important; }
|
|
.bg-indigo-600 { background-color: var(--user-accent-color) !important; }
|
|
|
|
/* Sidebar responsive */
|
|
.sidebar {
|
|
width: 280px;
|
|
transition: all 0.3s ease;
|
|
}
|
|
.sidebar.collapsed {
|
|
width: 80px;
|
|
}
|
|
.sidebar.hidden {
|
|
margin-left: -280px;
|
|
}
|
|
@media (max-width: 768px) {
|
|
.sidebar {
|
|
position: fixed;
|
|
left: 0;
|
|
top: 0;
|
|
height: 100vh;
|
|
z-index: 1000;
|
|
}
|
|
.sidebar.hidden {
|
|
margin-left: -280px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="font-sans antialiased">
|
|
<div class="min-h-screen bg-gray-100 dark:bg-gray-900 flex">
|
|
<div id="sidebar" class="sidebar">
|
|
@include('components.menu.sidebar')
|
|
</div>
|
|
<div class="flex-1 flex flex-col">
|
|
@include('layouts.navigation')
|
|
|
|
<!-- Page Heading -->
|
|
@isset($header)
|
|
<header class="bg-white dark:bg-gray-800 shadow">
|
|
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
|
{{ $header }}
|
|
</div>
|
|
</header>
|
|
@endisset
|
|
|
|
<!-- Page Content -->
|
|
<main>
|
|
@yield('content')
|
|
</main>
|
|
</div>
|
|
</div>
|
|
@livewireScripts
|
|
|
|
<!-- Sidebar toggle script -->
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const sidebarToggle = document.getElementById('sidebar-toggle');
|
|
const sidebar = document.getElementById('sidebar');
|
|
|
|
if (sidebarToggle && sidebar) {
|
|
sidebarToggle.addEventListener('click', function() {
|
|
sidebar.classList.toggle('hidden');
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|