Fix: auth en NGINX, Tailwind local, soporte teclado y layout desktop

- Auth movida a NGINX (Basic Auth en htpasswd) para que fetch() del browser
  incluya credenciales automáticamente — resuelve categorías sin cargar y POST fallido
- Tailwind CDN descargado al build del Docker y servido localmente — elimina
  dependencia externa en cada carga de página
- Soporte de teclado físico en add.html (números, punto/coma, Backspace, Enter)
- Layout centrado en desktop con max-w-md mx-auto en las tres páginas
- Eliminada imagen decorativa externa y links de fonts duplicados

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ricardo Monla
2026-06-03 16:19:37 -03:00
co-authored by Claude Sonnet 4.6
parent 1db200343d
commit 1244235820
10 changed files with 73 additions and 36 deletions
+28 -14
View File
@@ -43,25 +43,39 @@ document.addEventListener('DOMContentLoaded', () => {
btnGasto.addEventListener('click', () => { selectedTipo = 'gasto'; updateTipoUI(); });
btnIngreso.addEventListener('click', () => { selectedTipo = 'ingreso'; updateTipoUI(); });
// Numpad logic
function applyInput(val) {
if (val === 'backspace') {
currentMonto = currentMonto.slice(0, -1);
if (currentMonto === '') currentMonto = "0";
} else if (/^[0-9]$/.test(val)) {
if (currentMonto === "0") {
currentMonto = val;
} else {
currentMonto += val;
}
} else if (val === '.') {
if (!currentMonto.includes('.')) currentMonto += '.';
}
montoEl.textContent = currentMonto;
}
// Numpad táctil
numpad.addEventListener('click', (e) => {
const btn = e.target.closest('button');
if (!btn) return;
const val = btn.textContent.trim() || btn.innerText.trim();
if (val === 'backspace' || btn.querySelector('[data-icon="backspace"]')) {
currentMonto = currentMonto.slice(0, -1);
if (currentMonto === '') currentMonto = "0";
if (btn.querySelector('[data-icon="backspace"]')) {
applyInput('backspace');
} else {
if (currentMonto === "0" && val !== ".") {
currentMonto = val;
} else {
if (val === "." && currentMonto.includes(".")) return;
currentMonto += val;
}
applyInput(btn.textContent.trim());
}
montoEl.textContent = currentMonto;
});
// Teclado físico (desktop)
document.addEventListener('keydown', (e) => {
if (e.key >= '0' && e.key <= '9') applyInput(e.key);
else if (e.key === '.' || e.key === ',') applyInput('.');
else if (e.key === 'Backspace') applyInput('backspace');
else if (e.key === 'Enter') btnSave.click();
});
// Guardar Movimiento