Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ Formato basado en [Keep a Changelog](https://keepachangelog.com/es-ES/1.1.0/).
(`tests/data.test.mjs`: JSON válido, ids únicos, recetas sin ingredientes
inexistentes, categorías con tope, `visualStyle` conocido) (#3).

### Añadido
- Accesibilidad (#4): votar con las flechas ← → del teclado; foco gestionado
en cada pantalla y carta; anuncios por `aria-live` de turno, resumen y
resultado; anillo de foco visible; nombres accesibles en botones de icono,
inputs y cartas; los emojis pasan a ser decorativos y el nombre se muestra
siempre en texto (también en "También coincidisteis en" y en el admin);
chips del admin usables con teclado; `prefers-reduced-motion`.

### Cambiado
- Contraste WCAG AA: botones rellenos `#E1472B` → `#C93A1F`, textos
secundarios a opacidad ≥ 0.62 y texto de error `#EE5C3F` (#4).
- Service worker: *network-first* (con timeout de 4 s) para todo lo del
propio sitio en vez de servir primero la caché, así los cambios en `/data`
y en el código se ven en la siguiente carga sin tocar `CACHE_NAME`. Sin red
Expand Down
16 changes: 15 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ o vuelve a correr `scripts/bootstrap-github.sh`, que es idempotente y solo
creará lo que falte.

## Estilo
Sigue la paleta y componentes ya definidos en `css/style.css`. Si necesitas
Sigue la paleta y componentes ya definidos en `css/style.css`.

### Accesibilidad (WCAG 2.1 AA)
- **Contraste**: texto normal ≥ 4.5:1, texto grande e iconos ≥ 3:1. Los
botones rellenos con texto claro usan `#C93A1F` (no `#E1472B`, que solo
da 3.9:1); el texto secundario no baja de `rgba(247,237,221,0.62)`.
- **Emojis**: siempre decorativos y con el nombre en texto al lado. En el
juego y el admin usa el helper `emo()` (los envuelve en
`aria-hidden="true"`). Botones de solo icono → `aria-label`.
- **Foco**: no pongas `outline: none` sin alternativa; el anillo común es
`:focus-visible`. En `js/app.js`, marca con `data-autofocus` el control
que debe recibir el foco al llegar a una pantalla, y con `data-announce`
el texto que se lee por la región `aria-live`.
- Inputs con `<label>` o `aria-label`; controles conmutables como
`<button aria-pressed>`, no `<span>` clicables. Si necesitas
justificar una decisión de diseño no trivial, documenta el porqué en el
propio PR, no solo el qué.
2 changes: 1 addition & 1 deletion admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<link rel="stylesheet" href="./css/style.css" />
</head>
<body>
<div id="app"></div>
<main id="app"></main>
<script type="module" src="./js/admin.js"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions backlog/issues.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,25 @@
"documentation"
],
"milestone": "v1.0 – Deploy & Polish"
},
{
"title": "El banner de instalación tapa el último botón en pantallas largas",
"body": "`.install-banner` es `position: fixed` abajo y no reserva espacio, así que en pantallas con scroll (resultado con varias coincidencias, setup con 8 jugadores) tapa el último botón (\"Jugar otra ronda\"). Ya pasaba antes de #4.\n\n**Aceptación**\n- [ ] Mientras el banner está visible, el contenido reserva su altura abajo (padding en `body` o similar) y el último botón queda accesible\n- [ ] Opción de cerrar el banner (✕ con `aria-label`), recordada en `localStorage`\n- [ ] Probado en móvil (400×860) en las pantallas de setup y resultado\n\n_Detectado durante #4 (accesibilidad)._",
"labels": [
"bug",
"pwa",
"a11y"
],
"milestone": "v1.2 – Calidad de vida"
},
{
"title": "Admin: el foco se pierde al cambiar de pestaña o guardar",
"body": "`admin.js` re-renderiza todo `#app` con `innerHTML` en cada acción, así que al cambiar de pestaña, abrir un formulario o guardar, el foco vuelve a `<body>` y quien usa teclado o lector de pantalla tiene que empezar a tabular desde arriba.\n\n**Aceptación**\n- [ ] Al cambiar de pestaña, el foco queda en la pestaña activa\n- [ ] Al abrir un formulario (nuevo/editar), el foco va a su primer input; al guardar o cancelar, vuelve al botón que lo abrió (o a la fila editada)\n- [ ] Los toasts se anuncian por una región `aria-live` (`role=\"status\"`)\n- [ ] Mismo patrón que el juego (`data-autofocus` / conservar foco por `data-action`), ver `CONTRIBUTING.md` → Accesibilidad\n\n_Detectado durante #4 (accesibilidad)._",
"labels": [
"enhancement",
"a11y",
"admin"
],
"milestone": "v1.2 – Calidad de vida"
}
]
46 changes: 31 additions & 15 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ button { font-family: inherit; }
.subtitle { color: rgba(247,237,221,0.6); font-size: 14px; margin-bottom: 28px; text-align: center; }

.card-panel { width: 100%; background: #241A15; border: 1px solid rgba(247,237,221,0.08); border-radius: 20px; padding: 22px; }
.row-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(247,237,221,0.45); margin-bottom: 10px; }
.row-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(247,237,221,0.62); margin-bottom: 10px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 22px; }
.step-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(247,237,221,0.2); background: #2E2119; color: #F7EDDD; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; }
.step-btn:active { transform: scale(0.94); }
Expand All @@ -33,9 +33,9 @@ button { font-family: inherit; }
width: 100%; background: #2E2119; border: 1px solid rgba(247,237,221,0.12); border-radius: 10px;
padding: 10px 12px; color: #F7EDDD; font-size: 14px; margin-bottom: 8px; font-family: 'Work Sans', sans-serif;
}
.name-input:focus, .text-input:focus, .select-input:focus { outline: none; border-color: #E1472B; }
.name-input:focus, .text-input:focus, .select-input:focus { border-color: #E1472B; }

.cta { margin-top: 22px; width: 100%; background: #E1472B; color: #FFF8E7; border: none; border-radius: 14px; padding: 15px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.cta { margin-top: 22px; width: 100%; background: #C93A1F; color: #FFF8E7; border: none; border-radius: 14px; padding: 15px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.cta:active { transform: scale(0.98); }
.cta.ghost { background: transparent; border: 1px solid rgba(247,237,221,0.25); color: #F7EDDD; }
.cta.small { padding: 10px; font-size: 14px; margin-top: 8px; }
Expand All @@ -46,12 +46,12 @@ button { font-family: inherit; }
.avatar { width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka', sans-serif; font-size: 34px; font-weight: 600; color: #1B1410; margin-bottom: 20px; }
.handoff-title { font-size: 24px; font-weight: 600; margin-bottom: 6px; text-align: center; }
.handoff-sub { color: rgba(247,237,221,0.55); font-size: 14px; text-align: center; margin-bottom: 26px; }
.player-tag { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: rgba(247,237,221,0.4); margin-bottom: 10px; }
.player-tag { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: rgba(247,237,221,0.62); margin-bottom: 10px; }

.swipe-top { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.progress-track { flex: 1; height: 8px; background: rgba(247,237,221,0.1); border-radius: 6px; margin-left: 12px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg,#E8A33D,#E1472B); border-radius: 6px; transition: width .2s ease; }
.count-label { font-size: 12px; color: rgba(247,237,221,0.5); white-space: nowrap; }
.count-label { font-size: 12px; color: rgba(247,237,221,0.62); white-space: nowrap; }

.stack { position: relative; width: 100%; height: 400px; margin-bottom: 22px; touch-action: none; }
.ing-card { position: absolute; inset: 0; border-radius: 24px; background: #241A15; border: 1px solid rgba(247,237,221,0.08); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 20px 40px rgba(0,0,0,0.35); padding: 18px; user-select: none; }
Expand All @@ -72,9 +72,9 @@ button { font-family: inherit; }
.swipe-btns { display: flex; gap: 26px; }
.round-btn { width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(0,0,0,0.3); font-size: 24px; }
.round-btn.no { background: #2E2119; color: #C98A3E; border: 1px solid rgba(247,237,221,0.15); }
.round-btn.yes { background: #E1472B; color: #FFF8E7; }
.round-btn.yes { background: #C93A1F; color: #FFF8E7; }
.round-btn:active { transform: scale(0.9); }
.hint { margin-top: 14px; font-size: 12px; color: rgba(247,237,221,0.35); }
.hint { margin-top: 14px; font-size: 12px; color: rgba(247,237,221,0.62); text-align: center; }

.result-title { font-family: 'Fredoka', sans-serif; font-size: 26px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.result-sub { color: rgba(247,237,221,0.55); font-size: 13px; text-align: center; margin-bottom: 22px; }
Expand All @@ -95,11 +95,12 @@ button { font-family: inherit; }
.chip { background: #241A15; border: 1px solid rgba(247,237,221,0.12); border-radius: 999px; padding: 6px 12px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.empty-msg { text-align: center; color: rgba(247,237,221,0.55); font-size: 14px; margin-bottom: 26px; padding: 0 10px; }
.extra-pizza-row { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.extra-pizza { background: #241A15; border: 1px solid rgba(247,237,221,0.1); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; }
.extra-pizza { background: #241A15; border: 1px solid rgba(247,237,221,0.1); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.extra-pizza-name { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 15px; }
.extra-pizza-emojis { font-size: 15px; opacity: 0.8; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(247,237,221,0.45); margin: 4px 0 12px; align-self: flex-start; }
.error-box { color: #E1472B; background: #241A15; border: 1px solid rgba(225,71,43,0.4); border-radius: 12px; padding: 14px; font-size: 13px; text-align: center; }
.extra-pizza-ings { font-size: 12px; color: rgba(247,237,221,0.62); flex-basis: 100%; margin-top: 4px; line-height: 1.5; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(247,237,221,0.62); margin: 4px 0 12px; align-self: flex-start; }
.error-box { color: #EE5C3F; background: #241A15; border: 1px solid rgba(225,71,43,0.4); border-radius: 12px; padding: 14px; font-size: 13px; text-align: center; }

.install-banner {
position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 380px; margin: 0 auto;
Expand All @@ -115,24 +116,39 @@ button { font-family: inherit; }
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.admin-nav { display: flex; gap: 8px; margin-bottom: 18px; }
.admin-nav button { flex: 1; background: #241A15; border: 1px solid rgba(247,237,221,0.1); color: rgba(247,237,221,0.6); border-radius: 10px; padding: 10px; cursor: pointer; font-size: 13px; }
.admin-nav button.active { background: #E1472B; color: #FFF8E7; border-color: #E1472B; }
.admin-nav button.active { background: #C93A1F; color: #FFF8E7; border-color: #C93A1F; }
.item-row { background: #241A15; border: 1px solid rgba(247,237,221,0.08); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.item-row .emoji { font-size: 22px; }
.item-row .meta { flex: 1; min-width: 0; }
.item-row .name { font-weight: 600; font-size: 14px; }
.item-row .sub { font-size: 12px; color: rgba(247,237,221,0.5); }
.item-row .sub { font-size: 12px; color: rgba(247,237,221,0.62); }
.item-row .actions { display: flex; gap: 6px; }
.icon-btn { background: #2E2119; border: 1px solid rgba(247,237,221,0.12); color: #F7EDDD; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 13px; }
.icon-btn.danger { color: #E1472B; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tag-toggle { display: inline-flex; align-items: center; gap: 5px; background: #2E2119; border: 1px solid rgba(247,237,221,0.12); border-radius: 999px; padding: 6px 10px; font-size: 12px; cursor: pointer; margin: 3px; }
.tag-toggle.selected { background: #E1472B; border-color: #E1472B; }
.tag-toggle { font: inherit; font-size: 12px; color: #F7EDDD; display: inline-flex; align-items: center; gap: 5px; background: #2E2119; border: 1px solid rgba(247,237,221,0.12); border-radius: 999px; padding: 6px 10px; font-size: 12px; cursor: pointer; margin: 3px; }
.tag-toggle.selected { background: #C93A1F; border-color: #C93A1F; color: #FFF8E7; }
.tag-wrap { display: flex; flex-wrap: wrap; margin: 4px -3px 8px; }
.export-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.export-row .cta { flex: 1; min-width: 140px; }
.config-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(247,237,221,0.06); }
.config-row input { width: 70px; text-align: center; }
.type-select-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.type-select-row select { flex: 1; margin: 0; }
.visual-badge { font-size: 11px; color: rgba(247,237,221,0.5); text-transform: uppercase; letter-spacing: 1px; }
.visual-badge { font-size: 11px; color: rgba(247,237,221,0.62); text-transform: uppercase; letter-spacing: 1px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #E8A33D; color: #1B1410; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; z-index: 100; }

/* ---- Accesibilidad ---- */
/* Encabezados y listas semánticos sin cambiar el aspecto de las clases existentes. */
h1, h2 { margin-top: 0; }
h1.logo-row { font-size: inherit; font-weight: inherit; margin: 0 0 4px; }
h2.section-title { font-weight: inherit; }
ul.chip-list, ul.extra-pizza-row { list-style: none; padding: 0; margin-top: 0; }
/* Anillo de foco visible y común (mostaza sobre fondo oscuro, 7.4:1). */
:focus-visible { outline: 3px solid #E8A33D; outline-offset: 2px; }
.ing-card.top:focus-visible { outline-offset: 4px; }
/* Oculto a la vista pero leído por lectores de pantalla. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
<link rel="stylesheet" href="./css/style.css" />
</head>
<body>
<div id="app"></div>
<div id="installBanner" class="install-banner" style="display:none;">
<main id="app"></main>
<div id="announcer" class="sr-only" aria-live="polite" aria-atomic="true"></div>
<aside id="installBanner" class="install-banner" style="display:none;" aria-label="Instalar la app">
<span>Instala Dinner Match en tu pantalla de inicio</span>
<button id="installBtn">Instalar</button>
</div>
</aside>
<script type="module" src="./js/app.js"></script>
</body>
</html>
Loading
Loading