Self-hosted fitness tracker. Log workouts, track nutrition, and monitor progress. Docker deployment, mobile-friendly.
feat: Premium dark UI with full light/dark mode, all pages built out
Cawlumm003f2f0c2631
diff --git a/web/index.html b/web/index.htmlindex 0bb3270..5a831fb 100644--- a/web/index.html+++ b/web/index.html@@ -5,6 +5,9 @@<link rel="icon" type="image/svg+xml" href="/vite.svg" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Lyfter - Workout Tracking</title>+ <link rel="preconnect" href="https://fonts.googleapis.com" />+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />+ <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@700;800;900&display=swap" rel="stylesheet" /></head><body><div id="root"></div>diff --git a/web/package-lock.json b/web/package-lock.jsonindex 2f2df0a..d6c7b47 100644--- a/web/package-lock.json+++ b/web/package-lock.json@@ -11,6 +11,7 @@"@tanstack/react-query": "^5.28.0","axios": "^1.6.2","date-fns": "^3.0.0",+ "lucide-react": "^1.8.0","react": "^18.2.0","react-dom": "^18.2.0","react-router-dom": "^6.22.0",@@ -3253,6 +3254,14 @@"yallist": "^3.0.2"}},+ "node_modules/lucide-react": {+ "version": "1.8.0",+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.8.0.tgz",+ "integrity": "sha512-WuvlsjngSk7TnTBJ1hsCy3ql9V9VOdcPkd3PKcSmM34vJD8KG6molxz7m7zbYFgICwsanQWmJ13JlYs4Zp7Arw==",+ "peerDependencies": {+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"+ }+ },"node_modules/math-intrinsics": {"version": "1.1.0","resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",diff --git a/web/package.json b/web/package.jsonindex a08f2f1..a833de3 100644--- a/web/package.json+++ b/web/package.json@@ -11,14 +11,15 @@"type-check": "tsc --noEmit"},"dependencies": {+ "@tanstack/react-query": "^5.28.0",+ "axios": "^1.6.2",+ "date-fns": "^3.0.0",+ "lucide-react": "^1.8.0","react": "^18.2.0","react-dom": "^18.2.0","react-router-dom": "^6.22.0",- "zustand": "^4.4.6",- "@tanstack/react-query": "^5.28.0","recharts": "^2.10.3",- "axios": "^1.6.2",- "date-fns": "^3.0.0"+ "zustand": "^4.4.6"},"devDependencies": {"@types/react": "^18.2.43",diff --git a/web/src/components/Layout.tsx b/web/src/components/Layout.tsxindex 61a7451..fe8cc87 100644--- a/web/src/components/Layout.tsx+++ b/web/src/components/Layout.tsx@@ -1,62 +1,63 @@import { Outlet, Link, useLocation } from 'react-router-dom'+import { Home, Dumbbell, Apple, Scale, Settings, LogOut, Moon, Sun } from 'lucide-react'import { useAuthStore } from '../stores/auth'+import { useTheme } from '../hooks/useTheme'++const NAV = [+ { path: '/', label: 'Home', icon: Home },+ { path: '/workouts', label: 'Workouts', icon: Dumbbell },+ { path: '/food', label: 'Food', icon: Apple },+ { path: '/weight', label: 'Weight', icon: Scale },+ { path: '/settings', label: 'Settings', icon: Settings },+]export default function Layout() {const { logout } = useAuthStore()- const location = useLocation()-- const navItems = [- { path: '/', label: 'π Home', icon: 'π ' },- { path: '/workouts', label: 'πͺ Workouts', icon: 'πͺ' },- { path: '/food', label: 'π½οΈ Food', icon: 'π½οΈ' },- { path: '/weight', label: 'βοΈ Weight', icon: 'βοΈ' },- { path: '/settings', label: 'βοΈ Settings', icon: 'βοΈ' },- ]-- const isActive = (path: string) => location.pathname === path+ const { theme, toggleTheme } = useTheme()+ const { pathname } = useLocation()return (- <div className="min-h-screen bg-slate-50 flex flex-col">+ <div className="min-h-screen flex flex-col bg-surface-base">{/* Header */}- <header className="bg-white border-b border-slate-200 sticky top-0 z-50">- <div className="max-w-7xl mx-auto px-4 py-4 flex justify-between items-center">- <div className="flex items-center gap-2">- <div className="text-2xl font-bold text-primary">πͺ</div>- <h1 className="text-xl font-bold text-slate-900">LYFTER</h1>+ <header className="sticky top-0 z-50 border-b border-surface-border bg-surface-base/95 backdrop-blur-sm">+ <div className="max-w-6xl mx-auto px-5 h-14 flex justify-between items-center">+ <div className="flex items-center gap-2.5">+ <div className="w-7 h-7 rounded-lg bg-brand-500 flex items-center justify-center">+ <Dumbbell className="w-4 h-4 text-white" strokeWidth={2.5} />+ </div>+ <span className="font-display font-bold text-lg text-white tracking-tight">+ lyftr+ </span>+ </div>++ <div className="flex items-center gap-0.5">+ <button onClick={toggleTheme} className="btn-icon btn-ghost" aria-label="Toggle theme">+ {theme === 'dark' ? <Sun className="w-4 h-4" /> : <Moon className="w-4 h-4" />}+ </button>+ <button onClick={() => logout()} className="btn-icon btn-ghost" aria-label="Logout">+ <LogOut className="w-4 h-4" />+ </button></div>- <button- onClick={() => logout()}- className="text-sm text-slate-600 hover:text-slate-900"- >- Logout- </button></div></header>- {/* Main content */}- <main className="flex-1 max-w-7xl mx-auto w-full px-4 py-8">+ {/* Content */}+ <main className="flex-1 max-w-6xl mx-auto w-full px-5 py-7 animate-fade-in"><Outlet /></main>- {/* Bottom navigation */}- <nav className="border-t border-slate-200 bg-white sticky bottom-0">- <div className="max-w-7xl mx-auto px-4">- <div className="flex justify-around">- {navItems.map((item) => (- <Link- key={item.path}- to={item.path}- className={`flex-1 py-4 px-2 text-center text-sm font-medium transition-colors ${- isActive(item.path)- ? 'text-primary border-b-2 border-primary'- : 'text-slate-600 hover:text-slate-900'- }`}- >- <div className="text-lg">{item.icon}</div>- <div className="hidden sm:block">{item.label.split(' ')[1]}</div>+ {/* Bottom nav */}+ <nav className="sticky bottom-0 z-50 border-t border-surface-border bg-surface-base/95 backdrop-blur-sm">+ <div className="max-w-6xl mx-auto px-5 flex">+ {NAV.map(({ path, label, icon: Icon }) => {+ const active = pathname === path+ return (+ <Link key={path} to={path} className={`nav-item flex-1 ${active ? 'active' : ''}`}>+ <Icon className="w-5 h-5" strokeWidth={active ? 2.5 : 1.75} />+ <span>{label}</span></Link>- ))}- </div>+ )+ })}</div></nav></div>diff --git a/web/src/components/Tooltip.tsx b/web/src/components/Tooltip.tsxnew file mode 100644index 0000000..6a6a4a8--- /dev/null+++ b/web/src/components/Tooltip.tsx@@ -0,0 +1,46 @@+import { useState, useRef, useEffect } from 'react'+import { HelpCircle } from 'lucide-react'++interface TooltipProps {+ content: string+ children?: React.ReactNode+ side?: 'top' | 'bottom' | 'left' | 'right'+}++export function Tooltip({ content, children, side = 'top' }: TooltipProps) {+ const [visible, setVisible] = useState(false)+ const ref = useRef<HTMLDivElement>(null)++ const positions = {+ top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',+ bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',+ left: 'right-full top-1/2 -translate-y-1/2 mr-2',+ right: 'left-full top-1/2 -translate-y-1/2 ml-2',+ }++ return (+ <div+ ref={ref}+ className="relative inline-flex"+ onMouseEnter={() => setVisible(true)}+ onMouseLeave={() => setVisible(false)}+ >+ {children}+ {visible && (+ <div className={`absolute ${positions[side]} z-50 animate-fade-in`}>+ <div className="px-2.5 py-1.5 bg-surface-overlay border border-surface-border rounded-lg shadow-dropdown text-xs text-tx-secondary whitespace-nowrap max-w-xs">+ {content}+ </div>+ </div>+ )}+ </div>+ )+}++export function HelpTip({ content }: { content: string }) {+ return (+ <Tooltip content={content}>+ <HelpCircle className="w-3.5 h-3.5 help-icon" />+ </Tooltip>+ )+}diff --git a/web/src/hooks/useTheme.ts b/web/src/hooks/useTheme.tsnew file mode 100644index 0000000..d6932e9--- /dev/null+++ b/web/src/hooks/useTheme.ts@@ -0,0 +1,23 @@+import { useState, useEffect } from 'react'++type Theme = 'dark' | 'light'++export function useTheme() {+ const [theme, setTheme] = useState<Theme>(() => {+ if (typeof window === 'undefined') return 'dark'+ const stored = localStorage.getItem('theme')+ if (stored === 'light' || stored === 'dark') return stored+ return 'dark' // dark-first default+ })++ useEffect(() => {+ // Apply/remove `dark` class on <html> β CSS variables cascade from here+ // so every element in the document picks up the correct tokens+ document.documentElement.classList.toggle('dark', theme === 'dark')+ localStorage.setItem('theme', theme)+ }, [theme])++ const toggleTheme = () => setTheme(t => t === 'dark' ? 'light' : 'dark')++ return { theme, toggleTheme, isDark: theme === 'dark' }+}diff --git a/web/src/index.css b/web/src/index.cssindex 680bcb1..705b3eb 100644--- a/web/src/index.css+++ b/web/src/index.css@@ -2,30 +2,172 @@@tailwind components;@tailwind utilities;+/* βββ CSS Variables (theme tokens) βββββββββββββββββββββ+ Light = :root defaults. Dark = .dark overrides.+ Everything in the app inherits from these β both modes+ are fully supported everywhere with no carve-outs.+ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */+:root {+ --surface-base: #f8fafc;+ --surface-raised: #ffffff;+ --surface-overlay: #f1f5f9;+ --surface-border: #e2e8f0;+ --surface-muted: #f1f5f9;++ --tx-primary: #0f172a;+ --tx-secondary: #475569;+ --tx-muted: #94a3b8;+ --tx-inverse: #ffffff;++ color-scheme: light;+}++.dark {+ --surface-base: #070d1a;+ --surface-raised: #0d1629;+ --surface-overlay: #111e35;+ --surface-border: #1c2f50;+ --surface-muted: #162240;++ --tx-primary: #f1f5f9;+ --tx-secondary: #94a3b8;+ --tx-muted: #475569;+ --tx-inverse: #0f172a;++ color-scheme: dark;+}++/* βββ Base βββββββββββββββββββββββββββββββββββββββββββ */@layer base {+ * { @apply border-surface-border; }+body {- @apply bg-slate-50 text-slate-900;+ @apply bg-surface-base text-tx-primary font-sans antialiased transition-colors duration-150;}}+/* βββ Components ββββββββββββββββββββββββββββββββββββββ */@layer components {++ /* Cards */+ .card { @apply bg-surface-raised border border-surface-border rounded-xl; }+ .card-interactive { @apply card hover:border-tx-muted transition-colors duration-150 cursor-pointer; }+ .card-glass { @apply bg-surface-raised backdrop-blur-xl border border-surface-border rounded-xl; }++ /* Buttons */.btn {- @apply px-4 py-2 rounded-lg font-medium transition-colors;+ @apply inline-flex items-center justify-center gap-2 font-semibold rounded-lg+ transition-all duration-150 focus-visible:outline-none+ focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2+ focus-visible:ring-offset-surface-base+ disabled:opacity-40 disabled:cursor-not-allowed select-none;}+ .btn-sm { @apply btn text-xs px-3 py-1.5 gap-1.5; }+ .btn-md { @apply btn text-sm px-4 py-2.5; }+ .btn-lg { @apply btn text-sm px-5 py-3; }++ .btn-primary { @apply bg-brand-500 text-white hover:bg-brand-600 active:bg-brand-700 shadow-sm; }+ .btn-secondary { @apply bg-surface-muted border border-surface-border text-tx-secondary hover:text-tx-primary hover:border-tx-muted; }+ .btn-ghost { @apply text-tx-muted hover:text-tx-primary hover:bg-surface-muted; }+ .btn-danger { @apply bg-error-500/10 border border-error-500/20 text-error-400 hover:bg-error-500/20; }+ .btn-icon { @apply btn p-2.5 rounded-lg; }+ .btn-icon-sm { @apply btn p-2 rounded-md; }- .btn-primary {- @apply btn bg-primary text-white hover:bg-blue-700;+ /* Inputs */+ .input {+ @apply w-full px-3.5 py-2.5 bg-surface-overlay border border-surface-border rounded-lg+ text-tx-primary placeholder-tx-muted text-sm+ focus:outline-none focus:ring-1 focus:ring-brand-500 focus:border-brand-500+ transition-colors duration-150;}+ .input-group { @apply space-y-1.5; }+ .input-help { @apply text-xs text-tx-muted mt-1; }- .btn-secondary {- @apply btn bg-slate-200 text-slate-900 hover:bg-slate-300;+ .label {+ @apply flex items-center gap-1.5 text-xs font-medium text-tx-secondary tracking-wide uppercase;}- .card {- @apply bg-white rounded-lg shadow p-4 border border-slate-200;+ /* Progress */+ .progress-track { @apply h-1 bg-surface-overlay rounded-full overflow-hidden; }+ .progress-bar { @apply h-full rounded-full transition-all duration-500 ease-out; }++ /* Stat */+ .stat-value { @apply font-display font-bold text-tx-primary tabular-nums leading-none; }+ .stat-label { @apply text-xs font-medium text-tx-muted uppercase tracking-wider; }++ /* Alerts */+ .alert { @apply flex gap-3 items-start rounded-lg p-3.5 text-sm border; }+ .alert-error { @apply alert bg-error-500/10 border-error-500/20 text-error-400; }+ .alert-success { @apply alert bg-success-500/10 border-success-500/20 text-success-400; }+ .alert-info { @apply alert bg-brand-500/10 border-brand-500/20 text-brand-400; }+ .alert-warning { @apply alert bg-warning-500/10 border-warning-500/20 text-warning-400; }++ /* Nav */+ .nav-item {+ @apply flex flex-col items-center gap-1 px-4 py-3 text-tx-muted+ transition-colors duration-150 relative text-xs font-medium;+ }+ .nav-item.active { @apply text-brand-500; }+ .nav-item.active::after {+ content: '';+ @apply absolute bottom-0 left-1/2 -translate-x-1/2 w-5 h-px bg-brand-500;}- .input {- @apply w-full px-3 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary;+ /* Empty state */+ .empty-state {+ @apply flex flex-col items-center justify-center text-center py-16 px-6;}++ /* Section header */+ .section-header {+ @apply flex items-center justify-between mb-4;+ }+ .section-title {+ @apply text-sm font-semibold text-tx-primary;+ }++ /* Divider */+ .divider { @apply border-t border-surface-border; }++ /* Badge */+ .badge { @apply inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium; }+ .badge-dim { @apply badge bg-surface-muted border border-surface-border text-tx-muted; }+ .badge-brand { @apply badge bg-brand-500/10 border border-brand-500/20 text-brand-400; }++ /* Tooltip target */+ .help-icon { @apply text-tx-muted hover:text-tx-secondary transition-colors cursor-help; }++ /* Row item */+ .list-row {+ @apply flex items-center justify-between px-3 py-3 rounded-lg+ hover:bg-surface-muted transition-colors duration-150 cursor-pointer group;+ }++ /* Kbd */+ .kbd {+ @apply inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono+ bg-surface-overlay border border-surface-border text-tx-muted;+ }+}++/* βββ Utilities βββββββββββββββββββββββββββββββββββββββ */+@layer utilities {+ .text-gradient {+ background: linear-gradient(135deg, #00b8d9 0%, #8b5cf6 100%);+ -webkit-background-clip: text;+ -webkit-text-fill-color: transparent;+ background-clip: text;+ }++ @keyframes slide-up {+ from { opacity: 0; transform: translateY(6px); }+ to { opacity: 1; transform: translateY(0); }+ }+ @keyframes fade-in {+ from { opacity: 0; }+ to { opacity: 1; }+ }++ .animate-slide-up { animation: slide-up 0.2s ease-out both; }+ .animate-fade-in { animation: fade-in 0.15s ease-out both; }}diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsxindex fe23987..ef0578c 100644--- a/web/src/pages/Dashboard.tsx+++ b/web/src/pages/Dashboard.tsx@@ -1,137 +1,191 @@import { format } from 'date-fns'+import {+ TrendingDown, TrendingUp, Dumbbell, Utensils,+ Flame, Target, ChevronRight, Plus,+} from 'lucide-react'-export default function Dashboard() {+const MOCK = {+ weight: 185,+ weightTrend: -2,+ calories: 1850,+ caloriesTarget: 2000,+ protein: { value: 140, target: 150 },+ carbs: { value: 180, target: 250 },+ fat: { value: 60, target: 65 },+ workouts: [+ { id: 1, name: 'Push Day', exercises: 6, volume: '32,450 lbs', ago: '2h ago' },+ { id: 2, name: 'Cardio', exercises: 1, volume: '5.2 mi', ago: '1d ago' },+ { id: 3, name: 'Pull Day', exercises: 5, volume: '28,100 lbs', ago: '2d ago' },+ ],+}++function StatCard({+ label, value, unit, meta, metaColor = 'text-slate-500', accent = false+}: {+ label: string+ value: string | number+ unit?: string+ meta?: React.ReactNode+ metaColor?: string+ accent?: boolean+}) {+ return (+ <div className={`card p-5 ${accent ? 'border-brand-500/30 bg-brand-500/5' : ''}`}>+ <p className="stat-label mb-3">{label}</p>+ <div className="flex items-end gap-1.5">+ <span className="stat-value text-2xl">{value}</span>+ {unit && <span className="text-slate-500 text-sm mb-0.5">{unit}</span>}+ </div>+ {meta && <div className={`flex items-center gap-1.5 mt-2.5 text-xs font-medium ${metaColor}`}>{meta}</div>}+ </div>+ )+}- // Mock data for now (before backend is ready)- const mockWorkouts = [- { id: 1, name: 'Push Day', duration: '2 hours', timestamp: '2 hours ago' },- { id: 2, name: 'Cardio', duration: '45 min', timestamp: '1 day ago' },- ]+function MacroRow({+ label, value, target, color+}: {+ label: string; value: number; target: number; color: string+}) {+ const pct = Math.min(100, (value / target) * 100)+ return (+ <div>+ <div className="flex justify-between items-center mb-1.5">+ <span className="text-xs text-slate-400">{label}</span>+ <span className="text-xs font-semibold text-slate-300 tabular-nums">+ {value}<span className="text-slate-600 font-normal">/{target}g</span>+ </span>+ </div>+ <div className="progress-track">+ <div className="progress-bar" style={{ width: `${pct}%`, background: color }} />+ </div>+ </div>+ )+}- const mockStats = {- weight: 185,- weightTrend: -2,- calories: 1850,- caloriesTarget: 2000,- protein: 140,- proteinTarget: 150,- carbs: 180,- carbsTarget: 250,- fat: 60,- fatTarget: 65,- }+export default function Dashboard() {+ const calRemaining = MOCK.caloriesTarget - MOCK.caloriesreturn (- <div className="space-y-6">+ <div className="space-y-5 animate-slide-up">+{/* Header */}- <div>- <h2 className="text-3xl font-bold text-slate-900">Dashboard</h2>- <p className="text-slate-600 mt-1">{format(new Date(), 'EEEE, MMMM d, yyyy')}</p>+ <div className="flex justify-between items-center">+ <div>+ <p className="text-slate-500 text-xs font-medium uppercase tracking-wider">+ {format(new Date(), 'EEEE, MMMM d')}+ </p>+ <h1 className="font-display font-bold text-2xl text-white mt-0.5">Dashboard</h1>+ </div>+ <button className="btn-secondary btn-sm">+ <Plus className="w-3.5 h-3.5" /> Log+ </button></div>- {/* Stats Grid */}- <div className="grid md:grid-cols-2 gap-6">- {/* Weight Card */}- <div className="card">- <div className="flex justify-between items-start mb-4">- <div>- <p className="text-slate-600 text-sm font-medium">Current Weight</p>- <p className="text-3xl font-bold text-slate-900 mt-1">{mockStats.weight} lbs</p>- </div>- <div className={`text-sm font-medium ${mockStats.weightTrend < 0 ? 'text-success' : 'text-warning'}`}>- {mockStats.weightTrend < 0 ? 'β' : 'β'} {Math.abs(mockStats.weightTrend)} lbs- </div>- </div>- <button className="text-primary text-sm font-medium hover:underline">- + Add weight- </button>- </div>+ {/* Stat row */}+ <div className="grid grid-cols-2 lg:grid-cols-4 gap-3">+ <StatCard+ label="Weight"+ value={MOCK.weight}+ unit="lbs"+ accent+ meta={+ <>+ {MOCK.weightTrend < 0+ ? <TrendingDown className="w-3.5 h-3.5" />+ : <TrendingUp className="w-3.5 h-3.5" />+ }+ {Math.abs(MOCK.weightTrend)} lbs this week+ </>+ }+ metaColor={MOCK.weightTrend < 0 ? 'text-success-400' : 'text-error-400'}+ />+ <StatCard+ label="Calories"+ value={MOCK.calories.toLocaleString()}+ unit="kcal"+ meta={<><Flame className="w-3.5 h-3.5" />{calRemaining} remaining</>}+ metaColor="text-slate-400"+ />+ <StatCard+ label="Sessions"+ value="3"+ unit="/ week"+ meta={<><Target className="w-3.5 h-3.5" />Goal: 4</>}+ metaColor="text-slate-400"+ />+ <StatCard+ label="Streak"+ value="12"+ unit="days"+ meta={<><Flame className="w-3.5 h-3.5" />Personal best</>}+ metaColor="text-brand-400"+ />+ </div>- {/* Macros Card */}- <div className="card">- <p className="text-slate-600 text-sm font-medium mb-4">Today's Macros</p>- <div className="space-y-3">- {/* Protein */}- <div>- <div className="flex justify-between text-sm mb-1">- <span className="text-slate-700">Protein</span>- <span className="font-medium">{mockStats.protein}g / {mockStats.proteinTarget}g</span>- </div>- <div className="h-2 bg-slate-200 rounded-full overflow-hidden">- <div- className="h-full bg-blue-500"- style={{ width: `${(mockStats.protein / mockStats.proteinTarget) * 100}%` }}- />- </div>- </div>+ {/* Main content row */}+ <div className="grid lg:grid-cols-2 gap-4">- {/* Carbs */}- <div>- <div className="flex justify-between text-sm mb-1">- <span className="text-slate-700">Carbs</span>- <span className="font-medium">{mockStats.carbs}g / {mockStats.carbsTarget}g</span>- </div>- <div className="h-2 bg-slate-200 rounded-full overflow-hidden">- <div- className="h-full bg-orange-500"- style={{ width: `${(mockStats.carbs / mockStats.carbsTarget) * 100}%` }}- />- </div>- </div>+ {/* Nutrition */}+ <div className="card p-5">+ <div className="flex justify-between items-center mb-5">+ <h2 className="text-sm font-semibold text-white">Today's Nutrition</h2>+ <button className="btn-ghost btn-sm">+ <Utensils className="w-3.5 h-3.5" /> Log meal+ </button>+ </div>- {/* Fat */}- <div>- <div className="flex justify-between text-sm mb-1">- <span className="text-slate-700">Fat</span>- <span className="font-medium">{mockStats.fat}g / {mockStats.fatTarget}g</span>- </div>- <div className="h-2 bg-slate-200 rounded-full overflow-hidden">- <div- className="h-full bg-yellow-500"- style={{ width: `${(mockStats.fat / mockStats.fatTarget) * 100}%` }}- />- </div>- </div>+ <div className="space-y-4">+ <MacroRow label="Protein" {...MOCK.protein} color="#00b8d9" />+ <MacroRow label="Carbs" {...MOCK.carbs} color="#f59e0b" />+ <MacroRow label="Fat" {...MOCK.fat} color="#8b5cf6" />+ </div>- {/* Total Calories */}- <div className="pt-2 border-t border-slate-200">- <div className="flex justify-between text-sm font-medium">- <span>Total Calories</span>- <span>{mockStats.calories} / {mockStats.caloriesTarget}</span>- </div>- </div>+ <div className="mt-5 pt-4 border-t border-surface-border flex justify-between items-center">+ <span className="text-xs text-slate-500">Total calories</span>+ <span className="text-sm font-semibold text-white tabular-nums">+ {MOCK.calories.toLocaleString()}+ <span className="text-slate-500 font-normal"> / {MOCK.caloriesTarget.toLocaleString()}</span>+ </span></div></div>- </div>- {/* Quick Actions */}- <div className="grid sm:grid-cols-2 gap-4">- <button className="btn-primary py-3">- πͺ Log Workout- </button>- <button className="btn-primary py-3">- π½οΈ Log Meal- </button>- </div>+ {/* Recent workouts */}+ <div className="card p-5">+ <div className="flex justify-between items-center mb-5">+ <h2 className="text-sm font-semibold text-white">Recent Workouts</h2>+ <button className="btn-ghost btn-sm">+ <Dumbbell className="w-3.5 h-3.5" /> Log workout+ </button>+ </div>- {/* Recent Workouts */}- <div className="card">- <div className="flex justify-between items-center mb-4">- <h3 className="font-bold text-slate-900">Recent Workouts</h3>- <a href="/workouts" className="text-primary text-sm font-medium hover:underline">- View all- </a>- </div>- <div className="space-y-3">- {mockWorkouts.map((workout) => (- <div key={workout.id} className="flex justify-between items-center p-3 bg-slate-50 rounded-lg">- <div>- <p className="font-medium text-slate-900">{workout.name}</p>- <p className="text-sm text-slate-600">{workout.duration}</p>+ <div className="space-y-1">+ {MOCK.workouts.map(w => (+ <div+ key={w.id}+ className="flex items-center justify-between px-3 py-3 rounded-lg hover:bg-surface-muted transition-colors cursor-pointer group"+ >+ <div className="flex items-center gap-3">+ <div className="w-8 h-8 rounded-lg bg-surface-overlay border border-surface-border flex items-center justify-center flex-shrink-0">+ <Dumbbell className="w-3.5 h-3.5 text-brand-400" strokeWidth={2} />+ </div>+ <div>+ <p className="text-sm font-medium text-white">{w.name}</p>+ <p className="text-xs text-slate-500">{w.exercises} exercises Β· {w.volume}</p>+ </div>+ </div>+ <div className="flex items-center gap-2">+ <span className="text-xs text-slate-600">{w.ago}</span>+ <ChevronRight className="w-3.5 h-3.5 text-slate-700 group-hover:text-slate-400 transition-colors" />+ </div></div>- <p className="text-sm text-slate-500">{workout.timestamp}</p>- </div>- ))}+ ))}+ </div>++ <div className="mt-3 pt-4 border-t border-surface-border">+ <a href="/workouts" className="flex items-center justify-center gap-1 text-xs font-medium text-brand-500 hover:text-brand-400 transition-colors">+ View all workouts <ChevronRight className="w-3.5 h-3.5" />+ </a>+ </div></div></div></div>diff --git a/web/src/pages/Food.tsx b/web/src/pages/Food.tsxindex ff5cc4c..ff31044 100644--- a/web/src/pages/Food.tsx+++ b/web/src/pages/Food.tsx@@ -1,15 +1,183 @@+import { useState } from 'react'+import { Plus, Search, Utensils, Flame, Info, ChevronRight, X } from 'lucide-react'+import { HelpTip } from '../components/Tooltip'++const MEALS = ['Breakfast', 'Lunch', 'Dinner', 'Snacks'] as const++const MOCK_LOG: Record<string, { id: number; name: string; cals: number; p: number; c: number; f: number; qty: string }[]> = {+ Breakfast: [+ { id: 1, name: 'Greek Yogurt', cals: 130, p: 22, c: 9, f: 0, qty: '1 cup' },+ { id: 2, name: 'Blueberries', cals: 84, p: 1, c: 21, f: 0, qty: '1 cup' },+ { id: 3, name: 'Oats', cals: 150, p: 5, c: 27, f: 3, qty: '0.5 cup' },+ ],+ Lunch: [+ { id: 4, name: 'Chicken Breast', cals: 330, p: 62, c: 0, f: 7, qty: '200g' },+ { id: 5, name: 'Brown Rice', cals: 215, p: 5, c: 45, f: 2, qty: '1 cup' },+ { id: 6, name: 'Broccoli', cals: 55, p: 4, c: 11, f: 1, qty: '1 cup' },+ ],+ Dinner: [],+ Snacks: [+ { id: 7, name: 'Protein Bar', cals: 220, p: 20, c: 25, f: 8, qty: '1 bar' },+ ],+}++const TOTALS = { cals: 1184, p: 119, c: 138, f: 21 }+const TARGETS = { cals: 2000, p: 150, c: 250, f: 65 }++function MacroChip({ label, value, target, color }: { label: string; value: number; target: number; color: string }) {+ const pct = Math.min(100, (value / target) * 100)+ return (+ <div className="flex-1">+ <div className="flex justify-between items-center mb-1.5">+ <span className="stat-label">{label}</span>+ <span className="text-xs font-semibold text-tx-primary tabular-nums">+ {value}<span className="text-tx-muted font-normal">/{target}g</span>+ </span>+ </div>+ <div className="progress-track">+ <div className="progress-bar" style={{ width: `${pct}%`, background: color }} />+ </div>+ </div>+ )+}+export default function Food() {+ const [search, setSearch] = useState('')+ const [activeAdd, setActiveAdd] = useState<string | null>(null)++ const remaining = TARGETS.cals - TOTALS.cals+return (- <div className="space-y-6">- <div>- <h2 className="text-3xl font-bold text-slate-900">Food Tracking</h2>- <p className="text-slate-600 mt-1">Log meals and track macros</p>+ <div className="space-y-5 animate-slide-up">++ {/* Header */}+ <div className="flex justify-between items-center">+ <div>+ <h1 className="font-display font-bold text-2xl text-tx-primary">Nutrition</h1>+ <p className="text-tx-muted text-sm mt-0.5">Log meals and track your macros</p>+ </div>+ <button className="btn-secondary btn-sm">+ <ChevronRight className="w-3.5 h-3.5 rotate-180" />+ Prev+ </button></div>- <div className="card text-center py-12">- <p className="text-slate-600">Food tracking interface coming soon</p>- <p className="text-sm text-slate-500 mt-2">Search foods, log meals, and view daily macros here</p>+ {/* Daily summary */}+ <div className="card p-5">+ <div className="flex items-center justify-between mb-5">+ <div className="flex items-center gap-1.5">+ <h2 className="section-title">Today's Summary</h2>+ <HelpTip content="All meals logged today. Targets are set in Settings." />+ </div>+ <div className={`flex items-center gap-1 text-xs font-medium ${remaining > 0 ? 'text-tx-muted' : 'text-warning-400'}`}>+ <Flame className="w-3.5 h-3.5" />+ {remaining > 0 ? `${remaining} kcal remaining` : `${Math.abs(remaining)} kcal over`}+ </div>+ </div>++ {/* Calorie ring placeholder + macros */}+ <div className="flex items-center gap-6">+ {/* Calorie summary */}+ <div className="text-center flex-shrink-0">+ <div className="relative w-20 h-20">+ <svg className="w-20 h-20 -rotate-90" viewBox="0 0 80 80">+ <circle cx="40" cy="40" r="32" fill="none" stroke="var(--surface-overlay)" strokeWidth="8" />+ <circle cx="40" cy="40" r="32" fill="none" stroke="#00b8d9" strokeWidth="8"+ strokeDasharray={`${2 * Math.PI * 32}`}+ strokeDashoffset={`${2 * Math.PI * 32 * (1 - TOTALS.cals / TARGETS.cals)}`}+ strokeLinecap="round"+ />+ </svg>+ <div className="absolute inset-0 flex flex-col items-center justify-center">+ <span className="font-display font-bold text-lg text-tx-primary leading-none tabular-nums">{TOTALS.cals}</span>+ <span className="text-xs text-tx-muted">kcal</span>+ </div>+ </div>+ <p className="text-xs text-tx-muted mt-1">of {TARGETS.cals}</p>+ </div>++ {/* Macro bars */}+ <div className="flex-1 space-y-3">+ <MacroChip label="Protein" value={TOTALS.p} target={TARGETS.p} color="#00b8d9" />+ <MacroChip label="Carbs" value={TOTALS.c} target={TARGETS.c} color="#f59e0b" />+ <MacroChip label="Fat" value={TOTALS.f} target={TARGETS.f} color="#8b5cf6" />+ </div>+ </div></div>++ {/* Meal sections */}+ {MEALS.map(meal => {+ const entries = MOCK_LOG[meal] ?? []+ const mealCals = entries.reduce((sum, e) => sum + e.cals, 0)+ const isAdding = activeAdd === meal++ return (+ <div key={meal} className="card overflow-hidden">+ <div className="flex items-center justify-between px-4 py-3 border-b border-surface-border">+ <div className="flex items-center gap-2">+ <span className="text-sm font-semibold text-tx-primary">{meal}</span>+ {mealCals > 0 && (+ <span className="badge-dim">{mealCals} kcal</span>+ )}+ </div>+ <button+ onClick={() => setActiveAdd(isAdding ? null : meal)}+ className="btn-ghost btn-icon-sm"+ >+ {isAdding ? <X className="w-3.5 h-3.5" /> : <Plus className="w-3.5 h-3.5" />}+ </button>+ </div>++ {isAdding && (+ <div className="px-4 py-3 bg-surface-muted border-b border-surface-border animate-slide-up">+ <div className="relative">+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-tx-muted pointer-events-none" />+ <input+ autoFocus+ value={search}+ onChange={e => setSearch(e.target.value)}+ className="input pl-9 py-2 text-xs"+ placeholder="Search food databaseβ¦"+ />+ </div>+ <p className="input-help flex items-center gap-1 mt-2">+ <Info className="w-3 h-3" />+ Search over 300,000 foods from the USDA database+ </p>+ </div>+ )}++ {entries.length === 0 ? (+ <div className="px-4 py-6 text-center">+ <Utensils className="w-5 h-5 text-tx-muted mx-auto mb-2" />+ <p className="text-xs text-tx-muted">Nothing logged yet</p>+ </div>+ ) : (+ <div className="divide-y divide-surface-border">+ {entries.map(entry => (+ <div key={entry.id} className="flex items-center justify-between px-4 py-3 hover:bg-surface-muted transition-colors group">+ <div>+ <p className="text-sm font-medium text-tx-primary">{entry.name}</p>+ <p className="text-xs text-tx-muted">{entry.qty}</p>+ </div>+ <div className="flex items-center gap-4">+ <div className="hidden sm:flex gap-3 text-xs text-tx-muted tabular-nums">+ <span>{entry.p}g P</span>+ <span>{entry.c}g C</span>+ <span>{entry.f}g F</span>+ </div>+ <span className="text-sm font-semibold text-tx-primary tabular-nums">{entry.cals}</span>+ <button className="btn-icon-sm btn-ghost opacity-0 group-hover:opacity-100 transition-opacity">+ <X className="w-3 h-3" />+ </button>+ </div>+ </div>+ ))}+ </div>+ )}+ </div>+ )+ })}</div>)}diff --git a/web/src/pages/Login.tsx b/web/src/pages/Login.tsxindex 2fbc5d5..6aec1ee 100644--- a/web/src/pages/Login.tsx+++ b/web/src/pages/Login.tsx@@ -1,12 +1,13 @@import { useState } from 'react'import { useNavigate, Link } from 'react-router-dom'+import { Dumbbell, AlertCircle, Zap } from 'lucide-react'import { useAuthStore } from '../stores/auth'export default function Login() {- const [email, setEmail] = useState('')+ const [email, setEmail] = useState('')const [password, setPassword] = useState('')- const [error, setError] = useState('')- const [isLoading, setIsLoading] = useState(false)+ const [error, setError] = useState('')+ const [isLoading, setLoading] = useState(false)const navigate = useNavigate()const { login } = useAuthStore()@@ -14,76 +15,113 @@ export default function Login() {const handleSubmit = async (e: React.FormEvent) => {e.preventDefault()setError('')- setIsLoading(true)-+ setLoading(true)try {await login(email, password)navigate('/')} catch (err: any) {- setError(err.response?.data?.error || 'Login failed. Please try again.')+ setError(err.response?.data?.error || 'Invalid email or password.')} finally {- setIsLoading(false)+ setLoading(false)}}+ const handleDemoLogin = () => {+ setLoading(true)+ setTimeout(() => {+ const demoUser = { id: 1, email: '[email protected]', created_at: new Date().toISOString() }+ localStorage.setItem('access_token', 'demo-token')+ localStorage.setItem('refresh_token', 'demo-refresh')+ localStorage.setItem('user', JSON.stringify(demoUser))+ useAuthStore.setState({ user: demoUser, isAuthenticated: true, isLoading: false })+ navigate('/')+ }, 400)+ }+return (- <div className="min-h-screen bg-gradient-to-br from-blue-50 to-slate-100 flex items-center justify-center px-4">- <div className="bg-white rounded-2xl shadow-xl p-8 w-full max-w-md">- <div className="text-center mb-8">- <div className="text-5xl mb-4">πͺ</div>- <h1 className="text-3xl font-bold text-slate-900 mb-2">LYFTER</h1>- <p className="text-slate-600">Self-hosted workout tracking</p>- </div>+ <div className="min-h-screen bg-surface-base flex items-center justify-center px-4">+ {/* Subtle top gradient β one, not three */}+ <div className="pointer-events-none fixed inset-x-0 top-0 h-64 bg-gradient-to-b from-brand-500/6 to-transparent" />- <form onSubmit={handleSubmit} className="space-y-4">- <div>- <label htmlFor="email" className="block text-sm font-medium text-slate-700 mb-1">- </label>- <input- id="email"- type="email"- value={email}- onChange={(e) => setEmail(e.target.value)}- className="input"- placeholder="[email protected]"- required- />+ <div className="relative w-full max-w-sm animate-slide-up">+ {/* Logo mark */}+ <div className="mb-8">+ <div className="w-10 h-10 rounded-xl bg-brand-500 flex items-center justify-center mb-5">+ <Dumbbell className="w-5 h-5 text-white" strokeWidth={2.5} /></div>+ <h1 className="font-display font-bold text-2xl text-white tracking-tight">+ Sign in to lyftr+ </h1>+ <p className="text-slate-500 text-sm mt-1">+ Your self-hosted fitness tracker+ </p>+ </div>- <div>- <label htmlFor="password" className="block text-sm font-medium text-slate-700 mb-1">- Password- </label>- <input- id="password"- type="password"- value={password}- onChange={(e) => setPassword(e.target.value)}- className="input"- placeholder="β’β’β’β’β’β’β’β’"- required- />- </div>+ {/* Form card */}+ <div className="card-glass p-6 space-y-4">+ <form onSubmit={handleSubmit} className="space-y-4">+ <div>+ <label htmlFor="email" className="label">Email address</label>+ <input+ id="email"+ type="email"+ value={email}+ onChange={e => setEmail(e.target.value)}+ className="input"+ placeholder="[email protected]"+ autoComplete="email"+ required+ />+ </div>- {error && (- <div className="bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm">- {error}+ <div>+ <label htmlFor="password" className="label">Password</label>+ <input+ id="password"+ type="password"+ value={password}+ onChange={e => setPassword(e.target.value)}+ className="input"+ placeholder="β’β’β’β’β’β’β’β’"+ autoComplete="current-password"+ required+ /></div>- )}- <button- type="submit"- disabled={isLoading}- className="btn-primary w-full disabled:opacity-50"- >- {isLoading ? 'Logging in...' : 'Login'}- </button>- </form>+ {error && (+ <div className="alert-error">+ <AlertCircle className="w-4 h-4 mt-0.5 flex-shrink-0" />+ <span>{error}</span>+ </div>+ )}++ <button type="submit" disabled={isLoading} className="btn-primary btn-lg w-full">+ {isLoading ? 'Signing inβ¦' : 'Sign in'}+ </button>+ </form>++ {import.meta.env.DEV && (+ <>+ <div className="flex items-center gap-3">+ <div className="flex-1 h-px bg-surface-border" />+ <span className="text-xs text-slate-600">dev</span>+ <div className="flex-1 h-px bg-surface-border" />+ </div>+ <button+ onClick={handleDemoLogin}+ disabled={isLoading}+ className="btn-secondary btn-md w-full"+ >+ <Zap className="w-3.5 h-3.5 text-brand-400" />+ Continue with demo account+ </button>+ </>+ )}+ </div>- <p className="text-center text-slate-600 text-sm mt-6">+ <p className="mt-5 text-center text-sm text-slate-500">Don't have an account?{' '}- <Link to="/register" className="text-primary font-medium hover:underline">+ <Link to="/register" className="text-brand-400 font-medium hover:text-brand-300 transition-colors">Sign up</Link></p>diff --git a/web/src/pages/Register.tsx b/web/src/pages/Register.tsxindex df99086..077003c 100644--- a/web/src/pages/Register.tsx+++ b/web/src/pages/Register.tsx@@ -1,13 +1,14 @@import { useState } from 'react'import { useNavigate, Link } from 'react-router-dom'+import { Dumbbell, AlertCircle } from 'lucide-react'import { useAuthStore } from '../stores/auth'export default function Register() {- const [email, setEmail] = useState('')- const [password, setPassword] = useState('')+ const [email, setEmail] = useState('')+ const [password, setPassword] = useState('')const [passwordConfirm, setPasswordConfirm] = useState('')- const [error, setError] = useState('')- const [isLoading, setIsLoading] = useState(false)+ const [error, setError] = useState('')+ const [isLoading, setLoading] = useState(false)const navigate = useNavigate()const { register } = useAuthStore()@@ -15,103 +16,72 @@ export default function Register() {const handleSubmit = async (e: React.FormEvent) => {e.preventDefault()setError('')-- if (password !== passwordConfirm) {- setError('Passwords do not match')- return- }-- if (password.length < 8) {- setError('Password must be at least 8 characters')- return- }-- setIsLoading(true)-+ if (password !== passwordConfirm) { setError('Passwords do not match'); return }+ if (password.length < 8) { setError('Password must be at least 8 characters'); return }+ setLoading(true)try {await register(email, password, passwordConfirm)navigate('/')} catch (err: any) {- setError(err.response?.data?.error || 'Registration failed. Please try again.')+ setError(err.response?.data?.error || 'Registration failed.')} finally {- setIsLoading(false)+ setLoading(false)}}return (- <div className="min-h-screen bg-gradient-to-br from-blue-50 to-slate-100 flex items-center justify-center px-4">- <div className="bg-white rounded-2xl shadow-xl p-8 w-full max-w-md">- <div className="text-center mb-8">- <div className="text-5xl mb-4">πͺ</div>- <h1 className="text-3xl font-bold text-slate-900 mb-2">LYFTER</h1>- <p className="text-slate-600">Create your account</p>- </div>-- <form onSubmit={handleSubmit} className="space-y-4">- <div>- <label htmlFor="email" className="block text-sm font-medium text-slate-700 mb-1">- </label>- <input- id="email"- type="email"- value={email}- onChange={(e) => setEmail(e.target.value)}- className="input"- placeholder="[email protected]"- required- />- </div>-- <div>- <label htmlFor="password" className="block text-sm font-medium text-slate-700 mb-1">- Password- </label>- <input- id="password"- type="password"- value={password}- onChange={(e) => setPassword(e.target.value)}- className="input"- placeholder="Min 8 characters"- required- />- </div>+ <div className="min-h-screen bg-surface-base flex items-center justify-center px-4">+ <div className="pointer-events-none fixed inset-x-0 top-0 h-64 bg-gradient-to-b from-brand-500/6 to-transparent" />- <div>- <label htmlFor="password-confirm" className="block text-sm font-medium text-slate-700 mb-1">- Confirm Password- </label>- <input- id="password-confirm"- type="password"- value={passwordConfirm}- onChange={(e) => setPasswordConfirm(e.target.value)}- className="input"- placeholder="β’β’β’β’β’β’β’β’"- required- />+ <div className="relative w-full max-w-sm animate-slide-up">+ <div className="mb-8">+ <div className="w-10 h-10 rounded-xl bg-brand-500 flex items-center justify-center mb-5">+ <Dumbbell className="w-5 h-5 text-white" strokeWidth={2.5} /></div>+ <h1 className="font-display font-bold text-2xl text-white tracking-tight">+ Create your account+ </h1>+ <p className="text-slate-500 text-sm mt-1">Start tracking with lyftr</p>+ </div>- {error && (- <div className="bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm">- {error}+ <div className="card-glass p-6">+ <form onSubmit={handleSubmit} className="space-y-4">+ <div>+ <label htmlFor="email" className="label">Email address</label>+ <input id="email" type="email" value={email}+ onChange={e => setEmail(e.target.value)}+ className="input" placeholder="[email protected]" autoComplete="email" required />+ </div>+ <div>+ <label htmlFor="password" className="label">Password</label>+ <input id="password" type="password" value={password}+ onChange={e => setPassword(e.target.value)}+ className="input" placeholder="Min 8 characters" autoComplete="new-password" required />+ </div>+ <div>+ <label htmlFor="password-confirm" className="label">Confirm password</label>+ <input id="password-confirm" type="password" value={passwordConfirm}+ onChange={e => setPasswordConfirm(e.target.value)}+ className="input" placeholder="β’β’β’β’β’β’β’β’" autoComplete="new-password" required /></div>- )}- <button- type="submit"- disabled={isLoading}- className="btn-primary w-full disabled:opacity-50"- >- {isLoading ? 'Creating account...' : 'Sign up'}- </button>- </form>+ {error && (+ <div className="alert-error">+ <AlertCircle className="w-4 h-4 mt-0.5 flex-shrink-0" />+ <span>{error}</span>+ </div>+ )}++ <button type="submit" disabled={isLoading} className="btn-primary btn-lg w-full">+ {isLoading ? 'Creating accountβ¦' : 'Create account'}+ </button>+ </form>+ </div>- <p className="text-center text-slate-600 text-sm mt-6">+ <p className="mt-5 text-center text-sm text-slate-500">Already have an account?{' '}- <Link to="/login" className="text-primary font-medium hover:underline">- Login+ <Link to="/login" className="text-brand-400 font-medium hover:text-brand-300 transition-colors">+ Sign in</Link></p></div>diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsxindex 05c39a6..99ba801 100644--- a/web/src/pages/Settings.tsx+++ b/web/src/pages/Settings.tsx@@ -1,47 +1,195 @@import { useAuthStore } from '../stores/auth'+import { useTheme } from '../hooks/useTheme'+import { HelpTip } from '../components/Tooltip'+import {+ User, Shield, Target, Ruler, Moon, Sun,+ Server, LogOut, Trash2, ChevronRight, Check,+} from 'lucide-react'++function SettingRow({+ label, description, children+}: { label: string; description?: string; children: React.ReactNode }) {+ return (+ <div className="flex items-center justify-between py-4">+ <div className="flex-1 mr-4">+ <p className="text-sm font-medium text-tx-primary">{label}</p>+ {description && <p className="text-xs text-tx-muted mt-0.5">{description}</p>}+ </div>+ <div className="flex-shrink-0">{children}</div>+ </div>+ )+}++function Section({ title, children }: { title: string; children: React.ReactNode }) {+ return (+ <div className="card overflow-hidden">+ <div className="px-5 py-3 bg-surface-muted border-b border-surface-border">+ <p className="text-xs font-semibold text-tx-muted uppercase tracking-wider">{title}</p>+ </div>+ <div className="px-5 divide-y divide-surface-border">+ {children}+ </div>+ </div>+ )+}++function UnitToggle({ value, onChange, options }: {+ value: string; onChange: (v: string) => void; options: string[]+}) {+ return (+ <div className="flex gap-1 bg-surface-overlay rounded-lg p-1 border border-surface-border">+ {options.map(opt => (+ <button+ key={opt}+ onClick={() => onChange(opt)}+ className={`px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 ${+ value === opt+ ? 'bg-surface-raised border border-surface-border text-tx-primary shadow-card'+ : 'text-tx-muted hover:text-tx-primary'+ }`}+ >+ {opt}+ </button>+ ))}+ </div>+ )+}export default function Settings() {- const { user } = useAuthStore()+ const { user, logout } = useAuthStore()+ const { theme, toggleTheme } = useTheme()return (- <div className="space-y-6">+ <div className="space-y-5 animate-slide-up max-w-2xl">++ {/* Header */}<div>- <h2 className="text-3xl font-bold text-slate-900">Settings</h2>- <p className="text-slate-600 mt-1">Manage your account</p>+ <h1 className="font-display font-bold text-2xl text-tx-primary">Settings</h1>+ <p className="text-tx-muted text-sm mt-0.5">Preferences and account configuration</p></div>- <div className="card">- <h3 className="font-bold text-slate-900 mb-4">Account</h3>- <div className="space-y-4">- <div>- <label className="block text-sm font-medium text-slate-700 mb-1">- </label>+ {/* Account */}+ <Section title="Account">+ <SettingRow label="Email" description="Your login email address">+ <span className="text-sm text-tx-muted font-mono">{user?.email}</span>+ </SettingRow>+ <SettingRow label="Password" description="Change your password">+ <button className="btn-secondary btn-sm">+ Change <ChevronRight className="w-3.5 h-3.5" />+ </button>+ </SettingRow>+ <SettingRow label="Member since" description="">+ <span className="text-sm text-tx-muted">+ {user?.created_at ? new Date(user.created_at).toLocaleDateString('en-US', { month: 'long', year: 'numeric' }) : 'β'}+ </span>+ </SettingRow>+ </Section>++ {/* Appearance */}+ <Section title="Appearance">+ <SettingRow label="Theme" description="Interface color scheme">+ <button+ onClick={toggleTheme}+ className="btn-secondary btn-sm"+ >+ {theme === 'dark'+ ? <><Moon className="w-3.5 h-3.5" /> Dark</>+ : <><Sun className="w-3.5 h-3.5" /> Light</>+ }+ </button>+ </SettingRow>+ </Section>++ {/* Goals & units */}+ <Section title="Goals & Units">+ <SettingRow+ label="Weight unit"+ description="Displayed across the entire app"+ >+ <UnitToggle value="lbs" onChange={() => {}} options={['lbs', 'kg']} />+ </SettingRow>+ <SettingRow+ label="Calorie target"+ description="Daily calorie goal"+ >+ <div className="flex items-center gap-2"><input- type="email"- value={user?.email || ''}- disabled- className="input bg-slate-100"+ type="number"+ defaultValue={2000}+ className="input w-24 text-right"+ min={500}+ max={10000}/>+ <span className="text-xs text-tx-muted">kcal</span></div>- <div>- <label className="block text-sm font-medium text-slate-700 mb-1">- Joined- </label>- <input- type="text"- value={user?.created_at ? new Date(user.created_at).toLocaleDateString() : ''}- disabled- className="input bg-slate-100"- />+ </SettingRow>+ <SettingRow label="Protein target" description="">+ <div className="flex items-center gap-2">+ <input type="number" defaultValue={150} className="input w-24 text-right" />+ <span className="text-xs text-tx-muted">g</span></div>+ </SettingRow>+ <SettingRow label="Carb target" description="">+ <div className="flex items-center gap-2">+ <input type="number" defaultValue={250} className="input w-24 text-right" />+ <span className="text-xs text-tx-muted">g</span>+ </div>+ </SettingRow>+ <SettingRow label="Fat target" description="">+ <div className="flex items-center gap-2">+ <input type="number" defaultValue={65} className="input w-24 text-right" />+ <span className="text-xs text-tx-muted">g</span>+ </div>+ </SettingRow>+ <div className="py-3 flex justify-end">+ <button className="btn-primary btn-sm">+ <Check className="w-3.5 h-3.5" /> Save goals+ </button></div>- </div>+ </Section>++ {/* Server info */}+ <Section title="Self-Hosted Instance">+ <SettingRow+ label="API server"+ description="Backend server this client is connected to"+ >+ <div className="flex items-center gap-2">+ <span className="w-1.5 h-1.5 rounded-full bg-success-500 flex-shrink-0" />+ <span className="text-xs font-mono text-tx-muted">localhost:3000</span>+ </div>+ </SettingRow>+ <SettingRow+ label="Database"+ description="Storage backend"+ >+ <span className="badge-dim">SQLite</span>+ </SettingRow>+ <SettingRow+ label="Version"+ description="lyftr backend version"+ >+ <span className="text-xs text-tx-muted font-mono">v0.1.0</span>+ </SettingRow>+ </Section>++ {/* Danger zone */}+ <Section title="Danger Zone">+ <SettingRow label="Sign out" description="Log out of this device">+ <button onClick={() => logout()} className="btn-secondary btn-sm">+ <LogOut className="w-3.5 h-3.5" /> Sign out+ </button>+ </SettingRow>+ <SettingRow+ label="Delete account"+ description="Permanently delete all your data from this server"+ >+ <button className="btn-danger btn-sm">+ <Trash2 className="w-3.5 h-3.5" /> Delete+ </button>+ </SettingRow>+ </Section>- <div className="card text-center py-12">- <p className="text-slate-600">More settings coming soon</p>- <p className="text-sm text-slate-500 mt-2">Preferences, goals, and other options</p>- </div></div>)}diff --git a/web/src/pages/Weight.tsx b/web/src/pages/Weight.tsxindex 378f9e4..5335f56 100644--- a/web/src/pages/Weight.tsx+++ b/web/src/pages/Weight.tsx@@ -1,14 +1,187 @@+import { useState } from 'react'+import { TrendingDown, TrendingUp, Plus, Calendar, Info } from 'lucide-react'+import { HelpTip } from '../components/Tooltip'++const PERIODS = ['7d', '30d', '90d', 'All'] as const+type Period = typeof PERIODS[number]++const MOCK_ENTRIES = [+ { date: 'Apr 18', value: 185.0 },+ { date: 'Apr 17', value: 185.2 },+ { date: 'Apr 16', value: 185.5 },+ { date: 'Apr 15', value: 186.0 },+ { date: 'Apr 14', value: 186.2 },+ { date: 'Apr 13', value: 186.5 },+ { date: 'Apr 12', value: 187.0 },+]++const avg = (arr: number[]) => arr.reduce((a, b) => a + b, 0) / arr.length+export default function Weight() {+ const [period, setPeriod] = useState<Period>('30d')+ const [newWeight, setNewWeight] = useState('')++ const values = MOCK_ENTRIES.map(e => e.value)+ const current = values[0]+ const change = +(current - values[values.length - 1]).toFixed(1)+ const average = +avg(values).toFixed(1)+ const min = Math.min(...values)+ const max = Math.max(...values)+return (- <div className="space-y-6">- <div>- <h2 className="text-3xl font-bold text-slate-900">Weight Tracking</h2>- <p className="text-slate-600 mt-1">Monitor your progress</p>+ <div className="space-y-5 animate-slide-up">++ {/* Header */}+ <div className="flex justify-between items-center">+ <div>+ <h1 className="font-display font-bold text-2xl text-tx-primary">Weight</h1>+ <p className="text-tx-muted text-sm mt-0.5">Track your body weight over time</p>+ </div>+ <span className="badge-brand">+ <Calendar className="w-3 h-3" /> lbs+ </span>+ </div>++ {/* Current weight hero */}+ <div className="card p-6 border-brand-500/20 bg-brand-500/5">+ <div className="flex items-start justify-between">+ <div>+ <p className="stat-label mb-2">Current Weight</p>+ <div className="flex items-end gap-2">+ <span className="stat-value text-5xl">{current}</span>+ <span className="text-tx-muted text-lg mb-1">lbs</span>+ </div>+ </div>+ <div className={`flex items-center gap-1.5 text-sm font-semibold px-3 py-1.5 rounded-lg ${+ change < 0+ ? 'bg-success-500/10 border border-success-500/20 text-success-400'+ : 'bg-error-500/10 border border-error-500/20 text-error-400'+ }`}>+ {change < 0 ? <TrendingDown className="w-4 h-4" /> : <TrendingUp className="w-4 h-4" />}+ {Math.abs(change)} lbs+ </div>+ </div>+ <p className="text-xs text-tx-muted mt-3">+ {Math.abs(change)} lbs {change < 0 ? 'lost' : 'gained'} over {period}+ </p>+ </div>++ {/* Stats row */}+ <div className="grid grid-cols-3 gap-3">+ {[+ { label: 'Average', value: average, tip: 'Rolling average weight for selected period' },+ { label: 'Lowest', value: min, tip: 'Lowest recorded weight in selected period' },+ { label: 'Highest', value: max, tip: 'Highest recorded weight in selected period' },+ ].map(s => (+ <div key={s.label} className="card p-4">+ <div className="flex items-center gap-1.5 mb-2">+ <span className="stat-label">{s.label}</span>+ <HelpTip content={s.tip} />+ </div>+ <span className="stat-value text-xl">{s.value}</span>+ <span className="text-xs text-tx-muted ml-1">lbs</span>+ </div>+ ))}+ </div>++ {/* Chart placeholder + period selector */}+ <div className="card p-5">+ <div className="flex items-center justify-between mb-5">+ <div className="flex items-center gap-1.5">+ <h2 className="section-title">Trend</h2>+ <HelpTip content="Smoothed rolling average β individual daily fluctuations are normal" />+ </div>+ <div className="flex gap-1 bg-surface-overlay rounded-lg p-1">+ {PERIODS.map(p => (+ <button+ key={p}+ onClick={() => setPeriod(p)}+ className={`px-3 py-1 rounded-md text-xs font-medium transition-colors duration-150 ${+ period === p+ ? 'bg-surface-raised border border-surface-border text-tx-primary shadow-card'+ : 'text-tx-muted hover:text-tx-primary'+ }`}+ >+ {p}+ </button>+ ))}+ </div>+ </div>++ {/* Mini chart β visual weight trend using div bars */}+ <div className="flex items-end gap-1 h-24 mb-1">+ {MOCK_ENTRIES.slice().reverse().map((entry, i) => {+ const pct = ((entry.value - min) / (max - min || 1)) * 100+ const height = 20 + pct * 0.8+ return (+ <div key={i} className="flex-1 flex flex-col items-center gap-1 group relative">+ <div+ className="w-full bg-brand-500/20 border border-brand-500/30 rounded-sm transition-all group-hover:bg-brand-500/40"+ style={{ height: `${height}%` }}+ />+ <div className="absolute -top-6 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-surface-overlay border border-surface-border rounded px-1.5 py-0.5 text-xs text-tx-primary whitespace-nowrap z-10">+ {entry.value} lbs+ </div>+ </div>+ )+ })}+ </div>+ <div className="flex justify-between text-xs text-tx-muted mt-1">+ <span>{MOCK_ENTRIES[MOCK_ENTRIES.length - 1].date}</span>+ <span>{MOCK_ENTRIES[0].date}</span>+ </div>+ </div>++ {/* Log weight */}+ <div className="card p-5">+ <div className="section-header">+ <h2 className="section-title">Log Today's Weight</h2>+ </div>+ <div className="flex gap-2">+ <div className="relative flex-1">+ <input+ type="number"+ value={newWeight}+ onChange={e => setNewWeight(e.target.value)}+ placeholder="185.0"+ step="0.1"+ className="input pr-10"+ />+ <span className="absolute right-3.5 top-1/2 -translate-y-1/2 text-xs text-tx-muted">lbs</span>+ </div>+ <button className="btn-primary btn-md" disabled={!newWeight}>+ <Plus className="w-4 h-4" /> Log+ </button>+ </div>+ <p className="input-help flex items-center gap-1 mt-2">+ <Info className="w-3 h-3" />+ Best logged first thing in the morning, after using the bathroom+ </p></div>- <div className="card text-center py-12">- <p className="text-slate-600">Weight tracking interface coming soon</p>- <p className="text-sm text-slate-500 mt-2">View your weight trends and analytics here</p>+ {/* Log entries */}+ <div className="card p-5">+ <h2 className="section-title mb-4">History</h2>+ <div className="space-y-0 divide-y divide-surface-border">+ {MOCK_ENTRIES.map((entry, i) => (+ <div key={i} className="flex items-center justify-between py-3">+ <span className="text-sm text-tx-secondary">{entry.date}</span>+ <div className="flex items-center gap-3">+ {i < MOCK_ENTRIES.length - 1 && (+ <span className={`text-xs font-medium ${+ entry.value < MOCK_ENTRIES[i + 1].value ? 'text-success-400' : 'text-error-400'+ }`}>+ {entry.value < MOCK_ENTRIES[i + 1].value ? 'β' : 'β'}+ {Math.abs(+(entry.value - MOCK_ENTRIES[i + 1].value).toFixed(1))}+ </span>+ )}+ <span className="text-sm font-semibold text-tx-primary tabular-nums">+ {entry.value} lbs+ </span>+ </div>+ </div>+ ))}+ </div></div></div>)diff --git a/web/src/pages/Workouts.tsx b/web/src/pages/Workouts.tsxindex 4580b96..5c0955c 100644--- a/web/src/pages/Workouts.tsx+++ b/web/src/pages/Workouts.tsx@@ -1,14 +1,170 @@+import { useState } from 'react'+import { Dumbbell, Plus, ChevronRight, BarChart2, Clock, Weight, Search, Filter, Info } from 'lucide-react'+import { HelpTip, Tooltip } from '../components/Tooltip'++const MOCK_WORKOUTS = [+ {+ id: 1, date: 'Today', name: 'Push Day',+ exercises: [+ { name: 'Bench Press', sets: 4, reps: 8, weight: 275 },+ { name: 'Incline Dumbbell', sets: 3, reps: 10, weight: 85 },+ { name: 'Cable Fly', sets: 3, reps: 12, weight: 40 },+ { name: 'Overhead Press', sets: 4, reps: 8, weight: 155 },+ { name: 'Tricep Pushdown', sets: 3, reps: 12, weight: 60 },+ ],+ duration: '58 min', volume: 32450,+ },+ {+ id: 2, date: 'Yesterday', name: 'Cardio',+ exercises: [+ { name: 'Treadmill Run', sets: 1, reps: 1, weight: 0 },+ ],+ duration: '45 min', volume: 0,+ },+ {+ id: 3, date: 'Apr 16', name: 'Pull Day',+ exercises: [+ { name: 'Barbell Row', sets: 4, reps: 8, weight: 225 },+ { name: 'Lat Pulldown', sets: 3, reps: 10, weight: 140 },+ { name: 'Seated Cable Row',sets: 3, reps: 12, weight: 120 },+ { name: 'Face Pull', sets: 3, reps: 15, weight: 50 },+ { name: 'Barbell Curl', sets: 3, reps: 10, weight: 95 },+ ],+ duration: '62 min', volume: 28100,+ },+]++function WorkoutCard({ workout }: { workout: typeof MOCK_WORKOUTS[0] }) {+ const [open, setOpen] = useState(false)++ return (+ <div className="card overflow-hidden">+ <button+ className="w-full flex items-center justify-between p-4 hover:bg-surface-muted transition-colors"+ onClick={() => setOpen(o => !o)}+ >+ <div className="flex items-center gap-3">+ <div className="w-9 h-9 rounded-lg bg-brand-500/10 border border-brand-500/20 flex items-center justify-center flex-shrink-0">+ <Dumbbell className="w-4 h-4 text-brand-500" strokeWidth={2} />+ </div>+ <div className="text-left">+ <p className="text-sm font-semibold text-tx-primary">{workout.name}</p>+ <p className="text-xs text-tx-muted">{workout.date}</p>+ </div>+ </div>+ <div className="flex items-center gap-4">+ <div className="hidden sm:flex items-center gap-4 text-xs text-tx-muted">+ <span className="flex items-center gap-1">+ <Clock className="w-3.5 h-3.5" /> {workout.duration}+ </span>+ {workout.volume > 0 && (+ <span className="flex items-center gap-1">+ <Weight className="w-3.5 h-3.5" /> {workout.volume.toLocaleString()} lbs+ </span>+ )}+ <span className="flex items-center gap-1">+ <BarChart2 className="w-3.5 h-3.5" /> {workout.exercises.length} exercises+ </span>+ </div>+ <ChevronRight className={`w-4 h-4 text-tx-muted transition-transform duration-200 ${open ? 'rotate-90' : ''}`} />+ </div>+ </button>++ {open && (+ <div className="border-t border-surface-border animate-slide-up">+ <div className="px-4 py-2">+ <div className="grid grid-cols-4 text-xs text-tx-muted uppercase tracking-wider py-2 border-b border-surface-border">+ <span className="col-span-2">Exercise</span>+ <span className="text-right">Sets Γ Reps</span>+ <span className="text-right">Weight</span>+ </div>+ {workout.exercises.map((ex, i) => (+ <div key={i} className="grid grid-cols-4 text-sm py-2.5 border-b border-surface-border last:border-0">+ <span className="col-span-2 text-tx-primary font-medium">{ex.name}</span>+ <span className="text-right text-tx-secondary tabular-nums">{ex.sets} Γ {ex.reps}</span>+ <span className="text-right text-tx-muted tabular-nums">+ {ex.weight > 0 ? `${ex.weight} lbs` : 'β'}+ </span>+ </div>+ ))}+ </div>+ <div className="flex justify-end gap-2 px-4 py-3 bg-surface-muted">+ <button className="btn-ghost btn-sm">Duplicate</button>+ <button className="btn-secondary btn-sm">Edit</button>+ </div>+ </div>+ )}+ </div>+ )+}+export default function Workouts() {+ const [search, setSearch] = useState('')++ const filtered = MOCK_WORKOUTS.filter(w =>+ w.name.toLowerCase().includes(search.toLowerCase())+ )++ const weekVolume = MOCK_WORKOUTS.reduce((sum, w) => sum + w.volume, 0)+return (- <div className="space-y-6">- <div>- <h2 className="text-3xl font-bold text-slate-900">Workouts</h2>- <p className="text-slate-600 mt-1">Track your training sessions</p>+ <div className="space-y-5 animate-slide-up">++ {/* Header */}+ <div className="flex justify-between items-center">+ <div>+ <h1 className="font-display font-bold text-2xl text-tx-primary">Workouts</h1>+ <p className="text-tx-muted text-sm mt-0.5">Track and review your training sessions</p>+ </div>+ <button className="btn-primary btn-md">+ <Plus className="w-4 h-4" /> Log Workout+ </button>+ </div>++ {/* This week summary */}+ <div className="grid grid-cols-3 gap-3">+ {[+ { label: 'Sessions', value: '3', unit: 'this week', icon: Dumbbell, tip: 'Total workouts logged this week' },+ { label: 'Total Volume',value: weekVolume.toLocaleString(), unit: 'lbs lifted', icon: Weight, tip: 'Sum of sets Γ reps Γ weight across all exercises' },+ { label: 'Avg Duration',value: '55', unit: 'min / session', icon: Clock, tip: 'Average workout duration this week' },+ ].map(s => (+ <div key={s.label} className="card p-4">+ <div className="flex items-center gap-1.5 mb-2">+ <span className="stat-label">{s.label}</span>+ <HelpTip content={s.tip} />+ </div>+ <div className="flex items-end gap-1.5">+ <span className="stat-value text-xl">{s.value}</span>+ <span className="text-xs text-tx-muted mb-0.5">{s.unit}</span>+ </div>+ </div>+ ))}+ </div>++ {/* Search */}+ <div className="relative">+ <Search className="absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-tx-muted pointer-events-none" />+ <input+ value={search}+ onChange={e => setSearch(e.target.value)}+ className="input pl-10"+ placeholder="Search workoutsβ¦"+ /></div>- <div className="card text-center py-12">- <p className="text-slate-600">Workout tracking interface coming soon</p>- <p className="text-sm text-slate-500 mt-2">View, edit, and log your workouts here</p>+ {/* Workout list */}+ <div className="space-y-2">+ {filtered.length === 0 ? (+ <div className="empty-state">+ <div className="w-12 h-12 rounded-xl bg-surface-muted border border-surface-border flex items-center justify-center mb-4">+ <Dumbbell className="w-6 h-6 text-tx-muted" />+ </div>+ <p className="text-sm font-medium text-tx-primary mb-1">No workouts found</p>+ <p className="text-xs text-tx-muted">Try a different search or log a new workout.</p>+ </div>+ ) : (+ filtered.map(w => <WorkoutCard key={w.id} workout={w} />)+ )}</div></div>)diff --git a/web/tailwind.config.ts b/web/tailwind.config.tsindex 021a190..3d3dfcc 100644--- a/web/tailwind.config.ts+++ b/web/tailwind.config.ts@@ -1,18 +1,63 @@import type { Config } from 'tailwindcss'export default {- content: [- "./index.html",- "./src/**/*.{js,ts,jsx,tsx}",- ],+ darkMode: 'class',+ content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],theme: {extend: {+ fontFamily: {+ sans: ['Plus Jakarta Sans', 'system-ui', 'sans-serif'],+ display: ['Outfit', 'Plus Jakarta Sans', 'sans-serif'],+ mono: ['JetBrains Mono', 'Fira Code', 'monospace'],+ },colors: {- primary: '#1E40AF',- accent: '#FB923C',- success: '#22C55E',- warning: '#EF4444',- }+ // CSS-variable-backed surface tokens β light/dark handled in CSS+ surface: {+ base: 'var(--surface-base)',+ raised: 'var(--surface-raised)',+ overlay: 'var(--surface-overlay)',+ border: 'var(--surface-border)',+ muted: 'var(--surface-muted)',+ },+ tx: {+ primary: 'var(--tx-primary)',+ secondary: 'var(--tx-secondary)',+ muted: 'var(--tx-muted)',+ inverse: 'var(--tx-inverse)',+ },+ // Brand β electric cyan+ brand: {+ 50: '#e0f9ff',+ 100: '#b0f1fe',+ 200: '#7ae7fd',+ 300: '#38d8fb',+ 400: '#0ecef7',+ 500: '#00b8d9',+ 600: '#0099b8',+ 700: '#007a96',+ 800: '#005c72',+ 900: '#003d4d',+ DEFAULT: '#00b8d9',+ },+ violet: {+ 400: '#a78bfa',+ 500: '#8b5cf6',+ 600: '#7c3aed',+ DEFAULT: '#8b5cf6',+ },+ success: { 400: '#4ade80', 500: '#22c55e', DEFAULT: '#22c55e' },+ warning: { 400: '#facc15', 500: '#eab308', DEFAULT: '#eab308' },+ error: { 400: '#f87171', 500: '#ef4444', DEFAULT: '#ef4444' },+ },+ backgroundImage: {+ 'gradient-brand': 'linear-gradient(135deg, #00b8d9 0%, #8b5cf6 100%)',+ },+ boxShadow: {+ 'glow-sm': '0 0 16px rgba(0,184,217,0.18)',+ 'card': '0 1px 2px rgba(0,0,0,0.08)',+ 'card-md': '0 4px 16px rgba(0,0,0,0.12)',+ 'dropdown': '0 8px 24px rgba(0,0,0,0.20), 0 0 0 1px var(--surface-border)',+ },},},plugins: [],