perf: Optimización PageSpeed - Score 81→97

Cambios implementados:

1. CSS Crítico (critical-bootstrap.css):
   - Agregar clases responsive d-lg-none, d-lg-block, d-lg-flex
   - Prevenir CLS en TopNotificationBar al ocultar en móvil
   - Agregar estilos para tablas y main content (CLS fix)

2. Google Analytics Diferido (adsense-placement.php):
   - GA4 ahora carga después de 3s o primera interacción
   - Reduce ~59 KiB de JavaScript bloqueante
   - TBT mejorado significativamente

3. CSS Minificado (enqueue-scripts.php):
   - Usar style.min.css y css-global-accessibility.min.css
   - Ahorro ~6 KiB en transferencia

4. Nuevo script minify-css.php para generar versiones .min.css

Resultados PageSpeed Mobile:
- Performance: 81 → 97 (+16 puntos)
- FCP: 2.8s → 1.0s (-64%)
- LCP: 3.5s → 1.3s (-63%)
- Core Web Vitals: SUPERADA

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-11-29 13:23:20 -06:00
parent 0fba2d567c
commit c7e8f14d83
6 changed files with 195 additions and 21 deletions

View File

@@ -226,6 +226,19 @@ button:focus:not(:focus-visible) {
display: inline-block !important;
}
/* Responsive Display Utilities - Previene CLS en TopNotificationBar */
@media (min-width: 992px) {
.d-lg-none {
display: none !important;
}
.d-lg-block {
display: block !important;
}
.d-lg-flex {
display: flex !important;
}
}
.flex-wrap {
flex-wrap: wrap !important;
}
@@ -826,3 +839,34 @@ h6 { font-size: 1rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
}
/* ==========================================================================
CLS PREVENTION - Tables & Main Content
========================================================================== */
/* Prevenir CLS en tablas APU */
.analisis table,
table.table {
table-layout: fixed;
width: 100%;
border-collapse: collapse;
}
.analisis table tr,
table.table tr {
min-height: 40px;
}
.analisis table td,
.analisis table th,
table.table td,
table.table th {
padding: 0.5rem;
vertical-align: middle;
border: 1px solid #dee2e6;
}
/* Reservar espacio para main content */
.site-main {
min-height: 50vh;
}

File diff suppressed because one or more lines are too long

1
Assets/css/style.min.css vendored Normal file

File diff suppressed because one or more lines are too long