- Sidebar fija en todas las pantallas (md+): logo, nav, logout - index.html: grid 3/5 + 2/5 en desktop (movimientos | donut chart) - add.html: 2 columnas desktop (form | monto+numpad), botones mobile/desktop unificados - historial.html: max-w-3xl, header con botón Nuevo integrado - dashboard.js: formato de moneda con toLocaleString, skeleton loading, mes dinámico - add.js: lógica simplificada con doSave(), teclado ignora inputs de texto - auth.php + login.php: cookie con httponly y SameSite=Lax - docs/plan/00_PLAN.md: estado actualizado, CLI marcado como fase futura Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
184 lines
9.7 KiB
HTML
184 lines
9.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
|
<title>Quiet Wealth — Dashboard</title>
|
|
<script src="js/tailwind.cdn.js"></script>
|
|
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap" rel="stylesheet"/>
|
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet"/>
|
|
<script>
|
|
tailwind.config = {
|
|
theme: {
|
|
extend: {
|
|
colors: {
|
|
"background":"#f8faf9","primary-container":"#006a6a","surface-container-lowest":"#ffffff",
|
|
"on-background":"#191c1c","surface-container-high":"#e6e9e8","secondary-container":"#cde6d6",
|
|
"surface-container-highest":"#e1e3e2","surface-container-low":"#f2f4f3","on-primary":"#ffffff",
|
|
"tertiary":"#264b5c","on-surface":"#191c1c","on-surface-variant":"#3e4948","surface-dim":"#d8dada",
|
|
"outline-variant":"#bec9c8","on-error":"#ffffff","tertiary-container":"#3f6375",
|
|
"secondary-fixed-dim":"#b4ccbd","surface-variant":"#e1e3e2","outline":"#6e7979",
|
|
"surface-container":"#eceeed","surface-bright":"#f8faf9","error":"#ba1a1a",
|
|
"secondary":"#4d6357","surface":"#f8faf9","error-container":"#ffdad6",
|
|
"primary":"#005050","on-primary-container":"#97e7e6","on-secondary":"#ffffff","primary-fixed":"#a0f0f0"
|
|
},
|
|
fontFamily: { headline:["Manrope"], body:["Manrope"] }
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style>
|
|
body { font-family:'Manrope',sans-serif; }
|
|
.material-symbols-outlined { font-variation-settings:'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 24; }
|
|
</style>
|
|
</head>
|
|
<body class="bg-background text-on-background min-h-screen">
|
|
|
|
<!-- ═══════════ SIDEBAR (desktop) ═══════════ -->
|
|
<aside class="hidden md:flex flex-col fixed left-0 top-0 h-screen w-56 bg-surface-container-lowest border-r border-outline-variant z-40 py-7 px-4 gap-1">
|
|
<div class="flex items-center gap-2 px-2 mb-7">
|
|
<span class="material-symbols-outlined text-[#006a6a] text-2xl" style="font-variation-settings:'FILL' 1;">account_balance_wallet</span>
|
|
<span class="font-extrabold text-[#006a6a] tracking-tight text-lg">Quiet Wealth</span>
|
|
</div>
|
|
<a href="index.html" class="flex items-center gap-3 px-3 py-2.5 rounded-xl bg-[#005050]/10 text-primary font-bold text-sm">
|
|
<span class="material-symbols-outlined text-[20px]" style="font-variation-settings:'FILL' 1;">home</span>Dashboard
|
|
</a>
|
|
<a href="historial.html" class="flex items-center gap-3 px-3 py-2.5 rounded-xl text-on-surface-variant hover:bg-surface-container text-sm font-medium transition-colors">
|
|
<span class="material-symbols-outlined text-[20px]">history</span>Historial
|
|
</a>
|
|
<a href="add.html" class="flex items-center gap-3 px-3 py-2.5 rounded-xl text-on-surface-variant hover:bg-surface-container text-sm font-medium transition-colors">
|
|
<span class="material-symbols-outlined text-[20px]">add_circle</span>Nuevo movimiento
|
|
</a>
|
|
<div class="mt-auto">
|
|
<button onclick="logout()" class="flex items-center gap-3 px-3 py-2.5 rounded-xl text-on-surface-variant hover:bg-surface-container text-sm font-medium transition-colors w-full">
|
|
<span class="material-symbols-outlined text-[20px]">logout</span>Salir
|
|
</button>
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- ═══════════ CONTENIDO PRINCIPAL ═══════════ -->
|
|
<div class="md:ml-56 min-h-screen flex flex-col">
|
|
|
|
<!-- Header mobile -->
|
|
<header class="md:hidden bg-background sticky top-0 z-30 border-b border-outline-variant/30">
|
|
<div class="flex justify-between items-center px-6 py-4">
|
|
<div class="flex items-center gap-3">
|
|
<span class="material-symbols-outlined text-[#006a6a]" style="font-variation-settings:'FILL' 1;">account_balance_wallet</span>
|
|
<h1 class="text-xl font-extrabold text-[#006a6a] tracking-tight">Quiet Wealth</h1>
|
|
</div>
|
|
<button onclick="window.location.href='add.html'" class="p-2 hover:bg-surface-container-low rounded-full transition-colors">
|
|
<span class="material-symbols-outlined text-on-surface-variant">add_circle</span>
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Header desktop -->
|
|
<div class="hidden md:flex items-center justify-between px-8 pt-8 pb-2">
|
|
<div>
|
|
<h2 class="text-3xl font-extrabold tracking-tight text-on-surface">Dashboard</h2>
|
|
<p id="ui-mes" class="text-sm text-on-surface-variant mt-0.5 capitalize"></p>
|
|
</div>
|
|
<a href="add.html" class="flex items-center gap-2 px-5 py-2.5 bg-primary text-white rounded-xl font-bold text-sm hover:bg-primary-container transition-colors shadow-sm">
|
|
<span class="material-symbols-outlined text-[18px]">add</span>Nuevo movimiento
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Contenido principal: grid en desktop -->
|
|
<main class="px-6 md:px-8 py-6 pb-28 md:pb-8 flex-1">
|
|
<div class="md:grid md:grid-cols-5 md:gap-7 md:items-start space-y-6 md:space-y-0">
|
|
|
|
<!-- COLUMNA IZQUIERDA (3/5) -->
|
|
<div class="md:col-span-3 space-y-6">
|
|
|
|
<!-- Balance card -->
|
|
<div class="relative overflow-hidden rounded-[2rem] p-8 bg-gradient-to-br from-primary to-primary-container text-on-primary shadow-2xl shadow-primary/20">
|
|
<div class="absolute -right-10 -top-10 w-40 h-40 bg-white opacity-5 blur-3xl rounded-full"></div>
|
|
<div class="absolute -left-10 -bottom-10 w-40 h-40 bg-white opacity-5 blur-3xl rounded-full"></div>
|
|
<div class="relative z-10">
|
|
<p class="text-white/70 tracking-widest uppercase text-xs mb-2 font-semibold">Balance Total</p>
|
|
<h3 id="ui-balance" class="text-5xl font-extrabold tracking-tighter mb-6">$0.00</h3>
|
|
<div id="ui-balance-badge" class="flex items-center gap-2 bg-white/10 w-fit px-4 py-2 rounded-full">
|
|
<span class="material-symbols-outlined text-sm" style="font-variation-settings:'FILL' 1;">payments</span>
|
|
<span id="ui-balance-resumen" class="text-sm font-medium">Cargando...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Movimientos recientes -->
|
|
<div class="space-y-4">
|
|
<div class="flex justify-between items-center">
|
|
<h4 class="text-on-surface-variant font-semibold text-sm uppercase tracking-wider">Movimientos Recientes</h4>
|
|
<button onclick="window.location.href='historial.html'" class="text-primary text-sm font-bold hover:underline">Ver todo</button>
|
|
</div>
|
|
<div id="ui-movimientos" class="bg-surface-container-lowest rounded-[1.5rem] overflow-hidden divide-y divide-surface-container-low">
|
|
<!-- cargado por JS -->
|
|
<div class="flex items-center gap-4 px-5 py-4 animate-pulse">
|
|
<div class="w-11 h-11 rounded-xl bg-surface-container-high"></div>
|
|
<div class="flex-1 space-y-2">
|
|
<div class="h-3 bg-surface-container-high rounded w-2/3"></div>
|
|
<div class="h-2 bg-surface-container-high rounded w-1/3"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- COLUMNA DERECHA (2/5) -->
|
|
<div class="md:col-span-2 space-y-6">
|
|
|
|
<!-- Donut chart -->
|
|
<section class="space-y-4">
|
|
<h4 class="text-on-surface-variant font-semibold text-sm uppercase tracking-wider">Distribución de Gastos</h4>
|
|
<div class="bg-surface-container-low rounded-[2rem] p-7 flex flex-col items-center">
|
|
<div id="ui-donut-chart" class="relative w-44 h-44 mb-6">
|
|
<svg class="w-full h-full -rotate-90" viewBox="0 0 36 36">
|
|
<circle cx="18" cy="18" fill="none" r="16" stroke="#e1e3e2" stroke-dasharray="100,0" stroke-width="4"/>
|
|
</svg>
|
|
<div class="absolute inset-0 flex flex-col items-center justify-center">
|
|
<span class="text-xl font-bold text-on-surface-variant">—</span>
|
|
<span class="text-[9px] uppercase tracking-widest text-on-surface-variant font-bold">Gastos</span>
|
|
</div>
|
|
</div>
|
|
<div id="ui-donut-legend" class="w-full space-y-2">
|
|
<p class="text-xs text-on-surface-variant text-center">Sin datos aún</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- ═══════════ BOTTOM NAV (mobile) ═══════════ -->
|
|
<nav class="md:hidden fixed bottom-0 inset-x-0 z-50 flex justify-around items-center px-4 pb-6 pt-3 bg-white/80 backdrop-blur-xl shadow-[0_-8px_24px_rgba(0,80,80,0.08)] border-t border-outline-variant/30">
|
|
<button class="flex flex-col items-center gap-0.5 text-primary px-4 py-1">
|
|
<span class="material-symbols-outlined" style="font-variation-settings:'FILL' 1;">home</span>
|
|
<span class="text-[10px] font-bold">Inicio</span>
|
|
</button>
|
|
<button onclick="window.location.href='historial.html'" class="flex flex-col items-center gap-0.5 text-on-surface-variant px-4 py-1">
|
|
<span class="material-symbols-outlined">history</span>
|
|
<span class="text-[10px] font-medium">Historial</span>
|
|
</button>
|
|
<button onclick="window.location.href='add.html'" class="flex flex-col items-center gap-0.5 px-4 py-1">
|
|
<span class="w-12 h-12 -mt-6 rounded-2xl bg-primary text-white flex items-center justify-center shadow-lg shadow-primary/30">
|
|
<span class="material-symbols-outlined">add</span>
|
|
</span>
|
|
</button>
|
|
</nav>
|
|
|
|
<script src="js/ui.js"></script>
|
|
<script src="js/dashboard.js"></script>
|
|
<script>
|
|
// Mes actual en header
|
|
document.getElementById('ui-mes').textContent =
|
|
new Date().toLocaleString('es-AR', { month:'long', year:'numeric' });
|
|
|
|
function logout() {
|
|
fetch('api/login.php?action=logout').then(() => window.location.href = 'login.html');
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|