fix performance and new mobile menu

Signed-off-by: Rodrigo Bertoldo de Sousa Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
rodrigo committed 2026-02-22 16:46:43 -03:00
1 parent 989d7f0b98
commit 6904171303
4 files changed
+436 -142

No files matched your search

+189 -91
View File
@@ -46,6 +46,10 @@ body {
line-height: 1.6;
overflow-x: hidden;
transition: background 0.3s ease, color 0.3s ease;
/* Aceleração por hardware */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeSpeed;
}
/* Header */
@@ -56,6 +60,11 @@ body {
top: 0;
z-index: 999;
transition: all 0.3s ease;
/* Aceleração por hardware - sem transform para não quebrar position:fixed do menu mobile */
will-change: transform;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
contain: layout style paint;
}
/* Ajuste quando admin bar do WordPress está presente */
@@ -89,6 +98,9 @@ body.dark-mode .site-header {
max-height: 65px;
width: auto;
transition: all 0.3s ease;
/* Otimização de renderização */
image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges;
}
body.dark-mode .logo img {
@@ -119,6 +131,9 @@ body.dark-mode .logo img {
margin: 3px 0;
transition: all 0.3s ease;
border-radius: 3px;
/* Aceleração por hardware */
will-change: transform, opacity;
backface-visibility: hidden;
}
body.dark-mode .mobile-menu-toggle span {
@@ -194,6 +209,12 @@ body.dark-mode .main-nav a:hover {
color: var(--accent-gold);
}
/* Menu Mobile e Overlay - Hidden por padrão */
.mobile-nav,
.mobile-menu-overlay {
display: none;
}
/* Hero Section */
.hero-section {
background: linear-gradient(135deg, var(--primary-color) 0%, #16254f 100%);
@@ -295,6 +316,10 @@ body.dark-mode .hero-section {
transition: all 0.3s;
box-shadow: 0 4px 15px rgba(201, 169, 97, 0.3);
animation: fadeInUp 1s ease 0.6s both;
/* Aceleração por hardware */
will-change: transform, box-shadow;
transform: translateZ(0);
backface-visibility: hidden;
}
.cta-button:hover {
@@ -356,6 +381,11 @@ body.dark-mode .section-title {
cursor: pointer;
position: relative;
overflow: hidden;
/* Aceleração por hardware */
will-change: transform, box-shadow;
transform: translateZ(0);
backface-visibility: hidden;
contain: layout style paint;
}
.area-card::before {
@@ -514,6 +544,11 @@ body.dark-mode .equipe-section {
transition: all 0.4s ease;
display: flex;
flex-direction: column;
/* Aceleração por hardware */
will-change: transform, box-shadow;
transform: translateZ(0);
backface-visibility: hidden;
contain: layout style paint;
}
body.dark-mode .equipe-card {
@@ -712,6 +747,11 @@ body.dark-mode .post-card:hover {
overflow: hidden;
box-shadow: 0 5px 20px rgba(0,0,0,0.08);
transition: all 0.3s;
/* Aceleração por hardware */
will-change: transform, box-shadow;
transform: translateZ(0);
backface-visibility: hidden;
contain: layout style paint;
}
.post-card:hover {
@@ -723,6 +763,11 @@ body.dark-mode .post-card:hover {
width: 100%;
height: 200px;
object-fit: cover;
/* Otimização de renderização */
image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges;
will-change: transform;
backface-visibility: hidden;
}
.post-content {
@@ -1409,91 +1454,154 @@ body.dark-mode .post-content-single h4 {
display: flex !important;
}
/* Menu Mobile - Oculto por padrão */
.main-nav {
position: fixed;
top: 0;
right: -100%;
width: 75%;
max-width: 300px;
height: 100vh;
background: var(--secondary-color);
box-shadow: -5px 0 15px rgba(0,0,0,0.2);
transition: right 0.3s ease;
z-index: 99999;
overflow-y: auto;
/* Esconder navegação desktop no mobile */
.desktop-nav {
display: none !important;
}
body.dark-mode .main-nav {
background: #1f1f1f;
box-shadow: -5px 0 15px rgba(0,0,0,0.5);
}
/* Menu Mobile - Ativo */
.main-nav.active {
right: 0;
}
.main-nav ul {
flex-direction: column;
gap: 0;
padding: 5rem 0 2rem 0;
align-items: stretch;
}
.main-nav ul li {
width: 100%;
border-bottom: 1px solid rgba(0,0,0,0.05);
}
body.dark-mode .main-nav ul li {
border-bottom-color: rgba(255,255,255,0.1);
}
.main-nav a {
padding: 1rem 1.5rem;
display: flex;
align-items: center;
gap: 1rem;
width: 100%;
font-size: 1.1rem;
}
.main-nav a i {
display: inline-block !important;
font-size: 1.2rem;
width: 24px;
text-align: center;
}
.main-nav .theme-toggle-item {
margin-top: 1rem;
padding: 0 1.5rem;
}
.main-nav .theme-toggle {
width: 100%;
justify-content: flex-start;
padding: 1rem;
border-radius: 8px;
}
/* Overlay quando menu está aberto */
body.menu-open::before {
content: '';
/* Menu Mobile Overlay */
.mobile-menu-overlay {
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
z-index: 99998;
animation: fadeIn 0.3s ease;
background: rgba(0, 0, 0, 0.6);
opacity: 0;
visibility: hidden;
z-index: 9998;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
.mobile-menu-overlay.active {
opacity: 1;
visibility: visible;
}
/* Menu Mobile */
.mobile-nav {
display: block;
position: fixed;
top: 0;
right: 0;
width: 80%;
max-width: 320px;
height: 100vh;
background: var(--secondary-color);
box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
z-index: 9999;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
transform: translateX(100%);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
/* Performance */
will-change: transform;
}
body.dark-mode .mobile-nav {
background: #1a1a1a;
box-shadow: -5px 0 25px rgba(0, 0, 0, 0.8);
}
.mobile-nav.active {
transform: translateX(0);
}
/* Botão de fechar menu mobile */
.mobile-menu-close {
position: absolute;
top: 1rem;
right: 1rem;
background: none;
border: none;
color: var(--primary-color);
font-size: 1.8rem;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-radius: 50%;
transition: all 0.3s ease;
z-index: 10;
}
body.dark-mode .mobile-menu-close {
color: var(--accent-gold);
}
.mobile-menu-close:active {
background: rgba(0, 0, 0, 0.1);
transform: rotate(90deg);
}
body.dark-mode .mobile-menu-close:active {
background: rgba(255, 255, 255, 0.1);
}
.mobile-nav ul {
list-style: none;
padding: 5rem 0 2rem 0;
margin: 0;
}
.mobile-nav li {
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
body.dark-mode .mobile-nav li {
border-bottom-color: rgba(255, 255, 255, 0.1);
}
.mobile-nav a,
.mobile-nav .theme-toggle-btn {
display: flex;
align-items: center;
gap: 1rem;
padding: 1.2rem 1.5rem;
color: var(--primary-color);
text-decoration: none;
font-weight: 600;
font-size: 1.05rem;
transition: background 0.2s ease;
width: 100%;
border: none;
background: none;
cursor: pointer;
text-align: left;
}
body.dark-mode .mobile-nav a,
body.dark-mode .mobile-nav .theme-toggle-btn {
color: #e0e0e0;
}
.mobile-nav a:active,
.mobile-nav .theme-toggle-btn:active {
background: rgba(0, 0, 0, 0.05);
}
body.dark-mode .mobile-nav a:active,
body.dark-mode .mobile-nav .theme-toggle-btn:active {
background: rgba(255, 255, 255, 0.05);
}
.mobile-nav i {
font-size: 1.2rem;
width: 28px;
text-align: center;
color: var(--accent-gold);
}
.mobile-nav span {
flex: 1;
}
/* Prevenir scroll do body quando menu aberto */
body.menu-open {
overflow: hidden;
}
/* Conteúdo da página */
@@ -1893,23 +2001,13 @@ body.dark-mode .cookie-decline:hover {
/* Desktop - garantir que elementos mobile não apareçam */
@media (min-width: 769px) {
.mobile-menu-toggle {
.mobile-menu-toggle,
.mobile-nav,
.mobile-menu-overlay {
display: none !important;
}
.main-nav {
position: static !important;
width: auto !important;
height: auto !important;
background: transparent !important;
box-shadow: none !important;
}
.main-nav a i {
display: none !important;
}
.nav-text {
display: inline !important;
.desktop-nav {
display: block !important;
}
}