From 4a927c57d4a91b576b97a3ff147105141a590636 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Sat, 18 Oct 2025 16:48:57 -0600 Subject: [PATCH] Fix: Compactar checkboxes de sensaciones en boca y gustos predominantes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cambiar layout de grid fijo a flex-wrap en mobile para sensaciones y gustos - Mantener grid responsive en desktop (3 columnas para sensaciones, 5 para gustos) - Reducir significativamente todas las dimensiones para mayor compactación: * Desktop: min-height 36px, padding 0.375rem 0.5rem * Mobile: min-height 28px, padding 0.25rem 0.375rem * Font-size: 0.75rem desktop, 0.6875rem mobile - Agregar animaciones y estados focus consistentes - Touch-friendly en dispositivos táctiles (36px min-height) --- .../app/components/cata/FormularioMuestra.vue | 137 +++++++++++++++++- 1 file changed, 133 insertions(+), 4 deletions(-) diff --git a/nuxt4/app/components/cata/FormularioMuestra.vue b/nuxt4/app/components/cata/FormularioMuestra.vue index e58b480..b511254 100644 --- a/nuxt4/app/components/cata/FormularioMuestra.vue +++ b/nuxt4/app/components/cata/FormularioMuestra.vue @@ -27,18 +27,19 @@ -
+
@@ -48,19 +49,20 @@ -
+
@@ -949,7 +951,134 @@ watch(() => props.muestra.otrasNotas, (newVal) => { text-align: center; } +/* Grid de sensaciones */ +.sensaciones-grid { + display: flex; + flex-wrap: wrap; + gap: 0.375rem; +} + +.sensacion-item { + position: relative; + display: flex; + align-items: center; + gap: 0.375rem; + padding: 0.375rem 0.5rem; + min-height: 32px; +} + +.sensacion-item:focus { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.sensacion-item:focus-visible { + box-shadow: 0 0 0 2px var(--cata-primary); +} + +.sensacion-text { + font-size: 0.75rem; +} + +/* Grid de gustos */ +.gustos-grid { + display: flex; + flex-wrap: wrap; + gap: 0.375rem; +} + +.gusto-item { + position: relative; + display: flex; + align-items: center; + gap: 0.375rem; + padding: 0.375rem 0.5rem; + min-height: 32px; +} + +.gusto-item:focus { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.gusto-item:focus-visible { + box-shadow: 0 0 0 2px var(--cata-primary); +} + +.gusto-text { + font-size: 0.75rem; +} + +/* Animaciones */ +.sensacion-item.cata-checkbox-checked, +.gusto-item.cata-checkbox-checked { + transform: scale(1.02); +} + +.sensacion-item:not(.disabled):hover, +.gusto-item:not(.disabled):hover { + transform: scale(1.02); +} + +.sensacion-item:not(.disabled):active, +.gusto-item:not(.disabled):active { + transform: scale(0.98); +} + /* Responsive */ +@media (max-width: 640px) { + .sensacion-item { + min-height: 28px; + padding: 0.25rem 0.375rem; + } + + .sensacion-text { + font-size: 0.6875rem; + } + + .gusto-item { + min-height: 28px; + padding: 0.25rem 0.375rem; + } + + .gusto-text { + font-size: 0.6875rem; + } +} + +@media (min-width: 768px) { + .sensaciones-grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.5rem; + } + + .sensacion-item { + min-height: 36px; + } + + .gustos-grid { + display: grid; + grid-template-columns: repeat(5, minmax(0, 1fr)); + gap: 0.5rem; + } + + .gusto-item { + min-height: 36px; + } +} + +/* Touch-friendly */ +@media (hover: none) and (pointer: coarse) { + .sensacion-item { + min-height: 36px; + } + + .gusto-item { + min-height: 36px; + } +} + @media (max-width: 768px) { .formulario-muestra { padding: 0.75rem;