From 30df150b6f8042070d938ce937c71372745cb8db Mon Sep 17 00:00:00 2001 From: Lars Date: Sat, 21 Mar 2026 06:50:12 +0100 Subject: [PATCH] refactor: make UsageBadge more subtle and better positioned - Smaller font (0.65rem), more spacing (10px margin) - Reduced opacity (0.6), hover effect (0.9) - OK status now gray instead of green (less prominent) - Position: right-aligned in headings (flex space-between) - Buttons: badge on right side of main text, description below - Much more discreet overall appearance Co-Authored-By: Claude Opus 4.6 --- frontend/src/components/UsageBadge.css | 34 +++++++++++++++++--------- frontend/src/pages/Analysis.jsx | 8 +++--- frontend/src/pages/SettingsPage.jsx | 20 +++++++++------ frontend/src/pages/WeightScreen.jsx | 4 +-- 4 files changed, 40 insertions(+), 26 deletions(-) diff --git a/frontend/src/components/UsageBadge.css b/frontend/src/components/UsageBadge.css index 8675461..0ee296d 100644 --- a/frontend/src/components/UsageBadge.css +++ b/frontend/src/components/UsageBadge.css @@ -1,43 +1,53 @@ /** - * UsageBadge Styles + * UsageBadge Styles - Dezente Version * - * Small, visually distinct inline badge for usage indicators + * Sehr kleine, subtile Badge für Usage-Anzeige * Phase 3: Frontend Display */ .usage-badge { display: inline-block; - font-size: 0.75rem; + font-size: 0.65rem; font-weight: 500; - padding: 2px 6px; - border-radius: 4px; - margin-left: 6px; - opacity: 0.8; + padding: 2px 5px; + border-radius: 3px; + margin-left: 10px; + opacity: 0.6; font-variant-numeric: tabular-nums; white-space: nowrap; + transition: opacity 0.2s; +} + +.usage-badge:hover { + opacity: 0.9; } .usage-badge--ok { - color: var(--accent, #1D9E75); - background: rgba(29, 158, 117, 0.1); + color: var(--text3, #888); + background: rgba(136, 135, 128, 0.08); } .usage-badge--warning { color: #d97706; - background: rgba(217, 119, 6, 0.1); + background: rgba(217, 119, 6, 0.08); } .usage-badge--exceeded { color: var(--danger, #D85A30); background: rgba(216, 90, 48, 0.1); font-weight: 600; + opacity: 0.75; +} + +.usage-badge--exceeded:hover { + opacity: 1; } /* Responsive: Even smaller on mobile */ @media (max-width: 640px) { .usage-badge { - font-size: 0.7rem; + font-size: 0.6rem; padding: 1px 4px; - margin-left: 4px; + margin-left: 8px; } } diff --git a/frontend/src/pages/Analysis.jsx b/frontend/src/pages/Analysis.jsx index 6cf29aa..5e87962 100644 --- a/frontend/src/pages/Analysis.jsx +++ b/frontend/src/pages/Analysis.jsx @@ -240,8 +240,8 @@ export default function Analysis() {
-
- 🔬 Mehrstufige Gesamtanalyse +
+ 🔬 Mehrstufige Gesamtanalyse {aiUsage && }
@@ -295,8 +295,8 @@ export default function Analysis() {
-
- {SLUG_LABELS[p.slug]||p.name} +
+ {SLUG_LABELS[p.slug]||p.name} {aiUsage && }
{p.description &&
{p.description}
} diff --git a/frontend/src/pages/SettingsPage.jsx b/frontend/src/pages/SettingsPage.jsx index e893f46..d0e7d5e 100644 --- a/frontend/src/pages/SettingsPage.jsx +++ b/frontend/src/pages/SettingsPage.jsx @@ -379,17 +379,21 @@ export default function SettingsPage() {
)} {canExport && <> - - }
diff --git a/frontend/src/pages/WeightScreen.jsx b/frontend/src/pages/WeightScreen.jsx index f2e82e3..b74b8a1 100644 --- a/frontend/src/pages/WeightScreen.jsx +++ b/frontend/src/pages/WeightScreen.jsx @@ -69,8 +69,8 @@ export default function WeightScreen() { {/* Eingabe */}
-
- Eintrag hinzufügen +
+ Eintrag hinzufügen {weightUsage && }