# ๐ฏ 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
v2.1.0
```
### 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*