refactor[ frontend / components ]: aggiornamento UI globale, ottimizzazione header e gestione errori

Header: Rifatto il componente con menu mobile ed effetti di background.

Cleanup: Rimossi i componenti Hero e Services non più necessari.

Layout: Migliorata la struttura e lo stile della pagina Contacts.

Core: Implementata la gestione globale degli errori in main.js.

Styles: Aggiornati gli stili globali e le media queries per una migliore responsività.
This commit is contained in:
2026-05-06 23:05:17 +02:00
parent 575e2b4779
commit e3098d3004
25 changed files with 1426 additions and 565 deletions
+222 -25
View File
@@ -1,3 +1,7 @@
/* ============================================================
HEADER — struttura base
============================================================ */
.header {
position: fixed;
top: 0;
@@ -5,7 +9,18 @@
width: 100%;
z-index: 100;
transform: translateY(0);
transition: transform 0.28s ease;
transition: transform 0.3s ease, background-color 1s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, box-shadow 0.3s ease;
background-color: transparent;
backdrop-filter: blur(0px);
-webkit-backdrop-filter: blur(0px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0);
}
.header.with-bg {
background-color: var(--background-header);
backdrop-filter: blur(3px);
-webkit-backdrop-filter: blur(3px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.header.hidden {
@@ -13,15 +28,18 @@
}
.header-container {
max-width: 1000px;
margin: 0 auto;
padding: 0 20px;
margin: 0 var(--lateral-margin);
display: flex;
align-items: center;
height: var(--navbar-height);
justify-content: space-between;
}
.logo-img{
/* ============================================================
LOGO
============================================================ */
.logo-img {
width: 98px;
height: 70px;
margin-right: auto;
@@ -30,7 +48,7 @@
}
.logo-mask {
background-color: var(--text-color);
background-color: var(--primary-color);
-webkit-mask-image: url('/images/icons/logo-nero.svg');
-webkit-mask-repeat: no-repeat;
-webkit-mask-position: center;
@@ -45,18 +63,16 @@
transform: translateY(-1px);
}
/* ============================================================
NAV DESKTOP
============================================================ */
.nav {
display: flex;
gap: 30px;
margin: 0 auto;
}
.header-actions {
display: flex;
gap: 12px;
align-items: center;
}
.nav a {
text-decoration: none;
color: var(--text-color);
@@ -74,22 +90,203 @@
color: var(--primary-color);
}
/*Temporaneo*/
@media (max-width: 768px) {
.header-container {
flex-direction: column;
height: auto;
padding: 15px 20px;
/* ============================================================
HEADER ACTIONS (desktop)
============================================================ */
.header-actions {
display: flex;
gap: 12px;
align-items: center;
}
/* ============================================================
HAMBURGER BUTTON — icona SVG, niente span
============================================================ */
.hamburger {
display: none;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: transparent;
border: none;
cursor: pointer;
padding: 0;
color: var(--text-color);
flex-shrink: 0;
transition: color 0.2s;
}
.hamburger:hover {
color: var(--primary-color);
}
.hamburger svg {
display: block;
}
/* ============================================================
MENU MOBILE FULL-PAGE (sale dal basso)
============================================================ */
.mobile-menu {
position: fixed;
inset: 0;
z-index: 99;
background-color: var(--surface);
display: flex;
flex-direction: column;
justify-content: flex-end;
/* Nascosto: traslato completamente fuori dal basso */
transform: translateY(100%);
/* Transizione sempre attiva per animare sia l'apertura che la chiusura */
transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
/* Solo su mobile */
display: none;
}
.mobile-menu.open {
transform: translateY(0);
}
/* ============================================================
NAV INTERNA AL MENU MOBILE
============================================================ */
.mobile-menu-nav {
display: flex;
flex-direction: column;
padding: 0 1.5rem 32px;
}
.mobile-menu-nav a {
text-decoration: none;
color: var(--text-color);
font-family: 'IBM Plex Mono', monospace;
font-weight: 600;
font-size: clamp(2rem, 8vw, 3.5rem);
line-height: 1;
padding: 20px 0;
border-bottom: 2px solid var(--background-opaque);
transition: color 0.2s, padding-left 0.2s;
display: block;
}
.mobile-menu-nav a:first-child {
border-top: 2px solid var(--background-opaque);
}
.mobile-menu-nav a:hover,
.mobile-menu-nav a.active {
color: var(--primary-color);
padding-left: 12px;
}
/* ============================================================
FOOTER DEL MENU MOBILE (bottone contattaci)
============================================================ */
.mobile-menu-footer {
padding: 24px 1.5rem 40px;
border-top: 2px solid var(--background-opaque);
}
.mobile-menu-footer .button {
display: block;
width: 100%;
text-align: center;
}
/* ============================================================
MEDIA QUERIES
============================================================ */
/* —— Desktop grande (> 1280px) ————————————————————————————— */
@media (min-width: 1280px) {}
/* —— Desktop medio (1024px 1279px) ————————————————————— */
@media (min-width: 1024px) and (max-width: 1279px) {}
/* —— Tablet (768px 1023px): pannello laterale 50% ————————— */
@media (min-width: 768px) and (max-width: 1023px) {
.mobile-menu {
left: auto;
right: 0;
top: 0;
bottom: 0;
width: 50%;
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
border-left: 2px solid var(--background-opaque);
clip-path: inset(0 0 0 100%);
transition: clip-path 0.35s cubic-bezier(0.4, 0, 0.2, 1);
transform: none;
}
.nav {
gap: 15px;
width: 100%;
justify-content: center;
flex-wrap: wrap;
.mobile-menu.open {
clip-path: inset(0 0 0 0%);
transition: clip-path 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav a {
font-size: 14px;
.mobile-menu-nav a {
font-size: clamp(1.2rem, 3vw, 1.6rem);
padding: 16px 0;
}
}
/* —— Mobile (< 900px): attiva hamburger + menu full-page ——— */
@media (max-width: 900px) {
.header-container {
margin: 0 1.5rem;
}
/* Nasconde nav e bottone desktop */
.nav-desktop,
.header-actions {
display: none;
}
/* Mostra hamburger */
.hamburger {
display: flex;
}
/* Abilita il menu mobile (di default display:none) */
.mobile-menu {
display: flex;
}
}
/* —— Mobile piccolo (< 480px) ————————————————————————————— */
@media (max-width: 480px) {}
/* —— Mobile minimo (< 360px) —————————————————————————————— */
@media (max-width: 360px) {}
/* Touch / tap highlight & focus handling for mobile interaction
- disable native tap highlight which creates colored rectangles
- keep keyboard focus-visible outlines intact for accessibility
*/
.hamburger,
.mobile-menu a,
.mobile-menu .button,
.mobile-menu .button * {
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
user-select: none;
-webkit-touch-callout: none;
}
/* Hide focus ring for pointer/touch interactions but preserve for keyboard
users via :focus-visible (only remove when element is focused but not
focus-visible). */
.hamburger:focus:not(:focus-visible),
.mobile-menu a:focus:not(:focus-visible),
.mobile-menu .button:focus:not(:focus-visible) {
outline: none !important;
box-shadow: none !important;
}