# ๐ŸŽฏ HEADER - Documentazione Completa NetGescon > **Componente Header dell'interfaccia universale** > **๐Ÿ“… Creato:** 21/07/2025 > **๐Ÿ”„ Ultimo aggiornamento:** 21/07/2025 > **๐ŸŽฏ Prioritร :** ๐Ÿ”ฅ CRITICA --- ## ๐Ÿ“‹ **OVERVIEW HEADER** Il Header NetGescon รจ il componente **FIXED TOP** che contiene: - ๐Ÿข **Logo e Brand** - ๐Ÿ” **Search Global** - ๐Ÿ“ข **Notifications** - ๐Ÿ‘ค **User Profile Menu** - ๐Ÿ“ฑ **Mobile Menu Toggle** ### ๐Ÿ“ **Specifiche Layout** - **Altezza:** `70px` fisso - **Posizione:** `fixed top-0` sempre visibile - **Z-index:** `1000` sopra tutti gli elementi - **Background:** Gradiente primario NetGescon --- ## ๐ŸŽจ **DESIGN SPECIFICATIONS** ### ๐ŸŒˆ **Color Palette** ```css /* Background Gradient */ background: linear-gradient(135deg, var(--netgescon-primary) 0%, var(--netgescon-primary-dark) 100% ); /* Hover States */ --hover-bg: rgba(255, 255, 255, 0.1); --active-bg: rgba(255, 255, 255, 0.2); ``` ### ๐Ÿ“ **Dimensions** ```css .netgescon-header { height: 70px; padding: 0 1.5rem; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; } ``` --- ## ๐Ÿงฉ **COMPONENTI HEADER** ### 1. **๐Ÿข LOGO & BRAND** ```blade
NetGescon
``` ### 2. **๐Ÿ” SEARCH GLOBAL** ```blade ``` ### 3. **๐Ÿ“ข NOTIFICATIONS** ```blade
``` ### 4. **๐Ÿ‘ค USER PROFILE** ```blade
``` ### 5. **๐Ÿ“ฑ MOBILE TOGGLE** ```blade ``` --- ## ๐Ÿ”ง **JAVASCRIPT FUNCTIONALITY** ### ๐Ÿ“ **File:** `/public/js/components/header.js` ```javascript /** * Header NetGescon - JavaScript Functions */ // Global Search function initializeGlobalSearch() { const searchInput = document.getElementById('global-search'); const searchResults = document.getElementById('search-results'); let searchTimeout; searchInput.addEventListener('input', function() { clearTimeout(searchTimeout); searchTimeout = setTimeout(() => { const query = this.value.trim(); if (query.length >= 2) { performGlobalSearch(query); } else { hideSearchResults(); } }, 300); }); } // Notifications function initializeNotifications() { const notificationToggle = document.querySelector('.notification-toggle'); const notificationDropdown = document.querySelector('.notifications-dropdown'); notificationToggle.addEventListener('click', function(e) { e.stopPropagation(); notificationDropdown.classList.toggle('hidden'); // Marca come lette markNotificationsAsRead(); }); // Chiudi click outside document.addEventListener('click', function() { notificationDropdown.classList.add('hidden'); }); } // User Menu function initializeUserMenu() { const userToggle = document.querySelector('.user-toggle'); const userDropdown = document.querySelector('.user-dropdown'); userToggle.addEventListener('click', function(e) { e.stopPropagation(); userDropdown.classList.toggle('hidden'); }); // Chiudi click outside document.addEventListener('click', function() { userDropdown.classList.add('hidden'); }); } // Mobile Menu function toggleMobileMenu() { const sidebar = document.querySelector('.netgescon-sidebar'); const overlay = document.querySelector('.mobile-overlay'); sidebar.classList.toggle('mobile-open'); if (!overlay) { createMobileOverlay(); } else { overlay.classList.toggle('hidden'); } } ``` --- ## ๐Ÿ“ฑ **RESPONSIVE BEHAVIOR** ### ๐Ÿ–ฅ๏ธ **Desktop (โ‰ฅ1024px)** - Logo completo con testo - Search bar visibile e funzionale - Tutti i componenti visibili - Dropdown menu posizionamento ottimale ### ๐Ÿ“ฑ **Tablet (768px - 1023px)** - Logo con testo ridotto - Search bar ridotta - Notifications e user menu compatti - Mobile toggle nascosto ### ๐Ÿ“ฑ **Mobile (โ‰ค767px)** - Solo logo icon - Search bar nascosta (disponibile in sidebar) - Notifications badge only - Mobile toggle visibile - User menu compatto ### ๐Ÿ“ **Breakpoints CSS** ```css /* Mobile First Approach */ .netgescon-header { /* Mobile styles di base */ } @media (min-width: 768px) { .netgescon-header { /* Tablet adjustments */ } } @media (min-width: 1024px) { .netgescon-header { /* Desktop full features */ } } ``` --- ## ๐Ÿ” **SECURITY & PERMISSIONS** ### ๐Ÿ›ก๏ธ **Authentication Required** ```blade @auth @else @endauth ``` ### ๐Ÿ‘ฅ **Role-Based Features** ```blade @can('admin-panel')
@endcan @if(auth()->user()->can('view-notifications')) @include('components.header.notifications') @endif ``` --- ## โšก **PERFORMANCE OPTIMIZATION** ### ๐Ÿš€ **Loading Strategy** 1. **CSS Critical** - Inline styles per header immediato 2. **JavaScript Lazy** - Load componenti on interaction 3. **Images Optimization** - SVG per logo, WebP per avatar 4. **Cache Strategy** - Headers cache-friendly ### ๐Ÿ“Š **Metrics Target** - **First Paint:** < 100ms - **Interactive:** < 200ms - **Smooth Animations:** 60fps - **Accessibility Score:** 100/100 --- ## ๐Ÿงช **TESTING CHECKLIST** ### โœ… **Functional Tests** - [ ] Logo click โ†’ Homepage redirect - [ ] Search โ†’ Results display - [ ] Notifications โ†’ Badge update - [ ] User menu โ†’ Profile access - [ ] Mobile toggle โ†’ Sidebar open/close ### โœ… **Visual Tests** - [ ] Header height consistent (70px) - [ ] Gradiente background correct - [ ] Icons alignment perfect - [ ] Responsive breakpoints working - [ ] Hover states smooth ### โœ… **Accessibility Tests** - [ ] Tab navigation working - [ ] Screen reader compatible - [ ] Color contrast WCAG AA - [ ] Keyboard shortcuts functional - [ ] Focus indicators visible --- ## ๐Ÿ› **COMMON ISSUES & FIXES** ### ๐Ÿšจ **Problema:** Header si sovrappone al contenuto **Causa:** Z-index conflicts o padding body mancante **Fix:** ```css body { padding-top: 70px; } .netgescon-header { z-index: 1000; } ``` ### ๐Ÿšจ **Problema:** Logo non carica su mobile **Causa:** Path immagine errato o dimensioni eccessive **Fix:** Verifica path e ottimizza SVG ### ๐Ÿšจ **Problema:** Search non funziona **Causa:** JavaScript non inizializzato o endpoint API mancante **Fix:** Verifica console errors e route API ### ๐Ÿšจ **Problema:** Dropdown fuori schermo **Causa:** Posizionamento absolute incorrect **Fix:** Usa libreria positioning come Popper.js --- ## ๐Ÿ“š **FILES CORRELATI** ### ๐ŸŽจ **Styles** - `/public/css/netgescon-admin.css` - Main styles - `/public/css/components/header.css` - Header specific ### ๐Ÿงฉ **Templates** - `/resources/views/components/layout/header.blade.php` - Main template - `/resources/views/components/header/` - Sub-components ### โšก **JavaScript** - `/public/js/netgescon-admin.js` - Main script - `/public/js/components/header.js` - Header specific ### ๐Ÿ–ผ๏ธ **Assets** - `/public/images/netgescon/logo-white.svg` - Logo principale - `/public/images/netgescon/logo-icon.svg` - Logo mobile - `/public/images/avatar-default.svg` - Avatar default --- ## ๐ŸŽฏ **NEXT STEPS** ### ๐Ÿ”ฎ **Planned Improvements** - [ ] **Voice Search** - Ricerca vocale - [ ] **Quick Actions** - Shortcut frequent actions - [ ] **Theme Switcher** - Dark/Light mode toggle - [ ] **Multi-language** - Selector lingua - [ ] **Advanced Notifications** - Real-time updates --- *๐Ÿ“ Documento mantenuto da: GitHub Copilot AI Assistant* *๐Ÿ”— Componente: Header NetGescon Interface v2.1.0*