From 0483d73ef8f8f1baa4a1f7abe76b72a0ce442abb Mon Sep 17 00:00:00 2001 From: Echo Date: Tue, 10 Feb 2026 12:18:54 +0000 Subject: [PATCH] feat: 9.0 - Frontend - Display habits list --- dashboard/habits.html | 211 ++++++++++++++++++++++++++++++- dashboard/test_habits_display.py | 173 +++++++++++++++++++++++++ 2 files changed, 380 insertions(+), 4 deletions(-) create mode 100644 dashboard/test_habits_display.py diff --git a/dashboard/habits.html b/dashboard/habits.html index 98d9aa5..6ec297c 100644 --- a/dashboard/habits.html +++ b/dashboard/habits.html @@ -77,13 +77,118 @@ height: 18px; } - /* Habits list (for future use) */ + /* Habits list */ .habits-list { display: flex; flex-direction: column; gap: var(--space-3); } + .habit-card { + background: var(--bg-surface); + border: 1px solid var(--border); + border-radius: var(--radius-md); + padding: var(--space-4); + display: flex; + align-items: center; + gap: var(--space-3); + transition: all var(--transition-fast); + } + + .habit-card:hover { + border-color: var(--accent); + transform: translateY(-1px); + } + + .habit-icon { + width: 40px; + height: 40px; + border-radius: var(--radius-md); + background: var(--bg-elevated); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + } + + .habit-icon svg { + width: 20px; + height: 20px; + color: var(--accent); + } + + .habit-info { + flex: 1; + } + + .habit-name { + font-size: var(--text-base); + font-weight: 500; + color: var(--text-primary); + margin-bottom: var(--space-1); + } + + .habit-frequency { + font-size: var(--text-xs); + color: var(--text-muted); + text-transform: capitalize; + } + + .habit-streak { + display: flex; + align-items: center; + gap: var(--space-1); + font-size: var(--text-lg); + font-weight: 600; + color: var(--accent); + flex-shrink: 0; + } + + /* Loading state */ + .loading-state { + text-align: center; + padding: var(--space-6) var(--space-4); + color: var(--text-muted); + display: none; + } + + .loading-state.active { + display: block; + } + + .loading-state svg { + width: 48px; + height: 48px; + margin-bottom: var(--space-3); + opacity: 0.5; + color: var(--text-muted); + animation: spin 1s linear infinite; + } + + @keyframes spin { + from { transform: rotate(0deg); } + to { transform: rotate(360deg); } + } + + /* Error state */ + .error-state { + text-align: center; + padding: var(--space-6) var(--space-4); + color: var(--text-danger); + display: none; + } + + .error-state.active { + display: block; + } + + .error-state svg { + width: 48px; + height: 48px; + margin-bottom: var(--space-3); + color: var(--text-danger); + } + /* Modal */ .modal-overlay { display: none; @@ -241,8 +346,21 @@
+ +
+ +

Se încarcă obiceiurile...

+
+ + +
+ +

Eroare la încărcarea obiceiurilor

+ +
+ -
+