fix(structure): Rename assets and inc folders for Linux compatibility
- assets → Assets - inc → Inc Completes the case-sensitivity fixes for Linux servers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
6
Assets/css/bootstrap.min.css
vendored
Normal file
6
Assets/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
946
Assets/css/css-global-accessibility.css
Normal file
946
Assets/css/css-global-accessibility.css
Normal file
@@ -0,0 +1,946 @@
|
||||
/**
|
||||
* Accessibility Styles
|
||||
*
|
||||
* Enhanced accessibility styles including visible focus states,
|
||||
* screen reader utilities, and minimum touch targets.
|
||||
* Compliant with WCAG 2.1 Level AA standards.
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* ==========================================================================
|
||||
Focus Styles - Highly Visible
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Enhanced focus styles for better keyboard navigation
|
||||
* Using double outline for better visibility across different backgrounds
|
||||
*/
|
||||
*:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Remove default browser focus outline (we're replacing it with better one) */
|
||||
*:focus:not(:focus-visible) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Modern browsers that support :focus-visible */
|
||||
*:focus-visible {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
|
||||
}
|
||||
|
||||
/* Links */
|
||||
a:focus,
|
||||
a:focus-visible {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
button:focus,
|
||||
button:focus-visible,
|
||||
.button:focus,
|
||||
.button:focus-visible,
|
||||
input[type="submit"]:focus,
|
||||
input[type="submit"]:focus-visible,
|
||||
input[type="button"]:focus,
|
||||
input[type="button"]:focus-visible,
|
||||
input[type="reset"]:focus,
|
||||
input[type="reset"]:focus-visible {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
|
||||
}
|
||||
|
||||
/* Form inputs */
|
||||
input[type="text"]:focus,
|
||||
input[type="email"]:focus,
|
||||
input[type="url"]:focus,
|
||||
input[type="password"]:focus,
|
||||
input[type="search"]:focus,
|
||||
input[type="number"]:focus,
|
||||
input[type="tel"]:focus,
|
||||
input[type="range"]:focus,
|
||||
input[type="date"]:focus,
|
||||
input[type="month"]:focus,
|
||||
input[type="week"]:focus,
|
||||
input[type="time"]:focus,
|
||||
input[type="datetime"]:focus,
|
||||
input[type="datetime-local"]:focus,
|
||||
input[type="color"]:focus,
|
||||
textarea:focus,
|
||||
select:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 0;
|
||||
border-color: #0066cc;
|
||||
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
|
||||
}
|
||||
|
||||
/* Checkboxes and radio buttons */
|
||||
input[type="checkbox"]:focus,
|
||||
input[type="radio"]:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
|
||||
}
|
||||
|
||||
/* Navigation menu items */
|
||||
.main-navigation a:focus,
|
||||
.primary-menu a:focus,
|
||||
nav a:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
background-color: rgba(0, 102, 204, 0.1);
|
||||
}
|
||||
|
||||
/* Menu toggle button */
|
||||
.menu-toggle:focus,
|
||||
.mobile-menu-toggle:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Screen Reader Text Utilities
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Hide elements visually but keep them accessible to screen readers
|
||||
*/
|
||||
.screen-reader-text,
|
||||
.sr-only,
|
||||
.visually-hidden {
|
||||
position: absolute !important;
|
||||
width: 1px !important;
|
||||
height: 1px !important;
|
||||
padding: 0 !important;
|
||||
margin: -1px !important;
|
||||
overflow: hidden !important;
|
||||
clip: rect(0, 0, 0, 0) !important;
|
||||
white-space: nowrap !important;
|
||||
border: 0 !important;
|
||||
clip-path: inset(50%) !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make screen reader text visible on focus
|
||||
* Important for skip links and keyboard navigation
|
||||
*/
|
||||
.screen-reader-text:focus,
|
||||
.sr-only:focus,
|
||||
.visually-hidden:focus {
|
||||
position: fixed !important;
|
||||
top: 5px !important;
|
||||
left: 5px !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
padding: 15px 23px 14px !important;
|
||||
margin: 0 !important;
|
||||
background-color: #000 !important;
|
||||
color: #fff !important;
|
||||
font-size: 14px !important;
|
||||
font-weight: bold !important;
|
||||
line-height: normal !important;
|
||||
text-decoration: none !important;
|
||||
z-index: 100000 !important;
|
||||
clip: auto !important;
|
||||
clip-path: none !important;
|
||||
outline: 3px solid #0066cc !important;
|
||||
outline-offset: 2px !important;
|
||||
border-radius: 3px !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* Skip to content link
|
||||
*/
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
top: -40px;
|
||||
left: 0;
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
text-decoration: none;
|
||||
z-index: 100000;
|
||||
font-weight: bold;
|
||||
border-radius: 0 0 3px 0;
|
||||
transition: top 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
top: 0;
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Touch Targets - Minimum 44x44px
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Ensure all interactive elements meet WCAG 2.1 Level AAA
|
||||
* minimum touch target size of 44x44 pixels
|
||||
*/
|
||||
|
||||
/* Buttons */
|
||||
button,
|
||||
.button,
|
||||
input[type="submit"],
|
||||
input[type="button"],
|
||||
input[type="reset"],
|
||||
.wp-block-button__link {
|
||||
min-height: 44px;
|
||||
min-width: 44px;
|
||||
padding: 10px 20px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Links in navigation */
|
||||
.main-navigation a,
|
||||
.primary-menu a,
|
||||
.footer-navigation a,
|
||||
nav a {
|
||||
min-height: 44px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
/* Menu toggle buttons */
|
||||
.menu-toggle,
|
||||
.mobile-menu-toggle {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* Pagination links */
|
||||
.page-numbers,
|
||||
.pagination a,
|
||||
.posts-navigation a {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
/* Form inputs */
|
||||
input[type="text"],
|
||||
input[type="email"],
|
||||
input[type="url"],
|
||||
input[type="password"],
|
||||
input[type="search"],
|
||||
input[type="number"],
|
||||
input[type="tel"],
|
||||
textarea,
|
||||
select {
|
||||
min-height: 44px;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
/* Checkboxes and radio buttons */
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
min-width: 24px;
|
||||
min-height: 24px;
|
||||
margin: 10px; /* Add margin to reach 44px effective touch target */
|
||||
}
|
||||
|
||||
/* Links with small text need larger padding */
|
||||
.tags-list a,
|
||||
.category-badge {
|
||||
min-height: 44px;
|
||||
padding: 12px 16px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
High Contrast Mode Support
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Ensure elements remain visible in Windows High Contrast Mode
|
||||
*/
|
||||
@media (prefers-contrast: high) {
|
||||
button,
|
||||
a,
|
||||
.button {
|
||||
border: 2px solid currentColor;
|
||||
}
|
||||
|
||||
*:focus,
|
||||
*:focus-visible {
|
||||
outline: 3px solid;
|
||||
outline-offset: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Reduced Motion Support
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Respect user's preference for reduced motion
|
||||
* Remove animations for users who prefer reduced motion
|
||||
*/
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Color Contrast Enhancements
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Ensure text has sufficient color contrast
|
||||
* WCAG AA requires 4.5:1 for normal text, 3:1 for large text
|
||||
*/
|
||||
|
||||
/* Enhanced link contrast */
|
||||
a {
|
||||
color: #0056b3;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #003d82;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Error messages - high contrast red */
|
||||
.error,
|
||||
.error-message,
|
||||
.form-error {
|
||||
color: #c81e1e;
|
||||
background-color: #fef0f0;
|
||||
border: 2px solid #c81e1e;
|
||||
padding: 10px 15px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Success messages - high contrast green */
|
||||
.success,
|
||||
.success-message,
|
||||
.form-success {
|
||||
color: #1e7e34;
|
||||
background-color: #e8f5e9;
|
||||
border: 2px solid #1e7e34;
|
||||
padding: 10px 15px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Warning messages - high contrast yellow/orange */
|
||||
.warning,
|
||||
.warning-message,
|
||||
.form-warning {
|
||||
color: #856404;
|
||||
background-color: #fff3cd;
|
||||
border: 2px solid #856404;
|
||||
padding: 10px 15px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
ARIA Live Regions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Ensure live regions are properly announced
|
||||
*/
|
||||
[aria-live] {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
[aria-live="assertive"] {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Focus Management for Modals and Dialogs
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Trap focus within modals
|
||||
*/
|
||||
.modal[aria-modal="true"],
|
||||
.dialog[aria-modal="true"] {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 999999;
|
||||
}
|
||||
|
||||
/* Modal backdrop */
|
||||
.modal-backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.75);
|
||||
z-index: 999998;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Text Spacing and Readability
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Support for user text spacing preferences
|
||||
* WCAG 2.1 Level AA Success Criterion 1.4.12
|
||||
*/
|
||||
p,
|
||||
li,
|
||||
dd,
|
||||
dt {
|
||||
line-height: 1.6;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
line-height: 1.3;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
/* Allow text to be resized up to 200% without loss of content or functionality */
|
||||
html {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Table Accessibility
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Ensure tables are accessible
|
||||
*/
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
background-color: #f8f9fa;
|
||||
border: 1px solid #dee2e6;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
td {
|
||||
border: 1px solid #dee2e6;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
/* Add scope visually for screen readers */
|
||||
caption {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
padding: 10px 0;
|
||||
caption-side: top;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Print Accessibility
|
||||
========================================================================== */
|
||||
|
||||
@media print {
|
||||
/* Ensure focus styles don't print */
|
||||
*:focus {
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
/* Show link URLs in print */
|
||||
a[href]:after {
|
||||
content: " (" attr(href) ")";
|
||||
}
|
||||
|
||||
/* Don't show URLs for fragment links or javascript */
|
||||
a[href^="#"]:after,
|
||||
a[href^="javascript:"]:after {
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Navegación por Teclado - Menús Desplegables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Estilos para menús desplegables (dropdowns) con navegación por teclado
|
||||
* Asegura que los submenús sean accesibles y visibles durante la navegación
|
||||
*/
|
||||
|
||||
/* Submenú general */
|
||||
.navbar-nav .dropdown-menu,
|
||||
.primary-menu .sub-menu {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
/* Mostrar submenú cuando el padre tiene hover o focus */
|
||||
.navbar-nav .dropdown:hover > .dropdown-menu,
|
||||
.navbar-nav .dropdown:focus-within > .dropdown-menu,
|
||||
.primary-menu .menu-item:hover > .sub-menu,
|
||||
.primary-menu .menu-item:focus-within > .sub-menu {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Estilo del item de menú con submenú cuando recibe focus */
|
||||
.navbar-nav .dropdown > a:focus,
|
||||
.primary-menu .menu-item-has-children > a:focus {
|
||||
background-color: rgba(0, 102, 204, 0.1);
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Items de submenú con focus */
|
||||
.navbar-nav .dropdown-menu a:focus,
|
||||
.primary-menu .sub-menu a:focus {
|
||||
background-color: rgba(0, 102, 204, 0.15);
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: -2px;
|
||||
color: #003d82;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
ARIA Estados Visuales
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Estilos visuales para estados ARIA
|
||||
* Proporciona feedback visual para estados interactivos
|
||||
*/
|
||||
|
||||
/* Elementos expandidos/colapsados */
|
||||
[aria-expanded="true"] {
|
||||
/* Indicador visual de estado expandido */
|
||||
}
|
||||
|
||||
[aria-expanded="false"] {
|
||||
/* Indicador visual de estado colapsado */
|
||||
}
|
||||
|
||||
/* Elementos ocultos pero presentes en el DOM */
|
||||
[aria-hidden="true"] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Elementos deshabilitados */
|
||||
[aria-disabled="true"],
|
||||
[disabled] {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Elementos seleccionados en menús */
|
||||
[aria-current="page"],
|
||||
.current-menu-item > a,
|
||||
.current_page_item > a {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 2px;
|
||||
text-underline-offset: 4px;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Indicadores de Estado de Carga (Loading)
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Estilos para indicadores de carga accesibles
|
||||
*/
|
||||
.loading,
|
||||
[aria-busy="true"] {
|
||||
position: relative;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.loading::after,
|
||||
[aria-busy="true"]::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: -10px 0 0 -10px;
|
||||
border: 2px solid #f3f3f3;
|
||||
border-top: 2px solid #0066cc;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* Respetar preferencia de movimiento reducido */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.loading::after,
|
||||
[aria-busy="true"]::after {
|
||||
animation: none;
|
||||
border-top-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Mejoras para Formularios Accesibles
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Mejoras adicionales para formularios accesibles
|
||||
*/
|
||||
|
||||
/* Labels obligatorios con indicador visual */
|
||||
label.required::after,
|
||||
label[required]::after {
|
||||
content: " *";
|
||||
color: #c81e1e;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Focus en inputs con error */
|
||||
input:invalid:focus,
|
||||
textarea:invalid:focus,
|
||||
select:invalid:focus {
|
||||
border-color: #c81e1e;
|
||||
outline-color: #c81e1e;
|
||||
box-shadow: 0 0 0 3px rgba(200, 30, 30, 0.2);
|
||||
}
|
||||
|
||||
/* Estados de validación descriptivos */
|
||||
input:valid:not(:placeholder-shown),
|
||||
textarea:valid:not(:placeholder-shown),
|
||||
select:valid {
|
||||
border-color: #1e7e34;
|
||||
}
|
||||
|
||||
/* Mensajes de ayuda descriptivos */
|
||||
.form-help,
|
||||
.field-description,
|
||||
[role="tooltip"] {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-top: 4px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
TOC (Table of Contents) Accesibilidad
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Mejoras de accesibilidad para Tabla de Contenidos
|
||||
*/
|
||||
|
||||
/* Links del TOC con focus visible */
|
||||
.roi-toc a:focus,
|
||||
.toc-link:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
background-color: rgba(0, 102, 204, 0.1);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Item activo del TOC */
|
||||
.roi-toc a.active,
|
||||
.toc-link.active {
|
||||
font-weight: bold;
|
||||
border-left: 4px solid #0066cc;
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
/* Botón toggle del TOC con ARIA */
|
||||
.roi-toc-toggle[aria-expanded="true"]::before {
|
||||
content: "▼ ";
|
||||
}
|
||||
|
||||
.roi-toc-toggle[aria-expanded="false"]::before {
|
||||
content: "▶ ";
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Enlaces con Iconos - Accesibilidad
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Asegurar que los enlaces con solo iconos tengan texto descriptivo
|
||||
*/
|
||||
|
||||
/* Enlaces con iconos deben tener aria-label */
|
||||
a[aria-label] {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Iconos decorativos en enlaces */
|
||||
a .icon[aria-hidden="true"],
|
||||
a .dashicons[aria-hidden="true"],
|
||||
a .fa[aria-hidden="true"] {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Enlaces sociales con solo iconos */
|
||||
.social-links a:focus,
|
||||
.social-menu a:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 4px;
|
||||
box-shadow: 0 0 0 6px rgba(0, 102, 204, 0.2);
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Paginación Accesible
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Mejoras para navegación de paginación
|
||||
*/
|
||||
|
||||
.pagination,
|
||||
.nav-links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.pagination a,
|
||||
.nav-links a,
|
||||
.page-numbers {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 10px 15px;
|
||||
border: 2px solid #dee2e6;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
color: #0056b3;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.pagination a:hover,
|
||||
.nav-links a:hover,
|
||||
.page-numbers:hover {
|
||||
background-color: #f8f9fa;
|
||||
border-color: #0066cc;
|
||||
}
|
||||
|
||||
.pagination a:focus,
|
||||
.nav-links a:focus,
|
||||
.page-numbers:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
|
||||
border-color: #0066cc;
|
||||
background-color: rgba(0, 102, 204, 0.1);
|
||||
}
|
||||
|
||||
/* Página actual */
|
||||
.pagination .current,
|
||||
.page-numbers.current,
|
||||
.nav-links .current {
|
||||
background-color: #0066cc;
|
||||
color: #fff;
|
||||
border-color: #0066cc;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Breadcrumbs Accesibles
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Estilos para breadcrumbs (migas de pan) accesibles
|
||||
*/
|
||||
|
||||
.breadcrumbs,
|
||||
[aria-label="Breadcrumb"] {
|
||||
padding: 10px 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.breadcrumbs a:focus {
|
||||
outline: 3px solid #0066cc;
|
||||
outline-offset: 2px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.breadcrumbs [aria-current="page"] {
|
||||
color: #666;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Contraste de Color Mejorado (WCAG AA)
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Asegurar que todos los colores cumplan con ratio 4.5:1 para texto normal
|
||||
* y 3:1 para texto grande (18pt o 14pt bold)
|
||||
*/
|
||||
|
||||
/* Texto en fondos claros */
|
||||
body {
|
||||
color: #212529;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* Enlaces con contraste suficiente */
|
||||
a {
|
||||
color: #0056b3; /* Ratio 4.89:1 en fondo blanco */
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #003d82; /* Ratio 7.33:1 en fondo blanco */
|
||||
}
|
||||
|
||||
/* Texto en gris debe tener suficiente contraste */
|
||||
.text-muted,
|
||||
.meta-info,
|
||||
.entry-meta {
|
||||
color: #495057; /* Ratio 7.0:1 en fondo blanco */
|
||||
}
|
||||
|
||||
/* Placeholders en inputs */
|
||||
::placeholder {
|
||||
color: #6c757d; /* Ratio 4.54:1 en fondo blanco */
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Botones secundarios con borde */
|
||||
.btn-outline-primary,
|
||||
.button-outline {
|
||||
color: #0056b3;
|
||||
border-color: #0056b3;
|
||||
}
|
||||
|
||||
.btn-outline-primary:hover,
|
||||
.button-outline:hover {
|
||||
background-color: #0056b3;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Modo de Alto Contraste Mejorado
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Mejoras adicionales para modo de alto contraste
|
||||
*/
|
||||
@media (prefers-contrast: high) {
|
||||
/* Aumentar contraste de bordes */
|
||||
button,
|
||||
input,
|
||||
textarea,
|
||||
select {
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
/* Eliminar efectos de sombra que reducen contraste */
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
text-shadow: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
/* Focus aún más visible */
|
||||
*:focus,
|
||||
*:focus-visible {
|
||||
outline-width: 4px;
|
||||
outline-offset: 4px;
|
||||
}
|
||||
|
||||
/* Fondo de navegación más contrastante */
|
||||
.navbar,
|
||||
.site-header {
|
||||
border-bottom: 3px solid currentColor;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Zoom de Texto y Escalado
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Asegurar que el texto se pueda escalar hasta 200% sin pérdida de contenido
|
||||
* WCAG 2.1 Success Criterion 1.4.4
|
||||
*/
|
||||
|
||||
/* Usar unidades relativas */
|
||||
html {
|
||||
font-size: 100%; /* Base 16px */
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 1rem; /* 16px */
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Evitar anchos fijos en contenedores de texto */
|
||||
.entry-content,
|
||||
.content-area {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Permitir que las imágenes se redimensionen */
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Animaciones Respetuosas
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Deshabilitar animaciones automáticas que puedan causar mareos
|
||||
* WCAG 2.1 Success Criterion 2.3.3
|
||||
*/
|
||||
|
||||
/* No usar animaciones infinitas que parpadeen */
|
||||
@keyframes fade-in {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
/* Limitar duración de animaciones */
|
||||
.animate {
|
||||
animation-duration: 0.3s;
|
||||
animation-timing-function: ease-in-out;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Fin del archivo
|
||||
========================================================================== */
|
||||
677
Assets/css/css-global-animations.css
Normal file
677
Assets/css/css-global-animations.css
Normal file
@@ -0,0 +1,677 @@
|
||||
/**
|
||||
* Animation Styles
|
||||
*
|
||||
* CSS animations and keyframes for the theme
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* Fade animations */
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeOut {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeInDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, -100%, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 100%, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeInLeft {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeInRight {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Slide animations */
|
||||
@keyframes slideDown {
|
||||
from {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideLeft {
|
||||
from {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideRight {
|
||||
from {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Zoom animations */
|
||||
@keyframes zoomIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale3d(0.3, 0.3, 0.3);
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes zoomOut {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 0;
|
||||
transform: scale3d(0.3, 0.3, 0.3);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes zoomInDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, -100%, 0) scale3d(0.5, 0.5, 0.5);
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes zoomInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 100%, 0) scale3d(0.5, 0.5, 0.5);
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Bounce animations */
|
||||
@keyframes bounce {
|
||||
0%,
|
||||
100% {
|
||||
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
45% {
|
||||
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
|
||||
transform: translate3d(0, -30px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes bounceIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale3d(0.3, 0.3, 0.3);
|
||||
}
|
||||
|
||||
20% {
|
||||
opacity: 1;
|
||||
transform: scale3d(1.1, 1.1, 1.1);
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: scale3d(0.9, 0.9, 0.9);
|
||||
}
|
||||
|
||||
60% {
|
||||
opacity: 1;
|
||||
transform: scale3d(1.03, 1.03, 1.03);
|
||||
}
|
||||
|
||||
80% {
|
||||
transform: scale3d(0.97, 0.97, 0.97);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale3d(1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes bounceInDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, -100%, 0);
|
||||
}
|
||||
|
||||
60% {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 25px, 0);
|
||||
}
|
||||
|
||||
75% {
|
||||
transform: translate3d(0, -10px, 0);
|
||||
}
|
||||
|
||||
90% {
|
||||
transform: translate3d(0, 5px, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes bounceInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 100%, 0);
|
||||
}
|
||||
|
||||
60% {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, -25px, 0);
|
||||
}
|
||||
|
||||
75% {
|
||||
transform: translate3d(0, 10px, 0);
|
||||
}
|
||||
|
||||
90% {
|
||||
transform: translate3d(0, -5px, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Rotate animations */
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotateIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: rotate3d(0, 0, 1, -200deg);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotateOut {
|
||||
from {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: rotate3d(0, 0, 1, 200deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Flip animations */
|
||||
@keyframes flip {
|
||||
from {
|
||||
transform: perspective(400px) rotate3d(0, 1, 0, -360deg);
|
||||
animation-timing-function: ease-out;
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: perspective(400px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes flipInX {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: perspective(400px) rotate3d(1, 0, 0, -10deg);
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: perspective(400px) rotate3d(1, 0, 0, 5deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: perspective(400px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes flipInY {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: perspective(400px) rotate3d(0, 1, 0, -10deg);
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: perspective(400px) rotate3d(0, 1, 0, 5deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: perspective(400px);
|
||||
}
|
||||
}
|
||||
|
||||
/* Pulse animation */
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Heartbeat animation */
|
||||
@keyframes heartbeat {
|
||||
0%,
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
14% {
|
||||
transform: scale(1.15);
|
||||
}
|
||||
|
||||
28% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
42% {
|
||||
transform: scale(1.15);
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Shake animation */
|
||||
@keyframes shake {
|
||||
0%,
|
||||
100% {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
10%,
|
||||
20% {
|
||||
transform: translate3d(-10px, 0, 0);
|
||||
}
|
||||
|
||||
30%,
|
||||
50%,
|
||||
70%,
|
||||
90% {
|
||||
transform: translate3d(10px, 0, 0);
|
||||
}
|
||||
|
||||
40%,
|
||||
60%,
|
||||
80% {
|
||||
transform: translate3d(-10px, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Swing animation */
|
||||
@keyframes swing {
|
||||
20% {
|
||||
transform: rotate(15deg);
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: rotate(-10deg);
|
||||
}
|
||||
|
||||
60% {
|
||||
transform: rotate(5deg);
|
||||
}
|
||||
|
||||
80% {
|
||||
transform: rotate(-5deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Wobble animation */
|
||||
@keyframes wobble {
|
||||
0% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
15% {
|
||||
transform: translateX(-25px) rotate(-5deg);
|
||||
}
|
||||
|
||||
30% {
|
||||
transform: translateX(20px) rotate(3deg);
|
||||
}
|
||||
|
||||
45% {
|
||||
transform: translateX(-15px) rotate(-3deg);
|
||||
}
|
||||
|
||||
60% {
|
||||
transform: translateX(10px) rotate(2deg);
|
||||
}
|
||||
|
||||
75% {
|
||||
transform: translateX(-5px) rotate(-1deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Jello animation */
|
||||
@keyframes jello {
|
||||
0%,
|
||||
11.1%,
|
||||
100% {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
22.2% {
|
||||
transform: skewX(-12.5deg) skewY(-12.5deg);
|
||||
}
|
||||
|
||||
33.3% {
|
||||
transform: skewX(6.25deg) skewY(6.25deg);
|
||||
}
|
||||
|
||||
44.4% {
|
||||
transform: skewX(-3.125deg) skewY(-3.125deg);
|
||||
}
|
||||
|
||||
55.5% {
|
||||
transform: skewX(1.5625deg) skewY(1.5625deg);
|
||||
}
|
||||
|
||||
66.6% {
|
||||
transform: skewX(-0.78125deg) skewY(-0.78125deg);
|
||||
}
|
||||
|
||||
77.7% {
|
||||
transform: skewX(0.390625deg) skewY(0.390625deg);
|
||||
}
|
||||
|
||||
88.8% {
|
||||
transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Loading spinner */
|
||||
@keyframes spinner {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Utility animation classes */
|
||||
.animate-fade-in {
|
||||
animation: fadeIn 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.animate-fade-out {
|
||||
animation: fadeOut 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.animate-fade-in-down {
|
||||
animation: fadeInDown 0.6s ease-out;
|
||||
}
|
||||
|
||||
.animate-fade-in-up {
|
||||
animation: fadeInUp 0.6s ease-out;
|
||||
}
|
||||
|
||||
.animate-fade-in-left {
|
||||
animation: fadeInLeft 0.6s ease-out;
|
||||
}
|
||||
|
||||
.animate-fade-in-right {
|
||||
animation: fadeInRight 0.6s ease-out;
|
||||
}
|
||||
|
||||
.animate-slide-down {
|
||||
animation: slideDown 0.4s ease-out;
|
||||
}
|
||||
|
||||
.animate-slide-up {
|
||||
animation: slideUp 0.4s ease-out;
|
||||
}
|
||||
|
||||
.animate-slide-left {
|
||||
animation: slideLeft 0.4s ease-out;
|
||||
}
|
||||
|
||||
.animate-slide-right {
|
||||
animation: slideRight 0.4s ease-out;
|
||||
}
|
||||
|
||||
.animate-zoom-in {
|
||||
animation: zoomIn 0.5s ease-out;
|
||||
}
|
||||
|
||||
.animate-zoom-out {
|
||||
animation: zoomOut 0.5s ease-out;
|
||||
}
|
||||
|
||||
.animate-bounce {
|
||||
animation: bounce 1s infinite;
|
||||
}
|
||||
|
||||
.animate-bounce-in {
|
||||
animation: bounceIn 0.6s;
|
||||
}
|
||||
|
||||
.animate-bounce-in-down {
|
||||
animation: bounceInDown 0.6s;
|
||||
}
|
||||
|
||||
.animate-bounce-in-up {
|
||||
animation: bounceInUp 0.6s;
|
||||
}
|
||||
|
||||
.animate-rotate {
|
||||
animation: rotate 2s linear infinite;
|
||||
}
|
||||
|
||||
.animate-rotate-in {
|
||||
animation: rotateIn 0.6s ease-out;
|
||||
}
|
||||
|
||||
.animate-rotate-out {
|
||||
animation: rotateOut 0.6s ease-out;
|
||||
}
|
||||
|
||||
.animate-flip {
|
||||
animation: flip 0.6s;
|
||||
}
|
||||
|
||||
.animate-flip-in-x {
|
||||
animation: flipInX 0.6s;
|
||||
}
|
||||
|
||||
.animate-flip-in-y {
|
||||
animation: flipInY 0.6s;
|
||||
}
|
||||
|
||||
.animate-pulse {
|
||||
animation: pulse 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.animate-heartbeat {
|
||||
animation: heartbeat 1.3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.animate-shake {
|
||||
animation: shake 0.5s;
|
||||
}
|
||||
|
||||
.animate-swing {
|
||||
animation: swing 0.6s;
|
||||
}
|
||||
|
||||
.animate-wobble {
|
||||
animation: wobble 0.8s;
|
||||
}
|
||||
|
||||
.animate-jello {
|
||||
animation: jello 0.9s;
|
||||
}
|
||||
|
||||
.animate-spinner {
|
||||
animation: spinner 1s linear infinite;
|
||||
}
|
||||
|
||||
/* Animation delay classes */
|
||||
.animate-delay-1 {
|
||||
animation-delay: 0.1s;
|
||||
}
|
||||
|
||||
.animate-delay-2 {
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
|
||||
.animate-delay-3 {
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
|
||||
.animate-delay-4 {
|
||||
animation-delay: 0.4s;
|
||||
}
|
||||
|
||||
.animate-delay-5 {
|
||||
animation-delay: 0.5s;
|
||||
}
|
||||
|
||||
/* Animation duration classes */
|
||||
.animate-duration-fast {
|
||||
animation-duration: 0.3s;
|
||||
}
|
||||
|
||||
.animate-duration-normal {
|
||||
animation-duration: 0.6s;
|
||||
}
|
||||
|
||||
.animate-duration-slow {
|
||||
animation-duration: 1s;
|
||||
}
|
||||
|
||||
.animate-duration-slower {
|
||||
animation-duration: 1.5s;
|
||||
}
|
||||
11
Assets/css/css-global-badges.css
Normal file
11
Assets/css/css-global-badges.css
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Badges Styles
|
||||
*
|
||||
* NOTA: Todos los estilos de badges están en style.css según template original.
|
||||
* Este archivo se mantiene vacío para evitar duplicaciones.
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* Los estilos de .category-badge están en style.css líneas 826-848 */
|
||||
197
Assets/css/css-global-fonts.css
Normal file
197
Assets/css/css-global-fonts.css
Normal file
@@ -0,0 +1,197 @@
|
||||
/**
|
||||
* Sistema de Tipografías - ROI Theme
|
||||
*
|
||||
* RESPONSABILIDAD: SOLO definición de fuentes y variables tipográficas
|
||||
* - Declaraciones @font-face (comentadas - usar Google Fonts)
|
||||
* - Variables CSS de tipografía (:root)
|
||||
* - Clases utilitarias de fuentes
|
||||
*
|
||||
* NO debe contener:
|
||||
* - Estilos de body (van en style.css)
|
||||
* - Estilos de elementos HTML (van en style.css)
|
||||
* - Variables de colores o espaciados (van en variables.css)
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* ============================================
|
||||
SYSTEM FONTS (Por defecto - Recomendado)
|
||||
============================================ */
|
||||
|
||||
:root {
|
||||
/* Stack de fuentes del sistema - Fallback */
|
||||
--font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
|
||||
|
||||
/* Fuente primaria - Poppins según template y documentación */
|
||||
--font-primary: 'Poppins', sans-serif;
|
||||
|
||||
/* Fuente para encabezados - Poppins según template */
|
||||
--font-headings: 'Poppins', sans-serif;
|
||||
|
||||
/* Fuente para código (monospace) */
|
||||
--font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono',
|
||||
Consolas, 'Courier New', monospace;
|
||||
|
||||
/* Tamaños de fuente base */
|
||||
--font-size-base: 16px;
|
||||
--line-height-base: 1.6;
|
||||
}
|
||||
|
||||
/* ELIMINADO: body, code, pre (movidos a style.css)
|
||||
* Este archivo SOLO debe contener variables y @font-face
|
||||
* Los estilos de elementos HTML van en style.css
|
||||
*/
|
||||
|
||||
/* ============================================
|
||||
POPPINS (Self-hosted)
|
||||
============================================
|
||||
|
||||
Fuentes Poppins alojadas localmente para:
|
||||
- Eliminar dependencia de Google Fonts
|
||||
- Mejorar rendimiento (sin requests externos)
|
||||
- Cumplimiento GDPR (sin tracking de Google)
|
||||
|
||||
Pesos incluidos: 400, 500, 600, 700
|
||||
Formato: WOFF2 (mejor compresión)
|
||||
|
||||
============================================ */
|
||||
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('../fonts/poppins-v24-latin-regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('../fonts/poppins-v24-latin-500.woff2') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('../fonts/poppins-v24-latin-600.woff2') format('woff2');
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('../fonts/poppins-v24-latin-700.woff2') format('woff2');
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
UTILIDADES DE FUENTES
|
||||
============================================ */
|
||||
|
||||
/* Font Weight Utilities */
|
||||
.font-light { font-weight: 300; }
|
||||
.font-regular { font-weight: 400; }
|
||||
.font-medium { font-weight: 500; }
|
||||
.font-semibold { font-weight: 600; }
|
||||
.font-bold { font-weight: 700; }
|
||||
|
||||
/* Font Family Utilities */
|
||||
.font-system {
|
||||
font-family: var(--font-system) !important;
|
||||
}
|
||||
|
||||
.font-mono {
|
||||
font-family: var(--font-mono) !important;
|
||||
}
|
||||
|
||||
/* Font Size Utilities */
|
||||
.text-xs { font-size: 0.75rem; line-height: 1.4; } /* 12px */
|
||||
.text-sm { font-size: 0.875rem; line-height: 1.5; } /* 14px */
|
||||
.text-base { font-size: 1rem; line-height: 1.6; } /* 16px */
|
||||
.text-lg { font-size: 1.125rem; line-height: 1.6; } /* 18px */
|
||||
.text-xl { font-size: 1.25rem; line-height: 1.5; } /* 20px */
|
||||
.text-2xl { font-size: 1.5rem; line-height: 1.4; } /* 24px */
|
||||
.text-3xl { font-size: 1.875rem; line-height: 1.3; } /* 30px */
|
||||
.text-4xl { font-size: 2.25rem; line-height: 1.2; } /* 36px */
|
||||
.text-5xl { font-size: 3rem; line-height: 1.1; } /* 48px */
|
||||
|
||||
/* Line Height Utilities */
|
||||
.leading-none { line-height: 1; }
|
||||
.leading-tight { line-height: 1.25; }
|
||||
.leading-snug { line-height: 1.375; }
|
||||
.leading-normal { line-height: 1.5; }
|
||||
.leading-relaxed { line-height: 1.625; }
|
||||
.leading-loose { line-height: 2; }
|
||||
|
||||
/* Text Transform */
|
||||
.uppercase { text-transform: uppercase; }
|
||||
.lowercase { text-transform: lowercase; }
|
||||
.capitalize { text-transform: capitalize; }
|
||||
.normal-case { text-transform: none; }
|
||||
|
||||
/* Font Smoothing */
|
||||
.text-smooth,
|
||||
.antialiased {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.subpixel-antialiased {
|
||||
-webkit-font-smoothing: auto;
|
||||
-moz-osx-font-smoothing: auto;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
RESPONSIVE FONT SIZES
|
||||
============================================ */
|
||||
|
||||
/* Móviles (< 768px) */
|
||||
@media (max-width: 767px) {
|
||||
:root {
|
||||
--font-size-base: 15px;
|
||||
}
|
||||
|
||||
/* ELIMINADO: h1-h6 responsive - Template usa Bootstrap defaults */
|
||||
}
|
||||
|
||||
/* Tablets (768px - 1024px) */
|
||||
@media (min-width: 768px) and (max-width: 1024px) {
|
||||
:root {
|
||||
--font-size-base: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Desktop (> 1024px) */
|
||||
@media (min-width: 1025px) {
|
||||
:root {
|
||||
--font-size-base: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
PERFORMANCE NOTES
|
||||
============================================
|
||||
|
||||
System Fonts Benefits:
|
||||
✅ 0 HTTP requests (fuentes ya en el sistema)
|
||||
✅ 0 KB descargados (mejora LCP)
|
||||
✅ Sin FOIT/FOUT (sin parpadeo de texto)
|
||||
✅ Mejor Core Web Vitals
|
||||
✅ Familiar para usuarios (fuentes nativas)
|
||||
|
||||
Custom Fonts (Poppins):
|
||||
⚠️ Requiere descarga (~30-50 KB por peso)
|
||||
⚠️ Impacto en LCP si no se optimiza
|
||||
✅ Branding consistente
|
||||
✅ Diseño específico del template
|
||||
|
||||
Recomendación: Mantener system fonts por defecto.
|
||||
Solo activar Poppins si el branding lo requiere.
|
||||
|
||||
============================================ */
|
||||
276
Assets/css/css-global-generic-tables.css
Normal file
276
Assets/css/css-global-generic-tables.css
Normal file
@@ -0,0 +1,276 @@
|
||||
/**
|
||||
* Generic Tables Styles
|
||||
*
|
||||
* Estilos para tablas genéricas en post-content (NO tablas APU)
|
||||
* Aplica 10 estilos diferentes automáticamente a las primeras 11 tablas
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* ========================================
|
||||
BASE STYLES - Todas las tablas genéricas
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table) {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 2rem auto;
|
||||
font-size: 0.95rem;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Header styles - VERY OBVIOUS */
|
||||
.post-content table:not(.analisis table) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table) tr:first-child td {
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
padding: 1.25rem 1rem;
|
||||
font-size: 1.05rem;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
/* Body cells */
|
||||
.post-content table:not(.analisis table) tbody tr:not(:first-child) td {
|
||||
padding: 0.875rem 1rem;
|
||||
border: 1px solid var(--color-neutral-100);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 1: Navy Header with Orange Accent
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(2) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(2) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(2) tr:first-child td {
|
||||
background: linear-gradient(135deg, var(--color-navy-primary) 0%, var(--color-navy-light) 100%);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(2) tbody tr:nth-child(even) {
|
||||
background-color: var(--color-neutral-50);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(2) tbody tr:hover {
|
||||
background-color: rgba(255, 133, 0, 0.05);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 2: Orange Header with Light Background
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(3) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(3) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(3) tr:first-child td {
|
||||
background: var(--color-orange-primary);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
box-shadow: 0 2px 8px rgba(255, 133, 0, 0.3);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(3) tbody tr:nth-child(odd) {
|
||||
background-color: rgba(255, 133, 0, 0.05);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(3) tbody tr:hover {
|
||||
background-color: rgba(255, 133, 0, 0.1);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 3: Minimal with Left Orange Border
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(4) {
|
||||
border-left: 5px solid var(--color-orange-primary);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(4) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(4) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(4) tr:first-child td {
|
||||
background: var(--color-navy-primary);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
border-bottom: 3px solid var(--color-orange-primary) !important;
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(4) tbody tr:hover {
|
||||
background-color: var(--color-neutral-50);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 4: Dark Navy with Striped Rows
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(5) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(5) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(5) tr:first-child td {
|
||||
background: var(--color-navy-dark);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
box-shadow: 0 2px 8px rgba(14, 35, 55, 0.4);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(5) tbody tr:nth-child(even) {
|
||||
background-color: rgba(30, 58, 95, 0.05);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(5) tbody tr:hover {
|
||||
background-color: rgba(30, 58, 95, 0.1);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 5: Orange Gradient Header
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(6) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(6) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(6) tr:first-child td {
|
||||
background: linear-gradient(135deg, var(--color-orange-primary) 0%, var(--color-orange-light) 100%);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
box-shadow: 0 2px 8px rgba(255, 133, 0, 0.35);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(6) tbody tr {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(6) tbody tr:hover {
|
||||
background-color: rgba(255, 133, 0, 0.08);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 6: Bordered with Navy Accents
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(7) {
|
||||
border: 3px solid var(--color-navy-primary);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(7) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(7) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(7) tr:first-child td {
|
||||
background: var(--color-navy-primary);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
border-bottom: 4px solid var(--color-orange-primary) !important;
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(7) tbody tr:nth-child(odd) {
|
||||
background-color: rgba(30, 58, 95, 0.03);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 7: Light Orange Background
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(8) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(8) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(8) tr:first-child td {
|
||||
background: var(--color-orange-primary);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
border-bottom: 3px solid var(--color-navy-primary) !important;
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(8) tbody tr:nth-child(even) {
|
||||
background-color: rgba(255, 133, 0, 0.03);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(8) tbody tr:hover {
|
||||
background-color: rgba(255, 133, 0, 0.08);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 8: Modern Flat with Top Border
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(9) {
|
||||
border-top: 6px solid var(--color-orange-primary);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(9) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(9) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(9) tr:first-child td {
|
||||
background: var(--color-navy-light);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
box-shadow: 0 2px 6px rgba(44, 82, 130, 0.3);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(9) tbody tr {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(9) tbody tr:hover {
|
||||
background-color: var(--color-neutral-50);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 9: Compact with Subtle Colors
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(10) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(10) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(10) tr:first-child td {
|
||||
background: var(--color-navy-dark);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
border-left: 5px solid var(--color-orange-primary) !important;
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(10) tbody tr:nth-child(odd) {
|
||||
background-color: var(--color-neutral-50);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(10) tbody tr:hover {
|
||||
background-color: rgba(255, 133, 0, 0.05);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 10: Bold Orange Border
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(11) {
|
||||
border: 4px solid var(--color-orange-primary);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(11) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(11) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(11) tr:first-child td {
|
||||
background: linear-gradient(135deg, var(--color-orange-hover) 0%, var(--color-orange-primary) 100%);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(11) tbody tr:nth-child(even) {
|
||||
background-color: rgba(255, 133, 0, 0.05);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(11) tbody tr:hover {
|
||||
background-color: rgba(255, 133, 0, 0.12);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
STYLE 11+: Cycle back to Style 1
|
||||
======================================== */
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(n+12) thead tr:first-child th,
|
||||
.post-content table:not(.analisis table):nth-of-type(n+12) tbody tr:first-child td,
|
||||
.post-content table:not(.analisis table):nth-of-type(n+12) tr:first-child td {
|
||||
background: linear-gradient(135deg, var(--color-navy-primary) 0%, var(--color-navy-light) 100%);
|
||||
color: #ffffff !important;
|
||||
border: none !important;
|
||||
box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
|
||||
}
|
||||
|
||||
.post-content table:not(.analisis table):nth-of-type(n+12) tbody tr:nth-child(even) {
|
||||
background-color: var(--color-neutral-50);
|
||||
}
|
||||
186
Assets/css/css-global-pagination.css
Normal file
186
Assets/css/css-global-pagination.css
Normal file
@@ -0,0 +1,186 @@
|
||||
/**
|
||||
* Pagination Styles
|
||||
*
|
||||
* Estilos personalizados para paginación
|
||||
* Template ref: css/style.css líneas 180-207
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* ============================================
|
||||
PAGINATION PERSONALIZADA
|
||||
============================================ */
|
||||
|
||||
.pagination {
|
||||
margin-top: 3rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.page-item {
|
||||
margin: 0 0.25rem;
|
||||
}
|
||||
|
||||
.page-link {
|
||||
color: #495057;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 6px;
|
||||
padding: 0.5rem 0.875rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.page-link:hover {
|
||||
color: var(--color-orange-primary);
|
||||
background-color: rgba(255, 133, 0, 0.1);
|
||||
border-color: var(--color-orange-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page-link:focus {
|
||||
color: var(--color-orange-primary);
|
||||
background-color: #e9ecef;
|
||||
border-color: var(--color-orange-primary);
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.25rem rgba(255, 133, 0, 0.25);
|
||||
}
|
||||
|
||||
/* Active page */
|
||||
.page-item.active .page-link {
|
||||
color: #ffffff;
|
||||
background-color: var(--color-orange-primary);
|
||||
border-color: var(--color-orange-primary);
|
||||
}
|
||||
|
||||
/* Disabled state */
|
||||
.page-item.disabled .page-link {
|
||||
color: #adb5bd;
|
||||
background-color: #ffffff;
|
||||
border-color: #dee2e6;
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.page-item.disabled .page-link:hover {
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* First and Last */
|
||||
.page-item:first-child .page-link {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.page-item:last-child .page-link {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* Prev and Next */
|
||||
.page-item .page-link[rel="prev"],
|
||||
.page-item .page-link[rel="next"] {
|
||||
font-weight: 600;
|
||||
padding: 0.5rem 1.125rem;
|
||||
}
|
||||
|
||||
/* Ellipsis */
|
||||
.page-item .page-link.dots {
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.page-item .page-link.dots:hover {
|
||||
background: transparent;
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 767.98px) {
|
||||
.pagination {
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 1.5rem;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.page-item {
|
||||
margin: 0 0.15rem;
|
||||
}
|
||||
|
||||
.page-link {
|
||||
padding: 0.375rem 0.625rem;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.page-item .page-link[rel="prev"],
|
||||
.page-item .page-link[rel="next"] {
|
||||
padding: 0.375rem 0.75rem;
|
||||
}
|
||||
|
||||
/* Hide some page numbers on mobile, keep only current +/- 1 */
|
||||
.page-item:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.pagination {
|
||||
font-size: 0.813rem;
|
||||
}
|
||||
|
||||
.page-link {
|
||||
padding: 0.3rem 0.5rem;
|
||||
}
|
||||
|
||||
.page-item .page-link[rel="prev"],
|
||||
.page-item .page-link[rel="next"] {
|
||||
padding: 0.3rem 0.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print */
|
||||
@media print {
|
||||
.pagination {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Accessibility */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.page-link {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.page-link:hover,
|
||||
.page-item.active .page-link:hover {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dark mode */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.page-link {
|
||||
color: #f8f9fa;
|
||||
background-color: #212529;
|
||||
border-color: #495057;
|
||||
}
|
||||
|
||||
.page-link:hover {
|
||||
color: #ffffff;
|
||||
background-color: #343a40;
|
||||
border-color: var(--color-orange-primary);
|
||||
}
|
||||
|
||||
.page-item.active .page-link {
|
||||
background: var(--color-orange-primary);
|
||||
}
|
||||
|
||||
.page-item.disabled .page-link {
|
||||
color: #6c757d;
|
||||
background-color: #212529;
|
||||
border-color: #495057;
|
||||
}
|
||||
}
|
||||
213
Assets/css/css-global-print.css
Normal file
213
Assets/css/css-global-print.css
Normal file
@@ -0,0 +1,213 @@
|
||||
/**
|
||||
* Print Styles
|
||||
*
|
||||
* Optimized styling for printing
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* Hide elements that shouldn't print */
|
||||
@media print {
|
||||
/* Hide navigation, sidebars, and non-essential elements */
|
||||
header,
|
||||
nav,
|
||||
.navbar,
|
||||
.sidebar,
|
||||
.widget-area,
|
||||
.comments,
|
||||
.comment-form,
|
||||
.footer-widget,
|
||||
.pagination,
|
||||
.breadcrumb,
|
||||
.back-to-top,
|
||||
.share-buttons,
|
||||
.related-posts,
|
||||
button,
|
||||
input[type="button"],
|
||||
input[type="submit"],
|
||||
.btn,
|
||||
.modal,
|
||||
.overlay,
|
||||
.skip-link {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Hide footer links and widgets */
|
||||
footer {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Body styles */
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: white;
|
||||
color: #000;
|
||||
font-size: 12pt;
|
||||
line-height: 1.5;
|
||||
font-family: Georgia, serif;
|
||||
}
|
||||
|
||||
/* Container and content */
|
||||
.container,
|
||||
.content,
|
||||
main,
|
||||
article {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Headings */
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
page-break-after: avoid;
|
||||
color: #000;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24pt;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 18pt;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 16pt;
|
||||
}
|
||||
|
||||
/* Paragraphs */
|
||||
p {
|
||||
orphans: 3;
|
||||
widows: 3;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
/* Links */
|
||||
a,
|
||||
a:visited {
|
||||
text-decoration: underline;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
a[href]:after {
|
||||
content: " (" attr(href) ")";
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
/* Exclude certain links from showing URL */
|
||||
a[href^="#"]:after,
|
||||
a[href^="javascript:"]:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
/* Images */
|
||||
img {
|
||||
max-width: 100%;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 8px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
thead {
|
||||
display: table-header-group;
|
||||
page-break-after: avoid;
|
||||
}
|
||||
|
||||
tfoot {
|
||||
display: table-footer-group;
|
||||
page-break-before: avoid;
|
||||
}
|
||||
|
||||
tr {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
/* Lists */
|
||||
ul,
|
||||
ol {
|
||||
margin: 0.5em 0;
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
li {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre,
|
||||
code {
|
||||
border: 1px solid #999;
|
||||
background-color: #f5f5f5;
|
||||
padding: 1em;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/* Blockquotes */
|
||||
blockquote {
|
||||
border-left: 5px solid #ccc;
|
||||
margin: 0;
|
||||
padding-left: 1em;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
form {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Page breaks */
|
||||
.page-break,
|
||||
.page-break-before {
|
||||
page-break-before: always;
|
||||
}
|
||||
|
||||
.page-break-after {
|
||||
page-break-after: always;
|
||||
}
|
||||
|
||||
/* Margins */
|
||||
@page {
|
||||
margin: 2cm;
|
||||
orphans: 3;
|
||||
widows: 3;
|
||||
}
|
||||
|
||||
/* Print title and date */
|
||||
.print-header {
|
||||
page-break-after: avoid;
|
||||
margin-bottom: 1em;
|
||||
border-bottom: 2px solid #000;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.print-date {
|
||||
font-size: 10pt;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
353
Assets/css/css-global-responsive.css
Normal file
353
Assets/css/css-global-responsive.css
Normal file
@@ -0,0 +1,353 @@
|
||||
/**
|
||||
* Responsive Design Styles
|
||||
*
|
||||
* Media queries and responsive adjustments
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* Extra small devices (phones, less than 576px) */
|
||||
@media (max-width: 575.98px) {
|
||||
:root {
|
||||
--bs-gutter-x: 1rem;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
/* Navigation adjustments */
|
||||
.navbar {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
/* Content area */
|
||||
main {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
.sidebar {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
/* Tables become scrollable */
|
||||
table {
|
||||
font-size: 12px;
|
||||
margin-bottom: 1rem;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.table-responsive {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn-lg {
|
||||
padding: 0.5rem 1rem;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* Cards */
|
||||
.card {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.form-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* Modals */
|
||||
.modal-dialog {
|
||||
margin: 0.5rem;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Images */
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Lists */
|
||||
ul,
|
||||
ol {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
/* Spacing utilities */
|
||||
.mt-1,
|
||||
.my-1 {
|
||||
margin-top: 0.25rem !important;
|
||||
}
|
||||
|
||||
.mb-1,
|
||||
.my-1 {
|
||||
margin-bottom: 0.25rem !important;
|
||||
}
|
||||
|
||||
.p-1 {
|
||||
padding: 0.25rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Small devices (landscape phones, 576px and up) */
|
||||
@media (min-width: 576px) {
|
||||
body {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Medium devices (tablets, 768px and up) */
|
||||
@media (min-width: 768px) {
|
||||
body {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
/* Two column layout for medium screens */
|
||||
.row-md-2 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
/* Navigation */
|
||||
.navbar {
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
.main-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 300px;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.main-content.no-sidebar {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Large devices (desktops, 992px and up) */
|
||||
@media (min-width: 992px) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 36px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
/* Three column layout for large screens */
|
||||
.row-lg-3 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
/* Main content with sidebars */
|
||||
.main-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 300px;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.main-content.with-left-sidebar {
|
||||
grid-template-columns: 250px 1fr 300px;
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* Extra large devices (large desktops, 1200px and up) */
|
||||
@media (min-width: 1200px) {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1140px;
|
||||
}
|
||||
|
||||
.container-lg {
|
||||
max-width: 1280px;
|
||||
}
|
||||
|
||||
.container-xl {
|
||||
max-width: 1400px;
|
||||
}
|
||||
}
|
||||
|
||||
/* XXL devices (1400px and up) */
|
||||
@media (min-width: 1400px) {
|
||||
.container {
|
||||
max-width: 1320px;
|
||||
}
|
||||
|
||||
.container-xl {
|
||||
max-width: 1500px;
|
||||
}
|
||||
|
||||
.container-xxl {
|
||||
max-width: 1700px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Landscape orientation adjustments */
|
||||
@media (orientation: landscape) and (max-height: 500px) {
|
||||
header {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
/* High DPI displays */
|
||||
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
||||
body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
}
|
||||
|
||||
/* Touch devices */
|
||||
@media (hover: none) and (pointer: coarse) {
|
||||
button,
|
||||
.btn,
|
||||
a {
|
||||
min-height: 44px;
|
||||
min-width: 44px;
|
||||
}
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reduced motion preferences */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dark mode support */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #1a1a1a;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #64b5f6;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #ba68c8;
|
||||
}
|
||||
|
||||
code,
|
||||
pre {
|
||||
background-color: #2d2d2d;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
}
|
||||
90
Assets/css/css-global-utilities.css
Normal file
90
Assets/css/css-global-utilities.css
Normal file
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Utility Classes
|
||||
*
|
||||
* SOLO utilidades que NO están en Bootstrap 5
|
||||
* IMPORTANTE: Bootstrap 5 ya provee la mayoría de utilities (display, flex, spacing, etc.)
|
||||
* Este archivo solo contiene utilities adicionales no incluidas en Bootstrap
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* ========================================
|
||||
CURSOR UTILITIES
|
||||
======================================== */
|
||||
|
||||
.cursor-pointer {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
.cursor-default {
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
.cursor-not-allowed {
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
.cursor-auto {
|
||||
cursor: auto !important;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
USER SELECT
|
||||
======================================== */
|
||||
|
||||
.user-select-auto {
|
||||
user-select: auto !important;
|
||||
}
|
||||
|
||||
.user-select-none {
|
||||
user-select: none !important;
|
||||
}
|
||||
|
||||
.user-select-all {
|
||||
user-select: all !important;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
POINTER EVENTS
|
||||
======================================== */
|
||||
|
||||
.pointer-events-none {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
.pointer-events-auto {
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
OBJECT FIT
|
||||
======================================== */
|
||||
|
||||
.object-fit-contain {
|
||||
object-fit: contain !important;
|
||||
}
|
||||
|
||||
.object-fit-cover {
|
||||
object-fit: cover !important;
|
||||
}
|
||||
|
||||
.object-fit-fill {
|
||||
object-fit: fill !important;
|
||||
}
|
||||
|
||||
.object-fit-scale {
|
||||
object-fit: scale-down !important;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
TRANSITION
|
||||
======================================== */
|
||||
|
||||
.transition-all {
|
||||
transition: all 0.3s ease !important;
|
||||
}
|
||||
|
||||
.transition-none {
|
||||
transition: none !important;
|
||||
}
|
||||
200
Assets/css/css-global-variables.css
Normal file
200
Assets/css/css-global-variables.css
Normal file
@@ -0,0 +1,200 @@
|
||||
/**
|
||||
* Variables CSS del Template RDash
|
||||
*
|
||||
* RESPONSABILIDAD: SOLO variables CSS globales
|
||||
* - Colores (--color-*)
|
||||
* - Tipografía (--font-*, --line-height-*, --font-weight-*)
|
||||
* - Espaciados (--spacing-*)
|
||||
* - Bordes (--border-*)
|
||||
* - Sombras (--shadow-*)
|
||||
* - Transiciones (--transition-*)
|
||||
* - Z-index (--z-*)
|
||||
* - Gradientes (--gradient-*)
|
||||
* - Breakpoints (--breakpoint-*)
|
||||
*
|
||||
* NO debe contener:
|
||||
* - Selectores de elementos (body, a, h1, etc. van en style.css)
|
||||
* - Clases utilitarias (van en utilities.css o style.css)
|
||||
* - Estilos aplicados (SOLO variables en :root)
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
:root {
|
||||
/* ========================================
|
||||
COLORES PRINCIPALES - Paleta RDash
|
||||
======================================== */
|
||||
|
||||
/* Azules - Template variables */
|
||||
--color-navy-dark: #0E2337; /* Navbar background */
|
||||
--color-navy-primary: #1e3a5f; /* Navy primary (template) */
|
||||
--color-navy-light: #2c5282; /* Navy light (template) */
|
||||
--color-blue-primary: #1e3a5f; /* Hero gradient start */
|
||||
--color-blue-secondary: #2c5282; /* Hero gradient end */
|
||||
--color-blue-light: #1a73e8; /* Links, accents */
|
||||
|
||||
/* Turquesa / Cyan */
|
||||
--color-cyan-primary: #61c7cd; /* Links hover, highlights */
|
||||
--color-cyan-dark: #4db8c4; /* Cyan darker variant */
|
||||
--color-cyan-darker: #4fb3b9; /* Notification bar hover */
|
||||
|
||||
/* Naranjas */
|
||||
--color-orange-primary: #FF8600; /* CTA primary */
|
||||
--color-orange-secondary: #FFB800; /* CTA gradient end */
|
||||
--color-orange-light: #FFB800; /* Orange light (template) */
|
||||
--color-orange-button: #FF6B35; /* Let's Talk button start */
|
||||
--color-orange-button-end: #FF8C42;/* Let's Talk button end */
|
||||
--color-orange-hover: #FF6B35; /* Orange hover state (template) */
|
||||
|
||||
/* Neutrales - Template variables */
|
||||
--color-neutral-50: #f8f9fa; /* Light backgrounds (template) */
|
||||
--color-neutral-100: #e9ecef; /* Borders light (template) */
|
||||
--color-neutral-600: #495057; /* Text default (template) */
|
||||
--color-neutral-700: #6c757d; /* Text secondary (template) */
|
||||
|
||||
/* Grises */
|
||||
--color-slate-gray: #4C5C6B; /* Notification bar background */
|
||||
--color-gray-50: #f8f9fa; /* Light backgrounds */
|
||||
--color-gray-100: #f7fafc; /* Related posts background */
|
||||
--color-gray-200: #e9ecef; /* Borders light */
|
||||
--color-gray-300: #dee2e6; /* Borders */
|
||||
--color-gray-400: #cbd5e0; /* Scrollbar */
|
||||
--color-gray-500: #a0aec0; /* Scrollbar hover */
|
||||
--color-gray-600: #6c757d; /* Text secondary */
|
||||
--color-gray-700: #495057; /* Text default */
|
||||
--color-gray-800: #333; /* Body text */
|
||||
--color-gray-900: #212529; /* Headings */
|
||||
--color-gray-dark: #1a1a1a; /* Footer background */
|
||||
|
||||
/* Blancos y negros */
|
||||
--color-white: #ffffff;
|
||||
--color-black: #000000;
|
||||
|
||||
/* ========================================
|
||||
TIPOGRAFÍA
|
||||
======================================== */
|
||||
|
||||
/* Template usa Poppins (cargado via Google Fonts en enqueue-scripts.php) */
|
||||
--font-family-base: 'Poppins', sans-serif;
|
||||
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
|
||||
--font-size-base: 1rem;
|
||||
--font-size-sm: 0.875rem;
|
||||
--font-size-lg: 1.125rem;
|
||||
--font-size-xl: 1.25rem;
|
||||
|
||||
--font-weight-normal: 400;
|
||||
--font-weight-medium: 500;
|
||||
--font-weight-semibold: 600;
|
||||
--font-weight-bold: 700;
|
||||
|
||||
--line-height-base: 1.5;
|
||||
--line-height-tight: 1.25;
|
||||
--line-height-loose: 1.8;
|
||||
|
||||
/* ========================================
|
||||
ESPACIADOS
|
||||
======================================== */
|
||||
|
||||
--spacing-xs: 0.25rem; /* 4px */
|
||||
--spacing-sm: 0.5rem; /* 8px */
|
||||
--spacing-md: 1rem; /* 16px */
|
||||
--spacing-lg: 1.5rem; /* 24px */
|
||||
--spacing-xl: 2rem; /* 32px */
|
||||
--spacing-2xl: 3rem; /* 48px */
|
||||
--spacing-3xl: 4rem; /* 64px */
|
||||
|
||||
/* ========================================
|
||||
BORDES
|
||||
======================================== */
|
||||
|
||||
--border-width: 1px;
|
||||
--border-width-thick: 2px;
|
||||
--border-width-thicker: 3px;
|
||||
--border-width-lateral: 4px;
|
||||
|
||||
--border-radius-sm: 4px;
|
||||
--border-radius-md: 8px;
|
||||
--border-radius-lg: 12px;
|
||||
--border-radius-xl: 16px;
|
||||
|
||||
--border-color-light: var(--color-gray-200);
|
||||
--border-color-default: var(--color-gray-300);
|
||||
|
||||
/* ========================================
|
||||
SOMBRAS
|
||||
======================================== */
|
||||
|
||||
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
|
||||
--shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.25);
|
||||
--shadow-2xl: 0 20px 60px rgba(0, 0, 0, 0.3);
|
||||
|
||||
/* Sombras específicas de componentes */
|
||||
--shadow-navbar: 0 2px 4px rgba(0, 0, 0, 0.15);
|
||||
--shadow-navbar-scrolled: 0 4px 12px rgba(0, 0, 0, 0.25);
|
||||
--shadow-dropdown: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
--shadow-cta: 0 8px 24px rgba(255, 133, 0, 0.3);
|
||||
--shadow-cta-hover: 0 12px 32px rgba(255, 133, 0, 0.4);
|
||||
--shadow-button: 0 4px 12px rgba(255, 107, 53, 0.3);
|
||||
--shadow-related-posts: 0 12px 32px rgba(26, 115, 232, 0.15);
|
||||
--shadow-pagination: 0 4px 12px rgba(26, 115, 232, 0.3);
|
||||
|
||||
/* ========================================
|
||||
TRANSICIONES
|
||||
======================================== */
|
||||
|
||||
--transition-fast: 0.15s ease;
|
||||
--transition-base: 0.3s ease;
|
||||
--transition-slow: 0.5s ease;
|
||||
--transition-cubic: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
/* ========================================
|
||||
Z-INDEX
|
||||
======================================== */
|
||||
|
||||
--z-dropdown: 1000;
|
||||
--z-sticky: 1020;
|
||||
--z-navbar: 1030;
|
||||
--z-modal-backdrop: 1040;
|
||||
--z-modal: 1050;
|
||||
--z-popover: 1060;
|
||||
--z-tooltip: 1070;
|
||||
|
||||
/* ========================================
|
||||
GRADIENTES
|
||||
======================================== */
|
||||
|
||||
--gradient-hero: linear-gradient(135deg, var(--color-blue-primary) 0%, var(--color-blue-secondary) 100%);
|
||||
--gradient-cta: linear-gradient(135deg, var(--color-orange-primary) 0%, var(--color-orange-secondary) 100%);
|
||||
--gradient-button-lets-talk: linear-gradient(135deg, var(--color-orange-button) 0%, var(--color-orange-button-end) 100%);
|
||||
--gradient-pagination: linear-gradient(135deg, var(--color-blue-primary) 0%, var(--color-blue-secondary) 100%);
|
||||
--gradient-underline: linear-gradient(90deg, var(--color-cyan-primary) 0%, var(--color-cyan-dark) 100%);
|
||||
--gradient-border-related: linear-gradient(180deg, var(--color-blue-primary) 0%, var(--color-blue-light) 100%);
|
||||
|
||||
/* ========================================
|
||||
OPACIDADES
|
||||
======================================== */
|
||||
|
||||
--opacity-disabled: 0.5;
|
||||
--opacity-hover: 0.8;
|
||||
--opacity-backdrop: 0.5;
|
||||
|
||||
/* ========================================
|
||||
BREAKPOINTS (para uso en calc o clamp)
|
||||
======================================== */
|
||||
|
||||
--breakpoint-sm: 576px;
|
||||
--breakpoint-md: 768px;
|
||||
--breakpoint-lg: 992px;
|
||||
--breakpoint-xl: 1200px;
|
||||
--breakpoint-xxl: 1400px;
|
||||
}
|
||||
|
||||
/* ELIMINADO: body, a, a:hover (movidos a style.css)
|
||||
* Este archivo SOLO debe contener :root con variables
|
||||
* Los estilos de elementos HTML van en style.css
|
||||
*/
|
||||
31
Assets/css/css-global-video.css
Normal file
31
Assets/css/css-global-video.css
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Video Iframe Styles
|
||||
*
|
||||
* Estilos para videos embebidos (YouTube, Vimeo, etc.) en post-content
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* ========================================
|
||||
VIDEO WRAPPER
|
||||
======================================== */
|
||||
|
||||
.video-wrapper {
|
||||
position: relative;
|
||||
margin: 2rem auto;
|
||||
max-width: 850px;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.video-wrapper iframe {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 478px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
}
|
||||
501
Assets/css/css-tablas-apu.css
Normal file
501
Assets/css/css-tablas-apu.css
Normal file
@@ -0,0 +1,501 @@
|
||||
/**
|
||||
* Tablas APU - Análisis de Precios Unitarios
|
||||
* Estilos específicos para tablas de construcción
|
||||
*
|
||||
* @package Apus_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* ========================================
|
||||
CONTENEDOR PRINCIPAL DE TABLA APU
|
||||
======================================== */
|
||||
.analisis,
|
||||
.desglose {
|
||||
margin: 2rem 0;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
TABLA BASE
|
||||
======================================== */
|
||||
.analisis table,
|
||||
.desglose table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
/* Eliminar todos los bordes */
|
||||
.analisis table td,
|
||||
.desglose table td,
|
||||
.analisis table tbody,
|
||||
.desglose table tbody,
|
||||
.analisis table tr,
|
||||
.desglose table tr {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
ANCHOS DE COLUMNAS
|
||||
======================================== */
|
||||
.analisis table td:nth-child(1),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(1) {
|
||||
width: 150px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.analisis table td:nth-child(2),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(2) {
|
||||
width: auto;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.analisis table td:nth-child(3),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(3) {
|
||||
width: 80px;
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
.analisis table td:nth-child(4),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(4) {
|
||||
width: 110px;
|
||||
min-width: 90px;
|
||||
}
|
||||
|
||||
.analisis table td:nth-child(5),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(5) {
|
||||
width: 120px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.analisis table td:nth-child(6),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(6) {
|
||||
width: 120px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
ENCABEZADOS DE TABLA (THEAD)
|
||||
======================================== */
|
||||
.analisis table thead tr th,
|
||||
.desglose table thead tr th {
|
||||
background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
text-align: center !important;
|
||||
padding: 1rem;
|
||||
border: none;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* ESPECIAL: Primera fila de .analisis cuando NO tiene <thead>
|
||||
(para tablas de resumen que solo tienen <tbody>) */
|
||||
.analisis table tbody tr:first-child td {
|
||||
background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
text-align: center !important;
|
||||
padding: 1rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Esquinas redondeadas superiores para primera fila de .analisis */
|
||||
.analisis table tbody tr:first-child td:first-child {
|
||||
border-top-left-radius: 8px;
|
||||
}
|
||||
|
||||
.analisis table tbody tr:first-child td:last-child {
|
||||
border-top-right-radius: 8px;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
FILAS NORMALES
|
||||
======================================== */
|
||||
.analisis table tbody td,
|
||||
.desglose table tbody td {
|
||||
padding: 0.75rem 1rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
ZEBRA STRIPING - Filas alternadas
|
||||
======================================== */
|
||||
.analisis table tbody tr:nth-child(even):not(.section-header):not(.subtotal-row):not(.total-row),
|
||||
.desglose table tbody tr:nth-child(even):not(.section-header):not(.subtotal-row):not(.total-row) {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.analisis table tbody tr:nth-child(odd):not(.section-header):not(.subtotal-row):not(.total-row),
|
||||
.desglose table tbody tr:nth-child(odd):not(.section-header):not(.subtotal-row):not(.total-row) {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
ALINEACIÓN DE COLUMNAS
|
||||
======================================== */
|
||||
|
||||
/* Columnas 1 y 2: Clave y Descripción - izquierda */
|
||||
.analisis table td:nth-child(1),
|
||||
.analisis table td:nth-child(2) {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* Columna 3: Unidad - centrada */
|
||||
.analisis table td:nth-child(3),
|
||||
.analisis table td.c3,
|
||||
.desglose table td.c3 {
|
||||
text-align: center !important;
|
||||
color: #6c757d;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* Columnas 4, 5, 6 en .analisis: Cantidad, Costo, Importe - con fuente monospace */
|
||||
.analisis table td:nth-child(4),
|
||||
.analisis table td.c4,
|
||||
.analisis table td:nth-child(5),
|
||||
.analisis table td.c5,
|
||||
.analisis table td:nth-child(6),
|
||||
.analisis table td.c6 {
|
||||
text-align: right !important;
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
font-weight: 500;
|
||||
color: #1e3a5f;
|
||||
}
|
||||
|
||||
/* Columnas 4, 5, 6 en .desglose: Cantidad, Costo, Importe - SIN fuente monospace */
|
||||
.desglose table td.c4,
|
||||
.desglose table td.c5,
|
||||
.desglose table td.c6 {
|
||||
text-align: right !important;
|
||||
font-weight: 500;
|
||||
color: #1e3a5f;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
HOVER EN FILAS DE DATOS
|
||||
======================================== */
|
||||
.analisis table tbody tr:not(.section-header):not(.subtotal-row):not(.total-row):hover,
|
||||
.desglose table tbody tr:not(.section-header):not(.subtotal-row):not(.total-row):hover {
|
||||
background-color: #fff3cd !important;
|
||||
transition: background-color 0.2s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
ENCABEZADOS DE SECCIÓN
|
||||
(Material, Mano de Obra, Herramienta, Equipo)
|
||||
======================================== */
|
||||
.analisis table tr.section-header,
|
||||
.desglose table tr.section-header {
|
||||
background-color: #e9ecef !important;
|
||||
}
|
||||
|
||||
.analisis table tr.section-header td,
|
||||
.desglose table tr.section-header td {
|
||||
font-weight: 600;
|
||||
color: #1e3a5f;
|
||||
padding: 0.75rem 1rem;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
FILAS DE SUBTOTALES
|
||||
(Suma de Material, Suma de Mano de Obra, etc)
|
||||
======================================== */
|
||||
.analisis table tr.subtotal-row,
|
||||
.desglose table tr.subtotal-row {
|
||||
background-color: rgba(255, 133, 0, 0.1) !important;
|
||||
}
|
||||
|
||||
.analisis table tr.subtotal-row td,
|
||||
.desglose table tr.subtotal-row td {
|
||||
font-weight: 700;
|
||||
color: var(--color-orange-primary);
|
||||
padding: 0.875rem 1rem;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.analisis table tr.subtotal-row td:nth-child(2) {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.analisis table tr.subtotal-row td.c6,
|
||||
.analisis table tr.subtotal-row td:nth-child(6) {
|
||||
font-size: 1.05rem;
|
||||
color: var(--color-orange-primary);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
FILA DE TOTAL FINAL
|
||||
(Costo Directo)
|
||||
======================================== */
|
||||
.analisis table tr.total-row,
|
||||
.desglose table tr.total-row {
|
||||
background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%) !important;
|
||||
}
|
||||
|
||||
.analisis table tr.total-row td,
|
||||
.desglose table tr.total-row td {
|
||||
color: #ffffff !important;
|
||||
font-weight: 700;
|
||||
font-size: 1.1rem;
|
||||
padding: 1.125rem 1rem !important;
|
||||
border: none !important;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.analisis table tr.total-row td.c6,
|
||||
.analisis table tr.total-row td:nth-child(6) {
|
||||
font-size: 1.25rem;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
ESTILOS PARA IMPRESIÓN
|
||||
======================================== */
|
||||
@media print {
|
||||
.analisis {
|
||||
margin: 1rem 0;
|
||||
overflow: visible;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.analisis table,
|
||||
.desglose table {
|
||||
box-shadow: none;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.analisis table thead tr th,
|
||||
.desglose table thead tr th {
|
||||
background: #1e3a5f !important;
|
||||
color: #ffffff !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.analisis table tr.section-header,
|
||||
.desglose table tr.section-header {
|
||||
background-color: #e9ecef !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.analisis table tr.subtotal-row,
|
||||
.desglose table tr.subtotal-row {
|
||||
background-color: rgba(255, 133, 0, 0.1) !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.analisis table tr.total-row,
|
||||
.desglose table tr.total-row {
|
||||
background: #1e3a5f !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.analisis table tbody tr:nth-child(even):not(.section-header):not(.subtotal-row):not(.total-row),
|
||||
.desglose table tbody tr:nth-child(even):not(.section-header):not(.subtotal-row):not(.total-row) {
|
||||
background-color: #f8f9fa !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
/* Evitar saltos de página dentro de las tablas */
|
||||
.analisis table,
|
||||
.desglose table {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.analisis table tr,
|
||||
.desglose table tr {
|
||||
page-break-inside: avoid;
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
/* No mostrar hover en impresión */
|
||||
.analisis table tbody tr:hover {
|
||||
background-color: inherit !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
RESPONSIVE - TABLETS (768px - 991px)
|
||||
======================================== */
|
||||
@media (max-width: 991px) {
|
||||
.analisis {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.analisis table td {
|
||||
padding: 0.6rem 0.8rem !important;
|
||||
}
|
||||
|
||||
.analisis table thead tr th,
|
||||
.desglose table thead tr th {
|
||||
padding: 0.8rem 0.6rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.analisis table tr.total-row td,
|
||||
.desglose table tr.total-row td {
|
||||
font-size: 1rem !important;
|
||||
padding: 1rem 0.8rem !important;
|
||||
}
|
||||
|
||||
.analisis table tr.total-row td.c6,
|
||||
.analisis table tr.total-row td:nth-child(6) {
|
||||
font-size: 1.15rem !important;
|
||||
}
|
||||
|
||||
/* Ajustar anchos mínimos en tablets */
|
||||
.analisis table td:nth-child(1),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(1) {
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.analisis table td:nth-child(2),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(2) {
|
||||
min-width: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
RESPONSIVE - MÓVILES (max 767px)
|
||||
======================================== */
|
||||
@media (max-width: 767px) {
|
||||
.analisis {
|
||||
font-size: 0.85rem;
|
||||
margin: 1.5rem 0;
|
||||
}
|
||||
|
||||
.analisis table td {
|
||||
padding: 0.5rem !important;
|
||||
}
|
||||
|
||||
.analisis table thead tr th,
|
||||
.desglose table thead tr th {
|
||||
padding: 0.7rem 0.5rem;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.analisis table tr.section-header td,
|
||||
.desglose table tr.section-header td {
|
||||
font-size: 0.85em;
|
||||
padding: 0.6rem 0.5rem;
|
||||
}
|
||||
|
||||
.analisis table tr.subtotal-row td,
|
||||
.desglose table tr.subtotal-row td {
|
||||
padding: 0.7rem 0.5rem;
|
||||
}
|
||||
|
||||
.analisis table tr.subtotal-row td.c6,
|
||||
.analisis table tr.subtotal-row td:nth-child(6) {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.analisis table tr.total-row td,
|
||||
.desglose table tr.total-row td {
|
||||
font-size: 0.95rem !important;
|
||||
padding: 0.875rem 0.5rem !important;
|
||||
}
|
||||
|
||||
.analisis table tr.total-row td.c6,
|
||||
.analisis table tr.total-row td:nth-child(6) {
|
||||
font-size: 1.1rem !important;
|
||||
}
|
||||
|
||||
/* Ajustar anchos mínimos en móviles */
|
||||
.analisis table td:nth-child(1),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(1) {
|
||||
width: 80px;
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
.analisis table td:nth-child(2),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(2) {
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.analisis table td:nth-child(3),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(3),
|
||||
.analisis table td:nth-child(4),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(4),
|
||||
.analisis table td:nth-child(5),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(5),
|
||||
.analisis table td:nth-child(6),
|
||||
.analisis table th:,
|
||||
.desglose table th:nth-child(6) {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
ACCESIBILIDAD
|
||||
======================================== */
|
||||
|
||||
/* Mejorar contraste para lectores de pantalla */
|
||||
.analisis table thead tr th,
|
||||
.desglose table thead tr th {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Focus visible para navegación por teclado */
|
||||
.analisis table tbody tr:focus-within,
|
||||
.desglose table tbody tr:focus-within {
|
||||
outline: 2px solid #0d6efd;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
COMPATIBILIDAD CON BOOTSTRAP
|
||||
======================================== */
|
||||
|
||||
/* Anular estilos de Bootstrap que puedan interferir */
|
||||
.analisis table.table,
|
||||
.desglose table.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.analisis table.table > :not(caption) > * > *,
|
||||
.desglose table.table > :not(caption) > * > * {
|
||||
padding: inherit;
|
||||
background-color: inherit;
|
||||
border-bottom-width: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Mantener compatibilidad con clases de Bootstrap si se usan */
|
||||
.analisis table.table-striped > tbody > tr:nth-of-type(odd) > *:not(.section-header):not(.subtotal-row):not(.total-row),
|
||||
.desglose table.table-striped > tbody > tr:nth-of-type(odd) > *:not(.section-header):not(.subtotal-row):not(.total-row) {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.analisis table.table-striped > tbody > tr:nth-of-type(even) > *:not(.section-header):not(.subtotal-row):not(.total-row),
|
||||
.desglose table.table-striped > tbody > tr:nth-of-type(even) > *:not(.section-header):not(.subtotal-row):not(.total-row) {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
791
Assets/css/style.css
Normal file
791
Assets/css/style.css
Normal file
@@ -0,0 +1,791 @@
|
||||
/**
|
||||
* ROI Theme - Main Stylesheet
|
||||
*
|
||||
* RESPONSABILIDAD: Estilos principales del tema
|
||||
* - Variables CSS específicas del tema (:root en este archivo)
|
||||
* - Estilos base de elementos HTML (body, a, h1-h6, code, etc.)
|
||||
* - Layout general
|
||||
* - Componentes principales
|
||||
*
|
||||
* IMPORTANTE: Este es el archivo PRINCIPAL de estilos
|
||||
* - fonts.css: SOLO variables de fuentes
|
||||
* - variables.css: SOLO variables de colores/espaciados/etc
|
||||
* - style.css: Aplica variables a elementos HTML (este archivo)
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
/* ========================================
|
||||
❌ NO AGREGAR CSS DE COMPONENTES AQUÍ
|
||||
========================================
|
||||
|
||||
IMPORTANTE: Este archivo style.css es para estilos GLOBALES del tema únicamente.
|
||||
|
||||
El CSS de componentes individuales DEBE ir en archivos separados en:
|
||||
wp-content/themes/roi-theme/assets/css/[nombre-componente].css
|
||||
|
||||
Ejemplos de componentes con archivos individuales:
|
||||
- CTA Box Sidebar → cta-box-sidebar.css
|
||||
- Share Buttons → social-share.css
|
||||
- Related Posts → related-posts.css
|
||||
- TOC → toc.css
|
||||
- Pagination → pagination.css
|
||||
- Hero Section → hero.css
|
||||
- Footer Contact Form → footer-contact.css
|
||||
|
||||
SIN EXCEPCIONES: TODOS los componentes deben tener su propio archivo CSS.
|
||||
|
||||
======================================== */
|
||||
|
||||
/* ========================================
|
||||
❌ SHARE BUTTONS - NO AGREGAR CSS AQUÍ
|
||||
========================================
|
||||
|
||||
El CSS de Share Buttons DEBE estar en:
|
||||
wp-content/themes/roi-theme/assets/css/social-share.css
|
||||
|
||||
Este archivo ya existe y está correctamente enqueued.
|
||||
Ver: inc/enqueue-scripts.php líneas 405-421
|
||||
|
||||
======================================== */
|
||||
|
||||
/* ========================================
|
||||
❌ CTA A/B TESTING - NO AGREGAR CSS AQUÍ
|
||||
========================================
|
||||
|
||||
El CSS de CTA A/B Testing DEBE estar en:
|
||||
wp-content/themes/roi-theme/assets/css/cta.css
|
||||
|
||||
Este archivo ya existe y está correctamente enqueued.
|
||||
Ver: inc/enqueue-scripts.php líneas 443-477
|
||||
|
||||
======================================== */
|
||||
|
||||
/* ========================================
|
||||
❌ RELATED POSTS - NO AGREGAR CSS AQUÍ
|
||||
========================================
|
||||
|
||||
El CSS de Related Posts DEBE estar en:
|
||||
wp-content/themes/roi-theme/assets/css/related-posts.css
|
||||
|
||||
Este archivo ya existe y está correctamente enqueued.
|
||||
Ver: inc/enqueue-scripts.php líneas 148-156
|
||||
|
||||
======================================== */
|
||||
|
||||
/* ========================================
|
||||
❌ PAGINATION - NO AGREGAR CSS AQUÍ
|
||||
========================================
|
||||
|
||||
El CSS de Pagination DEBE estar en:
|
||||
wp-content/themes/roi-theme/assets/css/pagination.css
|
||||
|
||||
Este archivo ya existe y está correctamente enqueued.
|
||||
Ver: inc/enqueue-scripts.php líneas 129-136
|
||||
|
||||
======================================== */
|
||||
|
||||
/* ========================================
|
||||
❌ FOOTER CONTACT FORM - NO AGREGAR CSS AQUÍ
|
||||
========================================
|
||||
|
||||
El CSS de Footer Contact Form DEBE estar en:
|
||||
wp-content/themes/roi-theme/assets/css/footer-contact.css
|
||||
|
||||
Este archivo ya existe y está correctamente enqueued.
|
||||
Ver: inc/enqueue-scripts.php líneas 506-517
|
||||
|
||||
======================================== */
|
||||
|
||||
|
||||
/* ==========================================================================
|
||||
CSS Variables
|
||||
========================================================================== */
|
||||
|
||||
:root {
|
||||
/* Typography - Poppins como fuente principal (loaded via Google Fonts) */
|
||||
--font-primary: 'Poppins', sans-serif;
|
||||
--font-secondary: 'Poppins', sans-serif;
|
||||
--font-headings: 'Poppins', sans-serif;
|
||||
--font-code: "Consolas", "Monaco", "Courier New", Courier, monospace;
|
||||
|
||||
/* Font Sizes - Fluid typography scale */
|
||||
--font-size-xs: 0.75rem; /* 12px */
|
||||
--font-size-sm: 0.875rem; /* 14px */
|
||||
--font-size-base: 1rem; /* 16px */
|
||||
--font-size-lg: 1.125rem; /* 18px */
|
||||
--font-size-xl: 1.25rem; /* 20px */
|
||||
--font-size-2xl: 1.5rem; /* 24px */
|
||||
--font-size-3xl: 1.875rem; /* 30px */
|
||||
--font-size-4xl: 2.25rem; /* 36px */
|
||||
|
||||
/* Line Heights */
|
||||
--line-height-none: 1;
|
||||
--line-height-tight: 1.25;
|
||||
--line-height-normal: 1.5;
|
||||
--line-height-relaxed: 1.75;
|
||||
--line-height-loose: 2;
|
||||
|
||||
/* Font Weights */
|
||||
--font-weight-light: 300;
|
||||
--font-weight-normal: 400;
|
||||
--font-weight-medium: 500;
|
||||
--font-weight-semibold: 600;
|
||||
--font-weight-bold: 700;
|
||||
|
||||
/* Colors - WCAG AA compliant (minimum 4.5:1 contrast ratio) */
|
||||
--color-primary: #0056b3; /* Contrast ratio 7.53:1 against white */
|
||||
--color-secondary: #5a6268; /* Contrast ratio 7.04:1 against white */
|
||||
--color-success: #1e7e34; /* Contrast ratio 5.91:1 against white */
|
||||
--color-danger: #c81e1e; /* Contrast ratio 6.12:1 against white */
|
||||
--color-warning: #856404; /* Contrast ratio 7.51:1 against white */
|
||||
--color-info: #117a8b; /* Contrast ratio 5.34:1 against white */
|
||||
--color-light: #f8f9fa;
|
||||
--color-dark: #212529;
|
||||
--color-text: #212529; /* Contrast ratio 15.52:1 against white */
|
||||
--color-bg: #ffffff;
|
||||
|
||||
/* APU Template Colors (from roi-theme-template/css/style.css) */
|
||||
--color-navy-dark: #0E2337;
|
||||
--color-navy-primary: #1e3a5f;
|
||||
--color-navy-light: #2c5282;
|
||||
--color-orange-primary: #FF8600;
|
||||
--color-orange-hover: #FF6B35;
|
||||
--color-orange-light: #FFB800;
|
||||
|
||||
/* Neutral colors (for forms, borders, backgrounds) */
|
||||
--color-neutral-50: #f9fafb;
|
||||
--color-neutral-100: #e9ecef;
|
||||
--color-neutral-600: #6c757d;
|
||||
--color-neutral-700: #495057;
|
||||
|
||||
/* Spacing */
|
||||
--spacing-xs: 0.25rem;
|
||||
--spacing-sm: 0.5rem;
|
||||
--spacing-md: 1rem;
|
||||
--spacing-lg: 1.5rem;
|
||||
--spacing-xl: 2rem;
|
||||
--spacing-xxl: 3rem;
|
||||
|
||||
/* Header specific variables */
|
||||
--header-height: 70px;
|
||||
--header-bg: #ffffff;
|
||||
--header-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
|
||||
/* Z-index scale */
|
||||
--z-header: 1000;
|
||||
--z-mobile-menu: 999;
|
||||
--z-overlay: 998;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Reset & Base Styles
|
||||
========================================================================== */
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 16px;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base Styles - Elementos HTML Globales
|
||||
========================================================================== */
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: var(--font-primary);
|
||||
font-size: 1rem;
|
||||
line-height: 1.6;
|
||||
color: var(--color-text);
|
||||
background-color: var(--color-bg);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* Links globales */
|
||||
a {
|
||||
color: var(--color-blue-light);
|
||||
transition: color var(--transition-base, 0.3s ease);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--color-cyan-primary);
|
||||
}
|
||||
|
||||
/* Código y preformateado */
|
||||
code, pre, kbd, samp {
|
||||
font-family: var(--font-code);
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/* ELIMINADO: Estilos globales h1-h6 (líneas 110-123) - NO están en template */
|
||||
/* Template usa SOLO estilos Bootstrap default para headings */
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-primary);
|
||||
text-decoration: none;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #003d82; /* Darker blue for better contrast - 9.52:1 */
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:focus {
|
||||
outline: 2px solid var(--color-primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Screen Reader Text
|
||||
========================================================================== */
|
||||
|
||||
.screen-reader-text {
|
||||
position: absolute;
|
||||
left: -10000px;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
clip-path: inset(50%);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.screen-reader-text:focus {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 1rem;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
z-index: 100000;
|
||||
clip: auto;
|
||||
clip-path: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Skip Link
|
||||
========================================================================== */
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
top: -40px;
|
||||
left: 0;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
padding: 0.5rem 1rem;
|
||||
z-index: 100000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
top: 0;
|
||||
outline: 2px solid #fff;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Site Structure
|
||||
========================================================================== */
|
||||
|
||||
.site {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.site-main {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Content Wrapper
|
||||
========================================================================== */
|
||||
|
||||
.content-wrapper {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: var(--spacing-xl);
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: var(--spacing-xl);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.content-wrapper {
|
||||
grid-template-columns: 2fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
#primary {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Single Post & Page Styles
|
||||
========================================================================== */
|
||||
|
||||
.post-thumbnail {
|
||||
margin-bottom: var(--spacing-xl);
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.post-thumbnail img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.entry-header {
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.entry-title {
|
||||
margin-bottom: var(--spacing-md);
|
||||
color: var(--color-dark);
|
||||
}
|
||||
|
||||
.entry-categories {
|
||||
display: flex;
|
||||
gap: var(--spacing-sm);
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.category-badge {
|
||||
display: inline-block;
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
background-color: var(--color-primary);
|
||||
color: #fff;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.category-badge:hover {
|
||||
background-color: #003d82; /* Darker for better contrast */
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.entry-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--spacing-md);
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-secondary);
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.entry-meta time {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.entry-meta .updated {
|
||||
display: block;
|
||||
margin-top: var(--spacing-xs);
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.entry-content {
|
||||
line-height: 1.8;
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.entry-content > * + * {
|
||||
margin-top: var(--spacing-md);
|
||||
}
|
||||
|
||||
.entry-content img {
|
||||
border-radius: 4px;
|
||||
margin: var(--spacing-lg) 0;
|
||||
}
|
||||
|
||||
.entry-footer {
|
||||
padding-top: var(--spacing-lg);
|
||||
border-top: 1px solid #e9ecef;
|
||||
margin-top: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.tags-links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--spacing-sm);
|
||||
align-items: center;
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.tags-label {
|
||||
font-weight: 600;
|
||||
color: var(--color-dark);
|
||||
}
|
||||
|
||||
.tags-list a {
|
||||
display: inline-block;
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
background-color: var(--color-light);
|
||||
color: var(--color-dark);
|
||||
font-size: 0.875rem;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.tags-list a:hover {
|
||||
background-color: #e2e6ea;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.edit-link a {
|
||||
color: var(--color-secondary);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Archive Styles
|
||||
========================================================================== */
|
||||
|
||||
.page-header {
|
||||
margin-bottom: var(--spacing-xxl);
|
||||
padding-bottom: var(--spacing-lg);
|
||||
border-bottom: 2px solid var(--color-primary);
|
||||
}
|
||||
|
||||
.page-title {
|
||||
margin-bottom: var(--spacing-md);
|
||||
color: var(--color-dark);
|
||||
}
|
||||
|
||||
.archive-description {
|
||||
color: var(--color-secondary);
|
||||
font-size: 1.125rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.archive-posts {
|
||||
display: grid;
|
||||
gap: var(--spacing-xxl);
|
||||
margin-bottom: var(--spacing-xxl);
|
||||
}
|
||||
|
||||
.archive-posts article {
|
||||
display: grid;
|
||||
gap: var(--spacing-lg);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.archive-posts article {
|
||||
grid-template-columns: 300px 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.archive-posts .post-thumbnail {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.archive-posts .entry-summary {
|
||||
color: var(--color-text);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.read-more-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
font-weight: 600;
|
||||
color: var(--color-primary);
|
||||
text-decoration: none;
|
||||
margin-top: var(--spacing-md);
|
||||
}
|
||||
|
||||
.read-more-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.read-more-icon {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.read-more-link:hover .read-more-icon {
|
||||
transform: translateX(4px);
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Pagination
|
||||
========================================================================== */
|
||||
|
||||
.pagination,
|
||||
.posts-pagination {
|
||||
margin-top: var(--spacing-xxl);
|
||||
margin-bottom: var(--spacing-xxl);
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: var(--spacing-sm);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.nav-links .page-numbers {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 4px;
|
||||
color: var(--color-primary);
|
||||
text-decoration: none;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-links .page-numbers:hover {
|
||||
background-color: var(--color-primary);
|
||||
color: #fff;
|
||||
border-color: var(--color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav-links .page-numbers.current {
|
||||
background-color: var(--color-primary);
|
||||
color: #fff;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.nav-links .page-numbers.dots {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Post Navigation
|
||||
========================================================================== */
|
||||
|
||||
.post-navigation {
|
||||
margin-top: var(--spacing-xxl);
|
||||
padding-top: var(--spacing-xl);
|
||||
border-top: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.post-navigation .nav-links {
|
||||
display: grid;
|
||||
gap: var(--spacing-lg);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.post-navigation .nav-links {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.post-navigation a {
|
||||
display: block;
|
||||
padding: var(--spacing-lg);
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.post-navigation a:hover {
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav-subtitle {
|
||||
display: block;
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-secondary);
|
||||
margin-bottom: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--color-dark);
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
404 Error Page
|
||||
========================================================================== */
|
||||
|
||||
.error-404 {
|
||||
text-align: center;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: var(--spacing-xxl) var(--spacing-lg);
|
||||
}
|
||||
|
||||
.error-404 .page-header {
|
||||
border-bottom: none;
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.error-404 .page-title {
|
||||
font-size: 3rem;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.error-message {
|
||||
font-size: 1.125rem;
|
||||
color: var(--color-secondary);
|
||||
margin-bottom: var(--spacing-xxl);
|
||||
}
|
||||
|
||||
.error-actions {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.error-actions h2,
|
||||
.error-actions h3 {
|
||||
margin-top: var(--spacing-xl);
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.error-suggestions,
|
||||
.recent-posts-list,
|
||||
.categories-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.error-suggestions li,
|
||||
.recent-posts-list li,
|
||||
.categories-list li {
|
||||
padding: var(--spacing-sm) 0;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.error-suggestions li:last-child,
|
||||
.recent-posts-list li:last-child,
|
||||
.categories-list li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.category-count {
|
||||
color: var(--color-secondary);
|
||||
font-size: 0.875rem;
|
||||
margin-left: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.recent-posts-section,
|
||||
.categories-section {
|
||||
margin-top: var(--spacing-xl);
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Front Page
|
||||
========================================================================== */
|
||||
|
||||
.front-page .hero-section {
|
||||
margin-bottom: var(--spacing-xxl);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.front-page .hero-section img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: 500px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Page Links (Paginated Posts)
|
||||
========================================================================== */
|
||||
|
||||
.page-links {
|
||||
margin-top: var(--spacing-xl);
|
||||
padding-top: var(--spacing-lg);
|
||||
border-top: 1px solid #e9ecef;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.page-links a {
|
||||
display: inline-block;
|
||||
margin: 0 var(--spacing-xs);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page-links a:hover {
|
||||
background-color: var(--color-primary);
|
||||
color: #fff;
|
||||
border-color: var(--color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Responsive Media
|
||||
========================================================================== */
|
||||
|
||||
@media (max-width: 767px) {
|
||||
h1 { font-size: 2rem; }
|
||||
h2 { font-size: 1.75rem; }
|
||||
h3 { font-size: 1.5rem; }
|
||||
h4 { font-size: 1.25rem; }
|
||||
|
||||
.content-wrapper {
|
||||
padding: var(--spacing-md);
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.archive-posts article {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.error-404 .page-title {
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
✅ COMPONENTES MOVIDOS A ARCHIVOS INDIVIDUALES
|
||||
========================================
|
||||
|
||||
Los siguientes componentes fueron movidos a sus archivos CSS individuales:
|
||||
|
||||
- TOP NOTIFICATION BAR → notification-bar.css (registrado en enqueue-scripts.php línea 171)
|
||||
- NAVBAR → navbar.css (registrado en enqueue-scripts.php línea 180)
|
||||
- BOTÓN LET'S TALK → buttons.css (registrado en enqueue-scripts.php línea 189)
|
||||
- HERO SECTION → hero.css y hero-section.css (ya registrados)
|
||||
- FEATURED IMAGE → featured-image.css (pendiente crear si es necesario)
|
||||
- POST CONTENT → post-content.css (ya registrado línea 141)
|
||||
|
||||
Issue #121 - Limpieza masiva de style.css
|
||||
Commit: ARQUITECTURA: Mover componentes de style.css a archivos individuales
|
||||
|
||||
======================================== */
|
||||
BIN
Assets/fonts/poppins-v24-latin-500.woff2
Normal file
BIN
Assets/fonts/poppins-v24-latin-500.woff2
Normal file
Binary file not shown.
BIN
Assets/fonts/poppins-v24-latin-600.woff2
Normal file
BIN
Assets/fonts/poppins-v24-latin-600.woff2
Normal file
Binary file not shown.
BIN
Assets/fonts/poppins-v24-latin-700.woff2
Normal file
BIN
Assets/fonts/poppins-v24-latin-700.woff2
Normal file
Binary file not shown.
BIN
Assets/fonts/poppins-v24-latin-regular.woff2
Normal file
BIN
Assets/fonts/poppins-v24-latin-regular.woff2
Normal file
Binary file not shown.
545
Assets/js/accessibility.js
Normal file
545
Assets/js/accessibility.js
Normal file
@@ -0,0 +1,545 @@
|
||||
/**
|
||||
* Accessibility JavaScript
|
||||
*
|
||||
* Mejoras de accesibilidad para navegación por teclado, gestión de focus,
|
||||
* y cumplimiento de WCAG 2.1 Level AA.
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Inicializar todas las funciones de accesibilidad
|
||||
*/
|
||||
function init() {
|
||||
setupSkipLinks();
|
||||
setupKeyboardNavigation();
|
||||
setupFocusManagement();
|
||||
setupAriaLiveRegions();
|
||||
announcePageChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* Skip Links - Navegación rápida al contenido principal
|
||||
* Permite a usuarios de teclado y lectores de pantalla saltar directamente al contenido
|
||||
*/
|
||||
function setupSkipLinks() {
|
||||
const skipLinks = document.querySelectorAll('.skip-link');
|
||||
|
||||
skipLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function(e) {
|
||||
const targetId = this.getAttribute('href');
|
||||
const targetElement = document.querySelector(targetId);
|
||||
|
||||
if (targetElement) {
|
||||
e.preventDefault();
|
||||
|
||||
// Hacer el elemento focusable temporalmente
|
||||
targetElement.setAttribute('tabindex', '-1');
|
||||
|
||||
// Enfocar el elemento
|
||||
targetElement.focus();
|
||||
|
||||
// Scroll al elemento si está fuera de vista
|
||||
targetElement.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
|
||||
// Remover tabindex después del focus para no interferir con navegación normal
|
||||
targetElement.addEventListener('blur', function() {
|
||||
targetElement.removeAttribute('tabindex');
|
||||
}, { once: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Navegación por Teclado Mejorada
|
||||
* Maneja la navegación con teclas en menús desplegables y componentes interactivos
|
||||
*/
|
||||
function setupKeyboardNavigation() {
|
||||
// Navegación en menús desplegables de Bootstrap
|
||||
setupBootstrapDropdownKeyboard();
|
||||
|
||||
// Navegación en menús personalizados
|
||||
setupCustomMenuKeyboard();
|
||||
|
||||
// Escapar de modales con ESC
|
||||
setupModalEscape();
|
||||
}
|
||||
|
||||
/**
|
||||
* Navegación por teclado en dropdowns de Bootstrap
|
||||
*/
|
||||
function setupBootstrapDropdownKeyboard() {
|
||||
const dropdownToggles = document.querySelectorAll('[data-bs-toggle="dropdown"]');
|
||||
|
||||
dropdownToggles.forEach(function(toggle) {
|
||||
const dropdown = toggle.nextElementSibling;
|
||||
|
||||
if (!dropdown || !dropdown.classList.contains('dropdown-menu')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Abrir dropdown con Enter o Space
|
||||
toggle.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
toggle.click();
|
||||
|
||||
// Focus en el primer item del menú
|
||||
setTimeout(function() {
|
||||
const firstItem = dropdown.querySelector('a, button');
|
||||
if (firstItem) {
|
||||
firstItem.focus();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
// Flecha abajo para abrir y enfocar primer item
|
||||
if (e.key === 'ArrowDown') {
|
||||
e.preventDefault();
|
||||
if (!dropdown.classList.contains('show')) {
|
||||
toggle.click();
|
||||
}
|
||||
setTimeout(function() {
|
||||
const firstItem = dropdown.querySelector('a, button');
|
||||
if (firstItem) {
|
||||
firstItem.focus();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
// Navegación dentro del dropdown con flechas
|
||||
dropdown.addEventListener('keydown', function(e) {
|
||||
const items = Array.from(dropdown.querySelectorAll('a, button'));
|
||||
const currentIndex = items.indexOf(document.activeElement);
|
||||
|
||||
if (e.key === 'ArrowDown') {
|
||||
e.preventDefault();
|
||||
const nextIndex = (currentIndex + 1) % items.length;
|
||||
items[nextIndex].focus();
|
||||
}
|
||||
|
||||
if (e.key === 'ArrowUp') {
|
||||
e.preventDefault();
|
||||
const prevIndex = currentIndex - 1 < 0 ? items.length - 1 : currentIndex - 1;
|
||||
items[prevIndex].focus();
|
||||
}
|
||||
|
||||
if (e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
toggle.click(); // Cerrar dropdown
|
||||
toggle.focus(); // Devolver focus al toggle
|
||||
}
|
||||
|
||||
if (e.key === 'Tab') {
|
||||
// Permitir tab normal pero cerrar dropdown
|
||||
toggle.click();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Navegación por teclado en menús personalizados (WordPress)
|
||||
*/
|
||||
function setupCustomMenuKeyboard() {
|
||||
const menuItems = document.querySelectorAll('.menu-item-has-children > a');
|
||||
|
||||
menuItems.forEach(function(link) {
|
||||
const parentItem = link.parentElement;
|
||||
const submenu = parentItem.querySelector('.sub-menu');
|
||||
|
||||
if (!submenu) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Inicializar ARIA attributes
|
||||
link.setAttribute('aria-haspopup', 'true');
|
||||
link.setAttribute('aria-expanded', 'false');
|
||||
submenu.setAttribute('aria-hidden', 'true');
|
||||
|
||||
// Toggle submenu con Enter o Space
|
||||
link.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
toggleSubmenu(parentItem, submenu, link);
|
||||
}
|
||||
|
||||
// Flecha derecha para abrir submenu
|
||||
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
|
||||
e.preventDefault();
|
||||
openSubmenu(parentItem, submenu, link);
|
||||
|
||||
// Focus en primer item del submenu
|
||||
const firstItem = submenu.querySelector('a');
|
||||
if (firstItem) {
|
||||
firstItem.focus();
|
||||
}
|
||||
}
|
||||
|
||||
// Escape para cerrar submenu
|
||||
if (e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
closeSubmenu(parentItem, submenu, link);
|
||||
link.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Navegación dentro del submenu
|
||||
const submenuItems = submenu.querySelectorAll('a');
|
||||
submenuItems.forEach(function(item, index) {
|
||||
item.addEventListener('keydown', function(e) {
|
||||
// Flecha arriba/abajo para navegar entre items
|
||||
if (e.key === 'ArrowDown') {
|
||||
e.preventDefault();
|
||||
const nextItem = submenuItems[index + 1];
|
||||
if (nextItem) {
|
||||
nextItem.focus();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.key === 'ArrowUp') {
|
||||
e.preventDefault();
|
||||
if (index === 0) {
|
||||
link.focus();
|
||||
} else {
|
||||
submenuItems[index - 1].focus();
|
||||
}
|
||||
}
|
||||
|
||||
// Flecha izquierda para volver al menú padre
|
||||
if (e.key === 'ArrowLeft') {
|
||||
e.preventDefault();
|
||||
closeSubmenu(parentItem, submenu, link);
|
||||
link.focus();
|
||||
}
|
||||
|
||||
// Escape para cerrar submenu
|
||||
if (e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
closeSubmenu(parentItem, submenu, link);
|
||||
link.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Cerrar submenu cuando focus sale del elemento
|
||||
parentItem.addEventListener('focusout', function(e) {
|
||||
// Verificar si el nuevo focus está fuera del menú
|
||||
setTimeout(function() {
|
||||
if (!parentItem.contains(document.activeElement)) {
|
||||
closeSubmenu(parentItem, submenu, link);
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle submenu (abrir/cerrar)
|
||||
*/
|
||||
function toggleSubmenu(parentItem, submenu, link) {
|
||||
const isOpen = parentItem.classList.contains('submenu-open');
|
||||
|
||||
if (isOpen) {
|
||||
closeSubmenu(parentItem, submenu, link);
|
||||
} else {
|
||||
openSubmenu(parentItem, submenu, link);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Abrir submenu
|
||||
*/
|
||||
function openSubmenu(parentItem, submenu, link) {
|
||||
parentItem.classList.add('submenu-open');
|
||||
link.setAttribute('aria-expanded', 'true');
|
||||
submenu.setAttribute('aria-hidden', 'false');
|
||||
}
|
||||
|
||||
/**
|
||||
* Cerrar submenu
|
||||
*/
|
||||
function closeSubmenu(parentItem, submenu, link) {
|
||||
parentItem.classList.remove('submenu-open');
|
||||
link.setAttribute('aria-expanded', 'false');
|
||||
submenu.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
/**
|
||||
* Cerrar modales con tecla Escape
|
||||
*/
|
||||
function setupModalEscape() {
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape') {
|
||||
// Bootstrap modals
|
||||
const openModals = document.querySelectorAll('.modal.show');
|
||||
openModals.forEach(function(modal) {
|
||||
const bsModal = bootstrap.Modal.getInstance(modal);
|
||||
if (bsModal) {
|
||||
bsModal.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Offcanvas
|
||||
const openOffcanvas = document.querySelectorAll('.offcanvas.show');
|
||||
openOffcanvas.forEach(function(offcanvas) {
|
||||
const bsOffcanvas = bootstrap.Offcanvas.getInstance(offcanvas);
|
||||
if (bsOffcanvas) {
|
||||
bsOffcanvas.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestión de Focus
|
||||
* Maneja el focus visible y trap de focus en modales
|
||||
*/
|
||||
function setupFocusManagement() {
|
||||
// Mostrar outline solo con navegación por teclado
|
||||
setupFocusVisible();
|
||||
|
||||
// Trap focus en modales
|
||||
setupModalFocusTrap();
|
||||
|
||||
// Restaurar focus al cerrar modales
|
||||
setupFocusRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
* Focus visible solo con teclado (no con mouse)
|
||||
*/
|
||||
function setupFocusVisible() {
|
||||
let usingMouse = false;
|
||||
|
||||
document.addEventListener('mousedown', function() {
|
||||
usingMouse = true;
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Tab') {
|
||||
usingMouse = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Agregar clase al body para indicar método de navegación
|
||||
document.addEventListener('focusin', function() {
|
||||
if (usingMouse) {
|
||||
document.body.classList.add('using-mouse');
|
||||
} else {
|
||||
document.body.classList.remove('using-mouse');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Trap focus dentro de modales (evitar que Tab salga del modal)
|
||||
*/
|
||||
function setupModalFocusTrap() {
|
||||
const modals = document.querySelectorAll('.modal, [role="dialog"]');
|
||||
|
||||
modals.forEach(function(modal) {
|
||||
modal.addEventListener('keydown', function(e) {
|
||||
if (e.key !== 'Tab') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Solo aplicar trap si el modal está visible
|
||||
if (!modal.classList.contains('show') && modal.style.display !== 'block') {
|
||||
return;
|
||||
}
|
||||
|
||||
const focusableElements = modal.querySelectorAll(
|
||||
'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])'
|
||||
);
|
||||
|
||||
if (focusableElements.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const firstElement = focusableElements[0];
|
||||
const lastElement = focusableElements[focusableElements.length - 1];
|
||||
|
||||
if (e.shiftKey) {
|
||||
// Shift + Tab - navegar hacia atrás
|
||||
if (document.activeElement === firstElement) {
|
||||
e.preventDefault();
|
||||
lastElement.focus();
|
||||
}
|
||||
} else {
|
||||
// Tab - navegar hacia adelante
|
||||
if (document.activeElement === lastElement) {
|
||||
e.preventDefault();
|
||||
firstElement.focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Restaurar focus al elemento que abrió el modal
|
||||
*/
|
||||
function setupFocusRestore() {
|
||||
let lastFocusedElement = null;
|
||||
|
||||
// Guardar elemento con focus antes de abrir modal
|
||||
document.addEventListener('show.bs.modal', function(e) {
|
||||
lastFocusedElement = document.activeElement;
|
||||
});
|
||||
|
||||
document.addEventListener('show.bs.offcanvas', function(e) {
|
||||
lastFocusedElement = document.activeElement;
|
||||
});
|
||||
|
||||
// Restaurar focus al cerrar modal
|
||||
document.addEventListener('hidden.bs.modal', function(e) {
|
||||
if (lastFocusedElement) {
|
||||
lastFocusedElement.focus();
|
||||
lastFocusedElement = null;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('hidden.bs.offcanvas', function(e) {
|
||||
if (lastFocusedElement) {
|
||||
lastFocusedElement.focus();
|
||||
lastFocusedElement = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ARIA Live Regions
|
||||
* Crear regiones live para anuncios dinámicos a lectores de pantalla
|
||||
*/
|
||||
function setupAriaLiveRegions() {
|
||||
// Crear región live polite si no existe
|
||||
if (!document.getElementById('aria-live-polite')) {
|
||||
const liveRegion = document.createElement('div');
|
||||
liveRegion.id = 'aria-live-polite';
|
||||
liveRegion.setAttribute('aria-live', 'polite');
|
||||
liveRegion.setAttribute('aria-atomic', 'true');
|
||||
liveRegion.className = 'sr-only';
|
||||
document.body.appendChild(liveRegion);
|
||||
}
|
||||
|
||||
// Crear región live assertive si no existe
|
||||
if (!document.getElementById('aria-live-assertive')) {
|
||||
const liveRegion = document.createElement('div');
|
||||
liveRegion.id = 'aria-live-assertive';
|
||||
liveRegion.setAttribute('aria-live', 'assertive');
|
||||
liveRegion.setAttribute('aria-atomic', 'true');
|
||||
liveRegion.className = 'sr-only';
|
||||
document.body.appendChild(liveRegion);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Anunciar cambios de página a lectores de pantalla
|
||||
*/
|
||||
function announcePageChanges() {
|
||||
// Anunciar cambios de ruta en navegación (para SPAs o AJAX)
|
||||
let currentPath = window.location.pathname;
|
||||
|
||||
// Observer para cambios en el título de la página
|
||||
const titleObserver = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type === 'childList') {
|
||||
const newTitle = document.title;
|
||||
announce('Página cargada: ' + newTitle, 'polite');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const titleElement = document.querySelector('title');
|
||||
if (titleElement) {
|
||||
titleObserver.observe(titleElement, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
|
||||
// Detectar navegación por history API
|
||||
const originalPushState = history.pushState;
|
||||
history.pushState = function() {
|
||||
originalPushState.apply(history, arguments);
|
||||
|
||||
if (window.location.pathname !== currentPath) {
|
||||
currentPath = window.location.pathname;
|
||||
setTimeout(function() {
|
||||
announce('Página cargada: ' + document.title, 'polite');
|
||||
}, 500);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Función helper para anunciar mensajes a lectores de pantalla
|
||||
*
|
||||
* @param {string} message - Mensaje a anunciar
|
||||
* @param {string} priority - 'polite' o 'assertive'
|
||||
*/
|
||||
window.announceToScreenReader = function(message, priority) {
|
||||
announce(message, priority);
|
||||
};
|
||||
|
||||
function announce(message, priority) {
|
||||
priority = priority || 'polite';
|
||||
const liveRegionId = 'aria-live-' + priority;
|
||||
const liveRegion = document.getElementById(liveRegionId);
|
||||
|
||||
if (!liveRegion) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Limpiar y agregar mensaje
|
||||
liveRegion.textContent = '';
|
||||
setTimeout(function() {
|
||||
liveRegion.textContent = message;
|
||||
}, 100);
|
||||
|
||||
// Limpiar después de 5 segundos
|
||||
setTimeout(function() {
|
||||
liveRegion.textContent = '';
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manejar clicks en elementos con data-announce
|
||||
* Permite anunciar acciones a lectores de pantalla
|
||||
*/
|
||||
function setupDataAnnounce() {
|
||||
document.addEventListener('click', function(e) {
|
||||
const target = e.target.closest('[data-announce]');
|
||||
if (target) {
|
||||
const message = target.getAttribute('data-announce');
|
||||
const priority = target.getAttribute('data-announce-priority') || 'polite';
|
||||
announce(message, priority);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Inicializar cuando DOM está listo
|
||||
*/
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
init();
|
||||
setupDataAnnounce();
|
||||
});
|
||||
} else {
|
||||
init();
|
||||
setupDataAnnounce();
|
||||
}
|
||||
|
||||
})();
|
||||
216
Assets/js/adsense-loader.js
Normal file
216
Assets/js/adsense-loader.js
Normal file
@@ -0,0 +1,216 @@
|
||||
/**
|
||||
* Cargador Retrasado de AdSense
|
||||
*
|
||||
* Este script retrasa la carga de Google AdSense hasta que haya interacción
|
||||
* del usuario o se cumpla un timeout, mejorando el rendimiento de carga inicial.
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Configuración
|
||||
const CONFIG = {
|
||||
timeout: 5000, // Timeout de fallback en milisegundos
|
||||
loadedClass: 'adsense-loaded',
|
||||
debug: false // Cambiar a true para logs en consola
|
||||
};
|
||||
|
||||
// Estado
|
||||
let adsenseLoaded = false;
|
||||
let loadTimeout = null;
|
||||
|
||||
/**
|
||||
* Registra mensajes de debug si el modo debug está habilitado
|
||||
* @param {string} message - El mensaje a registrar
|
||||
*/
|
||||
function debugLog(message) {
|
||||
if (CONFIG.debug && typeof console !== 'undefined') {
|
||||
console.log('[AdSense Loader] ' + message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Carga los scripts de AdSense e inicializa los ads
|
||||
*/
|
||||
function loadAdSense() {
|
||||
// Prevenir múltiples cargas
|
||||
if (adsenseLoaded) {
|
||||
debugLog('AdSense ya fue cargado, omitiendo...');
|
||||
return;
|
||||
}
|
||||
|
||||
adsenseLoaded = true;
|
||||
debugLog('Cargando scripts de AdSense...');
|
||||
|
||||
// Limpiar el timeout si existe
|
||||
if (loadTimeout) {
|
||||
clearTimeout(loadTimeout);
|
||||
loadTimeout = null;
|
||||
}
|
||||
|
||||
// Remover event listeners para prevenir múltiples triggers
|
||||
removeEventListeners();
|
||||
|
||||
// Cargar etiquetas de script de AdSense
|
||||
loadAdSenseScripts();
|
||||
|
||||
// Ejecutar scripts de push de AdSense
|
||||
executeAdSensePushScripts();
|
||||
|
||||
// Agregar clase loaded al body
|
||||
document.body.classList.add(CONFIG.loadedClass);
|
||||
|
||||
debugLog('Carga de AdSense completada');
|
||||
}
|
||||
|
||||
/**
|
||||
* Encuentra y carga todas las etiquetas de script de AdSense retrasadas
|
||||
*/
|
||||
function loadAdSenseScripts() {
|
||||
const delayedScripts = document.querySelectorAll('script[data-adsense-script]');
|
||||
|
||||
if (delayedScripts.length === 0) {
|
||||
debugLog('No se encontraron scripts retrasados de AdSense');
|
||||
return;
|
||||
}
|
||||
|
||||
debugLog('Se encontraron ' + delayedScripts.length + ' script(s) retrasado(s) de AdSense');
|
||||
|
||||
delayedScripts.forEach(function(oldScript) {
|
||||
const newScript = document.createElement('script');
|
||||
|
||||
// Copiar atributos
|
||||
if (oldScript.src) {
|
||||
newScript.src = oldScript.src;
|
||||
}
|
||||
|
||||
// Establecer atributo async
|
||||
newScript.async = true;
|
||||
|
||||
// Copiar crossorigin si está presente
|
||||
if (oldScript.getAttribute('crossorigin')) {
|
||||
newScript.crossorigin = oldScript.getAttribute('crossorigin');
|
||||
}
|
||||
|
||||
// Reemplazar script viejo con el nuevo
|
||||
oldScript.parentNode.replaceChild(newScript, oldScript);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Ejecuta scripts de push de AdSense retrasados
|
||||
*/
|
||||
function executeAdSensePushScripts() {
|
||||
const delayedPushScripts = document.querySelectorAll('script[data-adsense-push]');
|
||||
|
||||
if (delayedPushScripts.length === 0) {
|
||||
debugLog('No se encontraron scripts de push retrasados de AdSense');
|
||||
return;
|
||||
}
|
||||
|
||||
debugLog('Se encontraron ' + delayedPushScripts.length + ' script(s) de push retrasado(s)');
|
||||
|
||||
// Inicializar array adsbygoogle si no existe
|
||||
window.adsbygoogle = window.adsbygoogle || [];
|
||||
|
||||
delayedPushScripts.forEach(function(oldScript) {
|
||||
const scriptContent = oldScript.innerHTML;
|
||||
|
||||
// Crear y ejecutar nuevo script
|
||||
const newScript = document.createElement('script');
|
||||
newScript.innerHTML = scriptContent;
|
||||
newScript.type = 'text/javascript';
|
||||
|
||||
// Reemplazar script viejo con el nuevo
|
||||
oldScript.parentNode.replaceChild(newScript, oldScript);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Manejador de eventos para interacciones del usuario
|
||||
*/
|
||||
function handleUserInteraction() {
|
||||
debugLog('Interacción del usuario detectada');
|
||||
loadAdSense();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remueve todos los event listeners
|
||||
*/
|
||||
function removeEventListeners() {
|
||||
window.removeEventListener('scroll', handleUserInteraction, { passive: true });
|
||||
window.removeEventListener('mousemove', handleUserInteraction, { passive: true });
|
||||
window.removeEventListener('touchstart', handleUserInteraction, { passive: true });
|
||||
window.removeEventListener('click', handleUserInteraction, { passive: true });
|
||||
window.removeEventListener('keydown', handleUserInteraction, { passive: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Agrega event listeners para interacciones del usuario
|
||||
*/
|
||||
function addEventListeners() {
|
||||
debugLog('Agregando event listeners para interacción del usuario');
|
||||
|
||||
// Evento de scroll - cargar en primer scroll
|
||||
window.addEventListener('scroll', handleUserInteraction, { passive: true, once: true });
|
||||
|
||||
// Movimiento de mouse - cargar cuando el usuario mueve el mouse
|
||||
window.addEventListener('mousemove', handleUserInteraction, { passive: true, once: true });
|
||||
|
||||
// Eventos táctiles - cargar en primer toque (móviles)
|
||||
window.addEventListener('touchstart', handleUserInteraction, { passive: true, once: true });
|
||||
|
||||
// Eventos de click - cargar en primer click
|
||||
window.addEventListener('click', handleUserInteraction, { passive: true, once: true });
|
||||
|
||||
// Eventos de teclado - cargar en primera pulsación de tecla
|
||||
window.addEventListener('keydown', handleUserInteraction, { passive: true, once: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Establece timeout de fallback para cargar AdSense después del tiempo especificado
|
||||
*/
|
||||
function setTimeoutFallback() {
|
||||
debugLog('Estableciendo timeout de fallback (' + CONFIG.timeout + 'ms)');
|
||||
|
||||
loadTimeout = setTimeout(function() {
|
||||
debugLog('Timeout alcanzado, cargando AdSense');
|
||||
loadAdSense();
|
||||
}, CONFIG.timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inicializa el cargador retrasado de AdSense
|
||||
*/
|
||||
function init() {
|
||||
// Verificar si el retardo de AdSense está habilitado
|
||||
if (!window.roidsenseDelayed) {
|
||||
debugLog('Retardo de AdSense no habilitado');
|
||||
return;
|
||||
}
|
||||
|
||||
debugLog('Inicializando cargador retrasado de AdSense');
|
||||
|
||||
// Verificar si la página ya está interactiva o completa
|
||||
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
||||
debugLog('Página ya cargada, iniciando listeners');
|
||||
addEventListeners();
|
||||
setTimeoutFallback();
|
||||
} else {
|
||||
// Esperar a que el DOM esté listo
|
||||
debugLog('Esperando a DOMContentLoaded');
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
debugLog('DOMContentLoaded disparado');
|
||||
addEventListeners();
|
||||
setTimeoutFallback();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Iniciar inicialización
|
||||
init();
|
||||
|
||||
})();
|
||||
99
Assets/js/apu-tables-auto-class.js
Normal file
99
Assets/js/apu-tables-auto-class.js
Normal file
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Auto-detectar y agregar clases a filas especiales de tablas APU
|
||||
*
|
||||
* Este script detecta automáticamente filas especiales en tablas .desglose y .analisis
|
||||
* y les agrega las clases CSS correspondientes para que se apliquen los estilos correctos.
|
||||
*
|
||||
* Detecta:
|
||||
* - Section headers: Material, Mano de Obra, Herramienta, Equipo
|
||||
* - Subtotal rows: Filas que empiezan con "Suma de"
|
||||
* - Total row: Costo Directo
|
||||
*
|
||||
* @package Apus_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Agrega clases a filas especiales de tablas APU
|
||||
*/
|
||||
function applyApuTableClasses() {
|
||||
// Buscar todas las tablas con clase .desglose o .analisis
|
||||
const tables = document.querySelectorAll('.desglose table, .analisis table');
|
||||
|
||||
if (tables.length === 0) {
|
||||
return; // No hay tablas APU en esta página
|
||||
}
|
||||
|
||||
let classesAdded = 0;
|
||||
|
||||
tables.forEach(function(table) {
|
||||
const rows = table.querySelectorAll('tbody tr');
|
||||
|
||||
rows.forEach(function(row) {
|
||||
// Evitar procesar filas que ya tienen clase
|
||||
if (row.classList.contains('section-header') ||
|
||||
row.classList.contains('subtotal-row') ||
|
||||
row.classList.contains('total-row')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const secondCell = row.querySelector('td:nth-child(2)');
|
||||
if (!secondCell) {
|
||||
return; // Fila sin segunda celda
|
||||
}
|
||||
|
||||
const text = secondCell.textContent.trim();
|
||||
|
||||
// Detectar section headers
|
||||
if (text === 'Material' ||
|
||||
text === 'Mano de Obra' ||
|
||||
text === 'Herramienta' ||
|
||||
text === 'Equipo' ||
|
||||
text === 'MATERIAL' ||
|
||||
text === 'MANO DE OBRA' ||
|
||||
text === 'HERRAMIENTA' ||
|
||||
text === 'EQUIPO') {
|
||||
row.classList.add('section-header');
|
||||
classesAdded++;
|
||||
return;
|
||||
}
|
||||
|
||||
// Detectar subtotales (cualquier variación de "Suma de")
|
||||
if (text.toLowerCase().startsWith('suma de ') ||
|
||||
text.toLowerCase().startsWith('subtotal ')) {
|
||||
row.classList.add('subtotal-row');
|
||||
classesAdded++;
|
||||
return;
|
||||
}
|
||||
|
||||
// Detectar total final
|
||||
if (text === 'Costo Directo' ||
|
||||
text === 'COSTO DIRECTO' ||
|
||||
text === 'Total' ||
|
||||
text === 'TOTAL' ||
|
||||
text === 'Costo directo') {
|
||||
row.classList.add('total-row');
|
||||
classesAdded++;
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Log para debugging (solo en desarrollo)
|
||||
if (classesAdded > 0 && window.console) {
|
||||
console.log('[APU Tables] Clases agregadas automáticamente: ' + classesAdded);
|
||||
}
|
||||
}
|
||||
|
||||
// Ejecutar cuando el DOM esté listo
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', applyApuTableClasses);
|
||||
} else {
|
||||
// DOM ya está listo
|
||||
applyApuTableClasses();
|
||||
}
|
||||
|
||||
})();
|
||||
7
Assets/js/bootstrap.bundle.min.js
vendored
Normal file
7
Assets/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
343
Assets/js/footer-contact.js
Normal file
343
Assets/js/footer-contact.js
Normal file
@@ -0,0 +1,343 @@
|
||||
/**
|
||||
* Footer Contact Form Handler (Issue #37)
|
||||
*
|
||||
* Maneja la validación, envío y tracking del formulario de contacto del footer.
|
||||
* Incluye:
|
||||
* - Validaciones de email y WhatsApp
|
||||
* - Envío a webhook
|
||||
* - Google Analytics 4 tracking
|
||||
* - Estados de loading y mensajes de feedback
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Configuración del webhook
|
||||
const WEBHOOK_URL = 'https://hook.us2.make.com/iq8p4q9w50a12crlb58d4h1o6lwu4f47';
|
||||
const FORM_SOURCE = 'ROI Website - Footer Contact Form';
|
||||
|
||||
// Expresiones regulares para validación
|
||||
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
const WHATSAPP_REGEX = /^\+?[\d\s-]{10,15}$/;
|
||||
|
||||
/**
|
||||
* Inicializar el formulario cuando el DOM está listo
|
||||
*/
|
||||
function init() {
|
||||
const form = document.getElementById('footerContactForm');
|
||||
if (!form) return;
|
||||
|
||||
// Agregar event listeners
|
||||
form.addEventListener('submit', handleSubmit);
|
||||
|
||||
// Validación en tiempo real para campos específicos
|
||||
const emailInput = document.getElementById('footerEmail');
|
||||
const whatsappInput = document.getElementById('footerWhatsapp');
|
||||
|
||||
if (emailInput) {
|
||||
emailInput.addEventListener('blur', function() {
|
||||
validateEmail(this);
|
||||
});
|
||||
emailInput.addEventListener('input', function() {
|
||||
if (this.classList.contains('is-invalid')) {
|
||||
validateEmail(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (whatsappInput) {
|
||||
whatsappInput.addEventListener('blur', function() {
|
||||
validateWhatsApp(this);
|
||||
});
|
||||
whatsappInput.addEventListener('input', function() {
|
||||
if (this.classList.contains('is-invalid')) {
|
||||
validateWhatsApp(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validar email
|
||||
* @param {HTMLInputElement} input - Campo de input
|
||||
* @returns {boolean} - True si es válido
|
||||
*/
|
||||
function validateEmail(input) {
|
||||
const value = input.value.trim();
|
||||
const isValid = EMAIL_REGEX.test(value);
|
||||
|
||||
if (value === '') {
|
||||
input.classList.remove('is-valid', 'is-invalid');
|
||||
return true; // Si está vacío pero no es requerido, es válido
|
||||
}
|
||||
|
||||
if (isValid) {
|
||||
input.classList.remove('is-invalid');
|
||||
input.classList.add('is-valid');
|
||||
} else {
|
||||
input.classList.remove('is-valid');
|
||||
input.classList.add('is-invalid');
|
||||
}
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validar WhatsApp (10-15 dígitos)
|
||||
* @param {HTMLInputElement} input - Campo de input
|
||||
* @returns {boolean} - True si es válido
|
||||
*/
|
||||
function validateWhatsApp(input) {
|
||||
const value = input.value.trim();
|
||||
// Remover espacios, guiones y signos + para contar solo dígitos
|
||||
const digitsOnly = value.replace(/[\s\-+]/g, '');
|
||||
const isValid = WHATSAPP_REGEX.test(value) && digitsOnly.length >= 10 && digitsOnly.length <= 15;
|
||||
|
||||
if (value === '') {
|
||||
input.classList.remove('is-valid', 'is-invalid');
|
||||
return false; // WhatsApp es requerido
|
||||
}
|
||||
|
||||
if (isValid) {
|
||||
input.classList.remove('is-invalid');
|
||||
input.classList.add('is-valid');
|
||||
} else {
|
||||
input.classList.remove('is-valid');
|
||||
input.classList.add('is-invalid');
|
||||
}
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validar todos los campos del formulario
|
||||
* @param {HTMLFormElement} form - Formulario
|
||||
* @returns {boolean} - True si todo es válido
|
||||
*/
|
||||
function validateForm(form) {
|
||||
let isValid = true;
|
||||
|
||||
// Validar campos requeridos
|
||||
const fullName = form.querySelector('#footerFullName');
|
||||
const email = form.querySelector('#footerEmail');
|
||||
const whatsapp = form.querySelector('#footerWhatsapp');
|
||||
|
||||
if (fullName && fullName.value.trim() === '') {
|
||||
fullName.classList.add('is-invalid');
|
||||
isValid = false;
|
||||
} else if (fullName) {
|
||||
fullName.classList.remove('is-invalid');
|
||||
fullName.classList.add('is-valid');
|
||||
}
|
||||
|
||||
if (email && !validateEmail(email)) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (whatsapp && !validateWhatsApp(whatsapp)) {
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mostrar mensaje de feedback
|
||||
* @param {string} message - Mensaje a mostrar
|
||||
* @param {string} type - Tipo: 'success', 'danger', 'info'
|
||||
*/
|
||||
function showMessage(message, type) {
|
||||
const messageDiv = document.getElementById('footerFormMessage');
|
||||
if (!messageDiv) return;
|
||||
|
||||
messageDiv.className = 'col-12 mt-2 alert alert-' + type;
|
||||
messageDiv.textContent = message;
|
||||
messageDiv.style.display = 'block';
|
||||
messageDiv.classList.add('show');
|
||||
|
||||
// Scroll suave al mensaje
|
||||
messageDiv.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||
|
||||
// Auto-ocultar mensajes de éxito después de 5 segundos
|
||||
if (type === 'success') {
|
||||
setTimeout(function() {
|
||||
hideMessage();
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ocultar mensaje
|
||||
*/
|
||||
function hideMessage() {
|
||||
const messageDiv = document.getElementById('footerFormMessage');
|
||||
if (!messageDiv) return;
|
||||
|
||||
messageDiv.classList.remove('show');
|
||||
setTimeout(function() {
|
||||
messageDiv.style.display = 'none';
|
||||
}, 150);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackear evento en Google Analytics 4
|
||||
* @param {string} eventName - Nombre del evento
|
||||
* @param {Object} params - Parámetros adicionales
|
||||
*/
|
||||
function trackGA4Event(eventName, params) {
|
||||
if (typeof gtag === 'function') {
|
||||
gtag('event', eventName, params);
|
||||
} else if (typeof dataLayer !== 'undefined') {
|
||||
dataLayer.push({
|
||||
'event': eventName,
|
||||
...params
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Preparar datos del formulario
|
||||
* @param {HTMLFormElement} form - Formulario
|
||||
* @returns {Object} - Datos del formulario
|
||||
*/
|
||||
function getFormData(form) {
|
||||
return {
|
||||
fullName: form.querySelector('#footerFullName').value.trim(),
|
||||
company: form.querySelector('#footerCompany').value.trim() || 'N/A',
|
||||
whatsapp: form.querySelector('#footerWhatsapp').value.trim(),
|
||||
email: form.querySelector('#footerEmail').value.trim(),
|
||||
comments: form.querySelector('#footerComments').value.trim() || 'Sin comentarios',
|
||||
source: FORM_SOURCE,
|
||||
timestamp: new Date().toISOString(),
|
||||
pageUrl: window.location.href,
|
||||
pageTitle: document.title
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Enviar datos al webhook
|
||||
* @param {Object} data - Datos a enviar
|
||||
* @returns {Promise} - Promesa de fetch
|
||||
*/
|
||||
async function sendToWebhook(data) {
|
||||
const response = await fetch(WEBHOOK_URL, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Error en el servidor: ' + response.status);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resetear el formulario
|
||||
* @param {HTMLFormElement} form - Formulario
|
||||
*/
|
||||
function resetForm(form) {
|
||||
form.reset();
|
||||
|
||||
// Remover todas las clases de validación
|
||||
const inputs = form.querySelectorAll('.form-control');
|
||||
inputs.forEach(function(input) {
|
||||
input.classList.remove('is-valid', 'is-invalid');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Manejar el envío del formulario
|
||||
* @param {Event} e - Evento de submit
|
||||
*/
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const form = e.target;
|
||||
const submitBtn = form.querySelector('button[type="submit"]');
|
||||
|
||||
// Ocultar mensaje anterior
|
||||
hideMessage();
|
||||
|
||||
// Validar formulario
|
||||
if (!validateForm(form)) {
|
||||
showMessage('Por favor, completa todos los campos requeridos correctamente.', 'danger');
|
||||
|
||||
// Track error de validación
|
||||
trackGA4Event('form_validation_error', {
|
||||
form_name: 'footer_contact',
|
||||
form_source: FORM_SOURCE
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Deshabilitar botón y mostrar loading
|
||||
submitBtn.disabled = true;
|
||||
submitBtn.classList.add('loading');
|
||||
const originalText = submitBtn.innerHTML;
|
||||
|
||||
// Track inicio de envío
|
||||
trackGA4Event('form_submit_start', {
|
||||
form_name: 'footer_contact',
|
||||
form_source: FORM_SOURCE
|
||||
});
|
||||
|
||||
try {
|
||||
// Preparar y enviar datos
|
||||
const formData = getFormData(form);
|
||||
await sendToWebhook(formData);
|
||||
|
||||
// Éxito
|
||||
showMessage('¡Gracias por tu mensaje! Nos pondremos en contacto contigo pronto.', 'success');
|
||||
resetForm(form);
|
||||
|
||||
// Track éxito
|
||||
trackGA4Event('form_submit_success', {
|
||||
form_name: 'footer_contact',
|
||||
form_source: FORM_SOURCE,
|
||||
has_company: formData.company !== 'N/A',
|
||||
has_comments: formData.comments !== 'Sin comentarios'
|
||||
});
|
||||
|
||||
// Track conversión
|
||||
trackGA4Event('generate_lead', {
|
||||
currency: 'MXN',
|
||||
value: 1,
|
||||
form_name: 'footer_contact',
|
||||
form_source: FORM_SOURCE
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error al enviar el formulario:', error);
|
||||
showMessage('Hubo un error al enviar tu mensaje. Por favor, intenta nuevamente.', 'danger');
|
||||
|
||||
// Track error
|
||||
trackGA4Event('form_submit_error', {
|
||||
form_name: 'footer_contact',
|
||||
form_source: FORM_SOURCE,
|
||||
error_message: error.message
|
||||
});
|
||||
|
||||
} finally {
|
||||
// Restaurar botón
|
||||
submitBtn.disabled = false;
|
||||
submitBtn.classList.remove('loading');
|
||||
submitBtn.innerHTML = originalText;
|
||||
}
|
||||
}
|
||||
|
||||
// Inicializar cuando el DOM esté listo
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
|
||||
})();
|
||||
342
Assets/js/header.js
Normal file
342
Assets/js/header.js
Normal file
@@ -0,0 +1,342 @@
|
||||
/**
|
||||
* Header Navigation JavaScript
|
||||
*
|
||||
* This file handles:
|
||||
* - Mobile hamburger menu toggle
|
||||
* - Sticky header behavior
|
||||
* - Smooth scroll to anchors (optional)
|
||||
* - Accessibility features (keyboard navigation, ARIA attributes)
|
||||
* - Body scroll locking when mobile menu is open
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Initialize on DOM ready
|
||||
*/
|
||||
function init() {
|
||||
setupMobileMenu();
|
||||
setupStickyHeader();
|
||||
setupSmoothScroll();
|
||||
setupKeyboardNavigation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mobile Menu Functionality
|
||||
*/
|
||||
function setupMobileMenu() {
|
||||
const mobileMenuToggle = document.getElementById('mobile-menu-toggle');
|
||||
const mobileMenu = document.getElementById('mobile-menu');
|
||||
const mobileMenuOverlay = document.getElementById('mobile-menu-overlay');
|
||||
const mobileMenuClose = document.getElementById('mobile-menu-close');
|
||||
|
||||
if (!mobileMenuToggle || !mobileMenu || !mobileMenuOverlay) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Open mobile menu
|
||||
mobileMenuToggle.addEventListener('click', function() {
|
||||
openMobileMenu();
|
||||
});
|
||||
|
||||
// Close mobile menu via close button
|
||||
if (mobileMenuClose) {
|
||||
mobileMenuClose.addEventListener('click', function() {
|
||||
closeMobileMenu();
|
||||
});
|
||||
}
|
||||
|
||||
// Close mobile menu via overlay click
|
||||
mobileMenuOverlay.addEventListener('click', function() {
|
||||
closeMobileMenu();
|
||||
});
|
||||
|
||||
// Close mobile menu on Escape key
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape' && mobileMenu.classList.contains('active')) {
|
||||
closeMobileMenu();
|
||||
mobileMenuToggle.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Close mobile menu when clicking a menu link
|
||||
const mobileMenuLinks = mobileMenu.querySelectorAll('a');
|
||||
mobileMenuLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
closeMobileMenu();
|
||||
});
|
||||
});
|
||||
|
||||
// Handle window resize - close mobile menu if switching to desktop
|
||||
let resizeTimer;
|
||||
window.addEventListener('resize', function() {
|
||||
clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(function() {
|
||||
if (window.innerWidth >= 768 && mobileMenu.classList.contains('active')) {
|
||||
closeMobileMenu();
|
||||
}
|
||||
}, 250);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Open mobile menu
|
||||
*/
|
||||
function openMobileMenu() {
|
||||
const mobileMenuToggle = document.getElementById('mobile-menu-toggle');
|
||||
const mobileMenu = document.getElementById('mobile-menu');
|
||||
const mobileMenuOverlay = document.getElementById('mobile-menu-overlay');
|
||||
|
||||
// Add active classes
|
||||
mobileMenu.classList.add('active');
|
||||
mobileMenuOverlay.classList.add('active');
|
||||
document.body.classList.add('mobile-menu-open');
|
||||
|
||||
// Update ARIA attributes
|
||||
mobileMenuToggle.setAttribute('aria-expanded', 'true');
|
||||
mobileMenu.setAttribute('aria-hidden', 'false');
|
||||
mobileMenuOverlay.setAttribute('aria-hidden', 'false');
|
||||
|
||||
// Focus trap - focus first menu item
|
||||
const firstMenuItem = mobileMenu.querySelector('a');
|
||||
if (firstMenuItem) {
|
||||
setTimeout(function() {
|
||||
firstMenuItem.focus();
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close mobile menu
|
||||
*/
|
||||
function closeMobileMenu() {
|
||||
const mobileMenuToggle = document.getElementById('mobile-menu-toggle');
|
||||
const mobileMenu = document.getElementById('mobile-menu');
|
||||
const mobileMenuOverlay = document.getElementById('mobile-menu-overlay');
|
||||
|
||||
// Remove active classes
|
||||
mobileMenu.classList.remove('active');
|
||||
mobileMenuOverlay.classList.remove('active');
|
||||
document.body.classList.remove('mobile-menu-open');
|
||||
|
||||
// Update ARIA attributes
|
||||
mobileMenuToggle.setAttribute('aria-expanded', 'false');
|
||||
mobileMenu.setAttribute('aria-hidden', 'true');
|
||||
mobileMenuOverlay.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sticky Header Behavior
|
||||
*/
|
||||
function setupStickyHeader() {
|
||||
const header = document.getElementById('masthead');
|
||||
|
||||
if (!header) {
|
||||
return;
|
||||
}
|
||||
|
||||
let lastScrollTop = 0;
|
||||
let scrollThreshold = 100;
|
||||
|
||||
window.addEventListener('scroll', function() {
|
||||
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
|
||||
// Add/remove scrolled class based on scroll position
|
||||
if (scrollTop > scrollThreshold) {
|
||||
header.classList.add('scrolled');
|
||||
} else {
|
||||
header.classList.remove('scrolled');
|
||||
}
|
||||
|
||||
lastScrollTop = scrollTop;
|
||||
}, { passive: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Smooth Scroll to Anchors (Optional)
|
||||
*/
|
||||
function setupSmoothScroll() {
|
||||
// Check if user prefers reduced motion
|
||||
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
if (prefersReducedMotion) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get all anchor links
|
||||
const anchorLinks = document.querySelectorAll('a[href^="#"]');
|
||||
|
||||
anchorLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function(e) {
|
||||
const href = this.getAttribute('href');
|
||||
|
||||
// Skip if href is just "#"
|
||||
if (href === '#') {
|
||||
return;
|
||||
}
|
||||
|
||||
const target = document.querySelector(href);
|
||||
|
||||
if (target) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get header height for offset
|
||||
const header = document.getElementById('masthead');
|
||||
const headerHeight = header ? header.offsetHeight : 0;
|
||||
const targetPosition = target.getBoundingClientRect().top + window.pageYOffset - headerHeight - 20;
|
||||
|
||||
window.scrollTo({
|
||||
top: targetPosition,
|
||||
behavior: prefersReducedMotion ? 'auto' : 'smooth'
|
||||
});
|
||||
|
||||
// Update URL hash
|
||||
if (history.pushState) {
|
||||
history.pushState(null, null, href);
|
||||
}
|
||||
|
||||
// Focus target element for accessibility
|
||||
target.setAttribute('tabindex', '-1');
|
||||
target.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Keyboard Navigation for Menus
|
||||
*/
|
||||
function setupKeyboardNavigation() {
|
||||
const menuItems = document.querySelectorAll('.primary-menu > li, .mobile-primary-menu > li');
|
||||
|
||||
menuItems.forEach(function(item) {
|
||||
const link = item.querySelector('a');
|
||||
const submenu = item.querySelector('.sub-menu');
|
||||
|
||||
if (!link || !submenu) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Open submenu on Enter/Space
|
||||
link.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
if (submenu) {
|
||||
e.preventDefault();
|
||||
toggleSubmenu(item, submenu);
|
||||
}
|
||||
}
|
||||
|
||||
// Close submenu on Escape
|
||||
if (e.key === 'Escape') {
|
||||
closeSubmenu(item, submenu);
|
||||
link.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Close submenu when focus leaves
|
||||
const submenuLinks = submenu.querySelectorAll('a');
|
||||
if (submenuLinks.length > 0) {
|
||||
const lastSubmenuLink = submenuLinks[submenuLinks.length - 1];
|
||||
|
||||
lastSubmenuLink.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Tab' && !e.shiftKey) {
|
||||
closeSubmenu(item, submenu);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle submenu visibility
|
||||
*/
|
||||
function toggleSubmenu(item, submenu) {
|
||||
const isExpanded = item.classList.contains('submenu-open');
|
||||
|
||||
if (isExpanded) {
|
||||
closeSubmenu(item, submenu);
|
||||
} else {
|
||||
openSubmenu(item, submenu);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Open submenu
|
||||
*/
|
||||
function openSubmenu(item, submenu) {
|
||||
item.classList.add('submenu-open');
|
||||
submenu.setAttribute('aria-hidden', 'false');
|
||||
|
||||
const firstLink = submenu.querySelector('a');
|
||||
if (firstLink) {
|
||||
firstLink.focus();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close submenu
|
||||
*/
|
||||
function closeSubmenu(item, submenu) {
|
||||
item.classList.remove('submenu-open');
|
||||
submenu.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
/**
|
||||
* Trap focus within mobile menu when open
|
||||
*/
|
||||
function setupFocusTrap() {
|
||||
const mobileMenu = document.getElementById('mobile-menu');
|
||||
|
||||
if (!mobileMenu) {
|
||||
return;
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (!mobileMenu.classList.contains('active')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.key === 'Tab') {
|
||||
const focusableElements = mobileMenu.querySelectorAll(
|
||||
'a, button, [tabindex]:not([tabindex="-1"])'
|
||||
);
|
||||
|
||||
const firstElement = focusableElements[0];
|
||||
const lastElement = focusableElements[focusableElements.length - 1];
|
||||
|
||||
if (e.shiftKey) {
|
||||
// Shift + Tab
|
||||
if (document.activeElement === firstElement) {
|
||||
e.preventDefault();
|
||||
lastElement.focus();
|
||||
}
|
||||
} else {
|
||||
// Tab
|
||||
if (document.activeElement === lastElement) {
|
||||
e.preventDefault();
|
||||
firstElement.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize focus trap
|
||||
*/
|
||||
setupFocusTrap();
|
||||
|
||||
/**
|
||||
* Initialize when DOM is ready
|
||||
*/
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
|
||||
})();
|
||||
312
Assets/js/main.js
Normal file
312
Assets/js/main.js
Normal file
@@ -0,0 +1,312 @@
|
||||
/**
|
||||
* ROI THEME - MAIN JAVASCRIPT
|
||||
*/
|
||||
|
||||
// Navbar scroll effect
|
||||
window.addEventListener('scroll', function() {
|
||||
const navbar = document.querySelector('.navbar');
|
||||
if (navbar) {
|
||||
if (window.scrollY > 50) {
|
||||
navbar.classList.add('scrolled');
|
||||
} else {
|
||||
navbar.classList.remove('scrolled');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* TOC (Table of Contents) - Handled by toc.js
|
||||
* No duplicate code needed here - toc.js provides:
|
||||
* - ScrollSpy with IntersectionObserver
|
||||
* - Smooth scroll with prefers-reduced-motion support
|
||||
* - Toggle functionality
|
||||
* - localStorage state
|
||||
*/
|
||||
|
||||
/**
|
||||
* CTA A/B Testing
|
||||
* Handled by cta-ab-testing.php (PHP) and cta-tracking.js
|
||||
* - PHP renders only ONE variant based on cookie
|
||||
* - cta-tracking.js handles Analytics tracking
|
||||
*/
|
||||
|
||||
// Contact Modal - Dynamic Loading
|
||||
function loadContactModal() {
|
||||
const modalContainer = document.getElementById('modalContainer');
|
||||
if (!modalContainer) return;
|
||||
|
||||
// Use theme URL from localized script
|
||||
const modalUrl = (typeof roiheme !== 'undefined' && rroieme.themeUrl)
|
||||
? roiheme.themeUrl + '/modal-contact.html'
|
||||
: '/wp-content/themes/roitheme/modal-contact.html';
|
||||
|
||||
fetch(modalUrl)
|
||||
.then(response => response.text())
|
||||
.then(html => {
|
||||
modalContainer.innerHTML = html;
|
||||
initContactForm();
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error loading modal:', error);
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', loadContactModal);
|
||||
|
||||
// Contact Form - Webhook Submission
|
||||
function initContactForm() {
|
||||
const form = document.getElementById('contactForm');
|
||||
if (!form) return;
|
||||
|
||||
form.addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const WEBHOOK_URL = 'https://tu-webhook.com/contacto';
|
||||
|
||||
const formData = {
|
||||
fullName: document.getElementById('fullName').value,
|
||||
company: document.getElementById('company').value,
|
||||
whatsapp: document.getElementById('whatsapp').value,
|
||||
email: document.getElementById('email').value,
|
||||
comments: document.getElementById('comments').value,
|
||||
timestamp: new Date().toISOString(),
|
||||
source: 'APU Website - Modal'
|
||||
};
|
||||
|
||||
if (!formData.fullName || !formData.whatsapp || !formData.email) {
|
||||
showFormMessage('Por favor completa todos los campos requeridos', 'danger');
|
||||
return;
|
||||
}
|
||||
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
if (!emailRegex.test(formData.email)) {
|
||||
showFormMessage('Por favor ingresa un correo electrónico válido', 'danger');
|
||||
return;
|
||||
}
|
||||
|
||||
const submitButton = form.querySelector('button[type="submit"]');
|
||||
const originalText = submitButton.innerHTML;
|
||||
submitButton.disabled = true;
|
||||
submitButton.innerHTML = '<span class="spinner-border spinner-border-sm me-2"></span>Enviando...';
|
||||
|
||||
fetch(WEBHOOK_URL, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(formData)
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error('Error en el envío');
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
showFormMessage('¡Mensaje enviado exitosamente!', 'success');
|
||||
form.reset();
|
||||
|
||||
if (typeof gtag !== 'undefined') {
|
||||
gtag('event', 'form_submission', {
|
||||
'event_category': 'Contact Form',
|
||||
'event_label': 'Form Submitted'
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
const modal = bootstrap.Modal.getInstance(document.getElementById('contactModal'));
|
||||
if (modal) modal.hide();
|
||||
}, 2000);
|
||||
})
|
||||
.catch(error => {
|
||||
showFormMessage('Error al enviar el mensaje', 'danger');
|
||||
})
|
||||
.finally(() => {
|
||||
submitButton.disabled = false;
|
||||
submitButton.innerHTML = originalText;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function showFormMessage(message, type) {
|
||||
const messageDiv = document.getElementById('formMessage');
|
||||
if (!messageDiv) return;
|
||||
|
||||
messageDiv.textContent = message;
|
||||
messageDiv.className = `mt-3 alert alert-${type}`;
|
||||
messageDiv.style.display = 'block';
|
||||
|
||||
setTimeout(() => {
|
||||
messageDiv.style.display = 'none';
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
// Footer Contact Form
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const footerForm = document.getElementById('footerContactForm');
|
||||
if (!footerForm) return;
|
||||
|
||||
footerForm.addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const WEBHOOK_URL = 'https://tu-webhook.com/contacto';
|
||||
|
||||
const formData = {
|
||||
fullName: document.getElementById('footerFullName').value,
|
||||
company: document.getElementById('footerCompany').value,
|
||||
whatsapp: document.getElementById('footerWhatsapp').value,
|
||||
email: document.getElementById('footerEmail').value,
|
||||
comments: document.getElementById('footerComments').value,
|
||||
timestamp: new Date().toISOString(),
|
||||
source: 'APU Website - Footer'
|
||||
};
|
||||
|
||||
if (!formData.fullName || !formData.whatsapp || !formData.email) {
|
||||
showFooterFormMessage('Por favor completa todos los campos requeridos', 'danger');
|
||||
return;
|
||||
}
|
||||
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
if (!emailRegex.test(formData.email)) {
|
||||
showFooterFormMessage('Por favor ingresa un correo válido', 'danger');
|
||||
return;
|
||||
}
|
||||
|
||||
const submitButton = footerForm.querySelector('button[type="submit"]');
|
||||
const originalText = submitButton.innerHTML;
|
||||
submitButton.disabled = true;
|
||||
submitButton.innerHTML = '<span class="spinner-border spinner-border-sm me-2"></span>Enviando...';
|
||||
|
||||
fetch(WEBHOOK_URL, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(formData)
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error('Error en el envío');
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
showFooterFormMessage('¡Mensaje enviado exitosamente!', 'success');
|
||||
footerForm.reset();
|
||||
|
||||
if (typeof gtag !== 'undefined') {
|
||||
gtag('event', 'form_submission', {
|
||||
'event_category': 'Footer Form',
|
||||
'event_label': 'Form Submitted'
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
showFooterFormMessage('Error al enviar el mensaje', 'danger');
|
||||
})
|
||||
.finally(() => {
|
||||
submitButton.disabled = false;
|
||||
submitButton.innerHTML = originalText;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function showFooterFormMessage(message, type) {
|
||||
const messageDiv = document.getElementById('footerFormMessage');
|
||||
if (!messageDiv) return;
|
||||
|
||||
messageDiv.textContent = message;
|
||||
messageDiv.className = `col-12 mt-2 alert alert-${type}`;
|
||||
messageDiv.style.display = 'block';
|
||||
|
||||
setTimeout(() => {
|
||||
messageDiv.style.display = 'none';
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
// Smooth scroll for all anchor links
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
const href = this.getAttribute('href');
|
||||
|
||||
if (href === '#' || this.getAttribute('data-bs-toggle') === 'modal') {
|
||||
return;
|
||||
}
|
||||
|
||||
const targetElement = document.querySelector(href);
|
||||
if (!targetElement) return;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
const navbar = document.querySelector('.navbar');
|
||||
const navbarHeight = navbar ? navbar.offsetHeight : 0;
|
||||
const offsetTop = targetElement.offsetTop - navbarHeight - 20;
|
||||
|
||||
window.scrollTo({
|
||||
top: offsetTop,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
console.log('%c APU México ', 'background: #1e3a5f; color: #FF8600; font-size: 16px; font-weight: bold; padding: 10px;');
|
||||
|
||||
// === SIDEBAR TOC - ScrollSpy ===
|
||||
|
||||
// Table of Contents - ScrollSpy
|
||||
function updateActiveSection() {
|
||||
const tocLinks = document.querySelectorAll('.toc-container a');
|
||||
if (!tocLinks.length) return;
|
||||
|
||||
const navbar = document.querySelector('.navbar');
|
||||
const navbarHeight = navbar ? navbar.offsetHeight : 0;
|
||||
|
||||
const sectionIds = Array.from(tocLinks).map(link => {
|
||||
const href = link.getAttribute('href');
|
||||
return href ? href.substring(1) : null;
|
||||
}).filter(id => id !== null);
|
||||
|
||||
const sections = sectionIds.map(id => document.getElementById(id)).filter(el => el !== null);
|
||||
const scrollPosition = window.scrollY + navbarHeight + 100;
|
||||
|
||||
let activeSection = null;
|
||||
|
||||
for (let i = 0; i < sections.length; i++) {
|
||||
const section = sections[i];
|
||||
const sectionTop = section.offsetTop;
|
||||
|
||||
if (scrollPosition >= sectionTop) {
|
||||
activeSection = section.getAttribute('id');
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tocLinks.forEach(link => {
|
||||
link.classList.remove('active');
|
||||
const href = link.getAttribute('href');
|
||||
if (href === '#' + activeSection) {
|
||||
link.classList.add('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Smooth scroll for TOC links
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('.toc-container a').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
const targetId = this.getAttribute('href');
|
||||
const targetElement = document.querySelector(targetId);
|
||||
|
||||
if (targetElement) {
|
||||
const navbar = document.querySelector('.navbar');
|
||||
const navbarHeight = navbar ? navbar.offsetHeight : 0;
|
||||
const offsetTop = targetElement.offsetTop - navbarHeight - 40;
|
||||
|
||||
window.scrollTo({
|
||||
top: offsetTop,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
updateActiveSection();
|
||||
});
|
||||
|
||||
window.addEventListener('scroll', updateActiveSection);
|
||||
464
Assets/js/modal-contact.js
Normal file
464
Assets/js/modal-contact.js
Normal file
@@ -0,0 +1,464 @@
|
||||
/**
|
||||
* Modal de Contacto - JavaScript
|
||||
*
|
||||
* Carga dinámica del modal, validaciones y envío a webhook
|
||||
* Compatible con Bootstrap 5.3.2
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// =========================================================================
|
||||
// CONFIGURACIÓN
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* URL del webhook para envío de formulario
|
||||
* IMPORTANTE: Reemplaza con tu URL real de webhook
|
||||
*
|
||||
* Servicios recomendados:
|
||||
* - Make (Integromat): https://www.make.com
|
||||
* - Zapier: https://zapier.com
|
||||
* - Webhook.site (testing): https://webhook.site
|
||||
* - n8n (self-hosted): https://n8n.io
|
||||
* - Pipedream: https://pipedream.com
|
||||
*/
|
||||
const WEBHOOK_URL = 'https://webhook.site/tu-url-aqui';
|
||||
|
||||
/**
|
||||
* Expresión regular para validación de email
|
||||
*/
|
||||
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
|
||||
/**
|
||||
* Expresión regular para validación de WhatsApp
|
||||
* Acepta 10-15 dígitos con o sin espacios/guiones
|
||||
*/
|
||||
const WHATSAPP_REGEX = /^[\+]?[(]?[0-9]{1,4}[)]?[-\s\.]?[(]?[0-9]{1,4}[)]?[-\s\.]?[0-9]{1,4}[-\s\.]?[0-9]{1,5}$/;
|
||||
|
||||
// =========================================================================
|
||||
// INICIALIZACIÓN
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* Inicializa el modal cuando el DOM está listo
|
||||
*/
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
loadContactModal();
|
||||
});
|
||||
|
||||
// =========================================================================
|
||||
// CARGA DINÁMICA DEL MODAL
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* Carga el HTML del modal dinámicamente desde archivo externo
|
||||
*/
|
||||
function loadContactModal() {
|
||||
// Verificar si ya existe el contenedor del modal
|
||||
let modalContainer = document.getElementById('modalContainer');
|
||||
|
||||
if (!modalContainer) {
|
||||
// Crear contenedor si no existe
|
||||
modalContainer = document.createElement('div');
|
||||
modalContainer.id = 'modalContainer';
|
||||
document.body.appendChild(modalContainer);
|
||||
}
|
||||
|
||||
// Obtener la URL del tema desde WordPress
|
||||
const themeUrl = typeof roiheme !== 'undefined' && rroieme.themeUrl
|
||||
? roiheme.themeUrl
|
||||
: '/wp-content/themes/roitheme';
|
||||
|
||||
// Cargar el HTML del modal
|
||||
fetch(themeUrl + '/modal-contact.html')
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Error al cargar el modal: ' + response.status);
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(html => {
|
||||
modalContainer.innerHTML = html;
|
||||
|
||||
// Inicializar el formulario después de cargar el HTML
|
||||
initContactForm();
|
||||
|
||||
console.log('Modal de contacto cargado exitosamente');
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error cargando el modal:', error);
|
||||
});
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// VALIDACIONES
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* Valida el campo de nombre completo
|
||||
* @param {string} fullName - Nombre a validar
|
||||
* @returns {Object} - {valid: boolean, message: string}
|
||||
*/
|
||||
function validateFullName(fullName) {
|
||||
if (!fullName || fullName.trim().length === 0) {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'Por favor ingresa tu nombre completo'
|
||||
};
|
||||
}
|
||||
if (fullName.trim().length < 3) {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'El nombre debe tener al menos 3 caracteres'
|
||||
};
|
||||
}
|
||||
return { valid: true, message: '' };
|
||||
}
|
||||
|
||||
/**
|
||||
* Valida el campo de email
|
||||
* @param {string} email - Email a validar
|
||||
* @returns {Object} - {valid: boolean, message: string}
|
||||
*/
|
||||
function validateEmail(email) {
|
||||
if (!email || email.trim().length === 0) {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'Por favor ingresa tu correo electrónico'
|
||||
};
|
||||
}
|
||||
if (!EMAIL_REGEX.test(email.trim())) {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'Por favor ingresa un correo electrónico válido'
|
||||
};
|
||||
}
|
||||
return { valid: true, message: '' };
|
||||
}
|
||||
|
||||
/**
|
||||
* Valida el campo de WhatsApp
|
||||
* @param {string} whatsapp - Número de WhatsApp a validar
|
||||
* @returns {Object} - {valid: boolean, message: string}
|
||||
*/
|
||||
function validateWhatsApp(whatsapp) {
|
||||
if (!whatsapp || whatsapp.trim().length === 0) {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'Por favor ingresa tu número de WhatsApp'
|
||||
};
|
||||
}
|
||||
|
||||
// Remover todos los caracteres no numéricos excepto el +
|
||||
const cleanNumber = whatsapp.replace(/[^\d+]/g, '');
|
||||
const digitsOnly = cleanNumber.replace(/\+/g, '');
|
||||
|
||||
if (digitsOnly.length < 10 || digitsOnly.length > 15) {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'El número debe tener entre 10 y 15 dígitos'
|
||||
};
|
||||
}
|
||||
|
||||
if (!WHATSAPP_REGEX.test(whatsapp)) {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'Por favor ingresa un número de WhatsApp válido'
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true, message: '' };
|
||||
}
|
||||
|
||||
/**
|
||||
* Marca un campo como válido o inválido visualmente
|
||||
* @param {HTMLElement} input - Elemento input
|
||||
* @param {boolean} isValid - Si es válido o no
|
||||
* @param {string} message - Mensaje de error (opcional)
|
||||
*/
|
||||
function setFieldValidation(input, isValid, message = '') {
|
||||
if (isValid) {
|
||||
input.classList.remove('is-invalid');
|
||||
input.classList.add('is-valid');
|
||||
} else {
|
||||
input.classList.remove('is-valid');
|
||||
input.classList.add('is-invalid');
|
||||
|
||||
// Actualizar mensaje de error
|
||||
const feedback = input.nextElementSibling;
|
||||
if (feedback && feedback.classList.contains('invalid-feedback')) {
|
||||
feedback.textContent = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Limpia las validaciones visuales de un campo
|
||||
* @param {HTMLElement} input - Elemento input
|
||||
*/
|
||||
function clearFieldValidation(input) {
|
||||
input.classList.remove('is-valid', 'is-invalid');
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// FORMULARIO
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* Inicializa el formulario de contacto con validación y envío a webhook
|
||||
*/
|
||||
function initContactForm() {
|
||||
const contactForm = document.getElementById('contactForm');
|
||||
|
||||
if (!contactForm) {
|
||||
console.error('Formulario de contacto no encontrado');
|
||||
return;
|
||||
}
|
||||
|
||||
// Validación en tiempo real
|
||||
const fullNameInput = document.getElementById('fullName');
|
||||
const emailInput = document.getElementById('email');
|
||||
const whatsappInput = document.getElementById('whatsapp');
|
||||
|
||||
if (fullNameInput) {
|
||||
fullNameInput.addEventListener('blur', function() {
|
||||
const validation = validateFullName(this.value);
|
||||
setFieldValidation(this, validation.valid, validation.message);
|
||||
});
|
||||
|
||||
fullNameInput.addEventListener('input', function() {
|
||||
if (this.classList.contains('is-invalid')) {
|
||||
const validation = validateFullName(this.value);
|
||||
if (validation.valid) {
|
||||
setFieldValidation(this, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (emailInput) {
|
||||
emailInput.addEventListener('blur', function() {
|
||||
const validation = validateEmail(this.value);
|
||||
setFieldValidation(this, validation.valid, validation.message);
|
||||
});
|
||||
|
||||
emailInput.addEventListener('input', function() {
|
||||
if (this.classList.contains('is-invalid')) {
|
||||
const validation = validateEmail(this.value);
|
||||
if (validation.valid) {
|
||||
setFieldValidation(this, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (whatsappInput) {
|
||||
whatsappInput.addEventListener('blur', function() {
|
||||
const validation = validateWhatsApp(this.value);
|
||||
setFieldValidation(this, validation.valid, validation.message);
|
||||
});
|
||||
|
||||
whatsappInput.addEventListener('input', function() {
|
||||
if (this.classList.contains('is-invalid')) {
|
||||
const validation = validateWhatsApp(this.value);
|
||||
if (validation.valid) {
|
||||
setFieldValidation(this, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Manejo del envío del formulario
|
||||
contactForm.addEventListener('submit', handleFormSubmit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maneja el envío del formulario
|
||||
* @param {Event} e - Evento de submit
|
||||
*/
|
||||
async function handleFormSubmit(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Obtener elementos del formulario
|
||||
const fullNameInput = document.getElementById('fullName');
|
||||
const companyInput = document.getElementById('company');
|
||||
const whatsappInput = document.getElementById('whatsapp');
|
||||
const emailInput = document.getElementById('email');
|
||||
const commentsInput = document.getElementById('comments');
|
||||
const submitButton = e.target.querySelector('button[type="submit"]');
|
||||
|
||||
// Validar todos los campos
|
||||
const fullNameValidation = validateFullName(fullNameInput.value);
|
||||
const emailValidation = validateEmail(emailInput.value);
|
||||
const whatsappValidation = validateWhatsApp(whatsappInput.value);
|
||||
|
||||
// Marcar campos inválidos
|
||||
setFieldValidation(fullNameInput, fullNameValidation.valid, fullNameValidation.message);
|
||||
setFieldValidation(emailInput, emailValidation.valid, emailValidation.message);
|
||||
setFieldValidation(whatsappInput, whatsappValidation.valid, whatsappValidation.message);
|
||||
|
||||
// Si algún campo es inválido, detener el envío
|
||||
if (!fullNameValidation.valid || !emailValidation.valid || !whatsappValidation.valid) {
|
||||
showFormMessage('Por favor corrige los errores en el formulario', 'danger');
|
||||
|
||||
// Hacer foco en el primer campo inválido
|
||||
if (!fullNameValidation.valid) {
|
||||
fullNameInput.focus();
|
||||
} else if (!emailValidation.valid) {
|
||||
emailInput.focus();
|
||||
} else if (!whatsappValidation.valid) {
|
||||
whatsappInput.focus();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Preparar datos del formulario
|
||||
const formData = {
|
||||
fullName: fullNameInput.value.trim(),
|
||||
company: companyInput.value.trim(),
|
||||
whatsapp: whatsappInput.value.trim(),
|
||||
email: emailInput.value.trim(),
|
||||
comments: commentsInput.value.trim(),
|
||||
timestamp: new Date().toISOString(),
|
||||
source: 'APU Website - Modal Contact Form'
|
||||
};
|
||||
|
||||
// Deshabilitar botón y mostrar spinner
|
||||
const originalButtonText = submitButton.innerHTML;
|
||||
submitButton.disabled = true;
|
||||
submitButton.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>Enviando...';
|
||||
|
||||
try {
|
||||
// Enviar datos al webhook
|
||||
const response = await fetch(WEBHOOK_URL, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(formData),
|
||||
mode: 'no-cors' // Permite envío sin CORS (no podremos leer la respuesta)
|
||||
});
|
||||
|
||||
// Como usamos no-cors, asumimos que el envío fue exitoso si no hay error
|
||||
showFormMessage('¡Mensaje enviado exitosamente! Nos pondremos en contacto pronto.', 'success');
|
||||
|
||||
// Resetear formulario
|
||||
e.target.reset();
|
||||
|
||||
// Limpiar validaciones visuales
|
||||
clearFieldValidation(fullNameInput);
|
||||
clearFieldValidation(emailInput);
|
||||
clearFieldValidation(whatsappInput);
|
||||
|
||||
// Tracking de Google Analytics 4
|
||||
if (typeof gtag !== 'undefined') {
|
||||
gtag('event', 'form_submission', {
|
||||
event_category: 'Contact Form',
|
||||
event_label: 'Modal Contact Form Submitted',
|
||||
value: 1
|
||||
});
|
||||
}
|
||||
|
||||
// Cerrar modal después de 2 segundos
|
||||
setTimeout(() => {
|
||||
const modalElement = document.getElementById('contactModal');
|
||||
if (modalElement && typeof bootstrap !== 'undefined') {
|
||||
const modal = bootstrap.Modal.getInstance(modalElement);
|
||||
if (modal) {
|
||||
modal.hide();
|
||||
}
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error al enviar el formulario:', error);
|
||||
showFormMessage('Hubo un error al enviar el mensaje. Por favor intenta nuevamente.', 'danger');
|
||||
} finally {
|
||||
// Rehabilitar botón
|
||||
submitButton.disabled = false;
|
||||
submitButton.innerHTML = originalButtonText;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Muestra un mensaje de feedback en el formulario
|
||||
* @param {string} message - Mensaje a mostrar
|
||||
* @param {string} type - Tipo de alerta (success, danger, warning, info)
|
||||
*/
|
||||
function showFormMessage(message, type) {
|
||||
const messageDiv = document.getElementById('formMessage');
|
||||
|
||||
if (!messageDiv) {
|
||||
console.error('Contenedor de mensajes no encontrado');
|
||||
return;
|
||||
}
|
||||
|
||||
messageDiv.className = `mt-3 alert alert-${type}`;
|
||||
messageDiv.textContent = message;
|
||||
messageDiv.style.display = 'block';
|
||||
messageDiv.setAttribute('role', 'alert');
|
||||
|
||||
// Anunciar mensaje a lectores de pantalla
|
||||
messageDiv.setAttribute('aria-live', 'polite');
|
||||
|
||||
// Ocultar mensaje después de 5 segundos (excepto mensajes de éxito)
|
||||
if (type !== 'success') {
|
||||
setTimeout(() => {
|
||||
messageDiv.style.display = 'none';
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// EVENTOS DEL MODAL
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* Limpia el formulario cuando se cierra el modal
|
||||
*/
|
||||
document.addEventListener('hidden.bs.modal', function (event) {
|
||||
if (event.target.id === 'contactModal') {
|
||||
const contactForm = document.getElementById('contactForm');
|
||||
const messageDiv = document.getElementById('formMessage');
|
||||
|
||||
if (contactForm) {
|
||||
contactForm.reset();
|
||||
|
||||
// Limpiar validaciones visuales
|
||||
const inputs = contactForm.querySelectorAll('.form-control');
|
||||
inputs.forEach(input => clearFieldValidation(input));
|
||||
}
|
||||
|
||||
if (messageDiv) {
|
||||
messageDiv.style.display = 'none';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Tracking cuando se abre el modal
|
||||
*/
|
||||
document.addEventListener('shown.bs.modal', function (event) {
|
||||
if (event.target.id === 'contactModal') {
|
||||
// Hacer foco en el primer campo
|
||||
const fullNameInput = document.getElementById('fullName');
|
||||
if (fullNameInput) {
|
||||
setTimeout(() => fullNameInput.focus(), 100);
|
||||
}
|
||||
|
||||
// Google Analytics 4 tracking
|
||||
if (typeof gtag !== 'undefined') {
|
||||
gtag('event', 'modal_open', {
|
||||
event_category: 'Contact Form',
|
||||
event_label: 'Contact Modal Opened',
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
148
Assets/js/notification-bar.js
Normal file
148
Assets/js/notification-bar.js
Normal file
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* Top Notification Bar Script
|
||||
* Issue #39
|
||||
*
|
||||
* Maneja el cierre de la barra de notificación y el almacenamiento
|
||||
* de la preferencia del usuario mediante cookies.
|
||||
*
|
||||
* @package ROI_Theme
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Inicialización cuando el DOM está listo
|
||||
*/
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
initNotificationBar();
|
||||
});
|
||||
|
||||
/**
|
||||
* Inicializa la funcionalidad de la barra de notificación
|
||||
*/
|
||||
function initNotificationBar() {
|
||||
const notificationBar = document.getElementById('topNotificationBar');
|
||||
const closeBtn = document.querySelector('.btn-close-notification');
|
||||
const navbar = document.querySelector('.navbar');
|
||||
|
||||
// Verificar que existan los elementos necesarios
|
||||
if (!notificationBar || !closeBtn) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Event listener para el botón de cerrar
|
||||
closeBtn.addEventListener('click', function() {
|
||||
closeNotificationBar(notificationBar, navbar);
|
||||
});
|
||||
|
||||
// Permitir cerrar con la tecla Escape
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape' && notificationBar.style.display !== 'none') {
|
||||
closeNotificationBar(notificationBar, navbar);
|
||||
}
|
||||
});
|
||||
|
||||
// Ajustar el scroll inicial si la barra está visible
|
||||
adjustInitialScroll(notificationBar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cierra la barra de notificación con animación
|
||||
*
|
||||
* @param {HTMLElement} notificationBar - Elemento de la barra de notificación
|
||||
* @param {HTMLElement} navbar - Elemento del navbar
|
||||
*/
|
||||
function closeNotificationBar(notificationBar, navbar) {
|
||||
// Ocultar barra con animación de slide up
|
||||
notificationBar.style.transition = 'transform 0.3s ease, opacity 0.3s ease';
|
||||
notificationBar.style.transform = 'translateY(-100%)';
|
||||
notificationBar.style.opacity = '0';
|
||||
|
||||
// Esperar a que termine la animación antes de ocultar completamente
|
||||
setTimeout(function() {
|
||||
notificationBar.style.display = 'none';
|
||||
document.body.classList.add('notification-dismissed');
|
||||
|
||||
// Ajustar navbar suavemente
|
||||
if (navbar) {
|
||||
navbar.style.transition = 'top 0.3s ease';
|
||||
navbar.style.top = '0';
|
||||
}
|
||||
|
||||
// Guardar cookie por 7 días
|
||||
setCookie('roinotification_dismissed', '1', 7);
|
||||
|
||||
// Disparar evento personalizado para otros scripts
|
||||
const event = new CustomEvent('notificationBarClosed', {
|
||||
detail: { timestamp: Date.now() }
|
||||
});
|
||||
document.dispatchEvent(event);
|
||||
}, 300);
|
||||
}
|
||||
|
||||
/**
|
||||
* Establece una cookie con nombre, valor y días de expiración
|
||||
*
|
||||
* @param {string} name - Nombre de la cookie
|
||||
* @param {string} value - Valor de la cookie
|
||||
* @param {number} days - Días hasta la expiración
|
||||
*/
|
||||
function setCookie(name, value, days) {
|
||||
const expiryDate = new Date();
|
||||
expiryDate.setDate(expiryDate.getDate() + days);
|
||||
|
||||
const cookie = name + '=' + encodeURIComponent(value) +
|
||||
'; expires=' + expiryDate.toUTCString() +
|
||||
'; path=/' +
|
||||
'; SameSite=Lax';
|
||||
|
||||
document.cookie = cookie;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajusta el scroll inicial para compensar la altura de la barra
|
||||
*
|
||||
* @param {HTMLElement} notificationBar - Elemento de la barra de notificación
|
||||
*/
|
||||
function adjustInitialScroll(notificationBar) {
|
||||
// Si hay un hash en la URL, reajustar el scroll para compensar la altura
|
||||
if (window.location.hash) {
|
||||
setTimeout(function() {
|
||||
const target = document.querySelector(window.location.hash);
|
||||
if (target) {
|
||||
const barHeight = notificationBar.offsetHeight;
|
||||
const navbarHeight = document.querySelector('.navbar')?.offsetHeight || 0;
|
||||
const offset = barHeight + navbarHeight;
|
||||
|
||||
window.scrollTo({
|
||||
top: target.offsetTop - offset,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Función helper para obtener el valor de una cookie
|
||||
*
|
||||
* @param {string} name - Nombre de la cookie
|
||||
* @return {string|null} - Valor de la cookie o null si no existe
|
||||
*/
|
||||
function getCookie(name) {
|
||||
const nameEQ = name + '=';
|
||||
const cookies = document.cookie.split(';');
|
||||
|
||||
for (let i = 0; i < cookies.length; i++) {
|
||||
let cookie = cookies[i].trim();
|
||||
if (cookie.indexOf(nameEQ) === 0) {
|
||||
return decodeURIComponent(cookie.substring(nameEQ.length));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user