-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
204 lines (178 loc) · 7.53 KB
/
Copy pathindex.html
File metadata and controls
204 lines (178 loc) · 7.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Expense Tracker</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=Syne:wght@400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="shell">
<!-- ── NAVBAR ───────────────────────────────────── -->
<nav>
<div class="nav-brand">
<div class="nav-logo">
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M3 14L7 9l3 3 5-6" stroke="#fff" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<span class="nav-title">Expense<span>Tracker</span></span>
</div>
<span class="nav-badge">v2.0 · localStorage</span>
</nav>
<!-- ── HERO STATS ────────────────────────────────── -->
<div class="hero">
<div class="hero-cell">
<div class="hc-label">Total Spent</div>
<div class="hc-value green" id="statTotal">$0.00</div>
<div class="hc-delta up" id="statDelta">↑ $0.00 this month</div>
</div>
<div class="hero-cell">
<div class="hc-label">Transactions</div>
<div class="hc-value accent" id="statCount">0</div>
<div class="hc-sub" id="statAvg">avg — per entry</div>
</div>
<div class="hero-cell">
<div class="hc-label">Biggest Spend</div>
<div class="hc-value" id="statMax">—</div>
<div class="hc-sub" id="statMaxName">—</div>
</div>
<div class="hero-cell">
<div class="hc-label">Top Category</div>
<div class="hc-value" id="statTopCat">—</div>
<div class="hc-sub" id="statTopAmt">no data yet</div>
</div>
</div>
<!-- ── MAIN LAYOUT ───────────────────────────────── -->
<div class="layout">
<!-- LEFT COLUMN -->
<div class="left-col">
<!-- Add Expense Form -->
<div class="panel">
<div class="panel-head">
<span class="panel-title">Add Expense</span>
<span class="panel-hint">Press ↵ to submit</span>
</div>
<div class="panel-body">
<div class="form-grid">
<div class="fld full" id="fldName">
<label for="eName">Description</label>
<input type="text" id="eName"
placeholder="e.g. Lunch, Uber, Netflix…"
autocomplete="off" />
<span class="err-txt">Please enter a description</span>
</div>
<div class="fld" id="fldAmt">
<label for="eAmt">Amount ($)</label>
<input type="number" id="eAmt"
placeholder="0.00" min="0.01" step="0.01" />
<span class="err-txt">Enter a valid amount</span>
</div>
<div class="fld">
<label for="eCat">Category</label>
<div class="select-wrap">
<select id="eCat">
<option value="food">🍔 Food & Dining</option>
<option value="transport">🚗 Transport</option>
<option value="shopping">🛍 Shopping</option>
<option value="entertainment">🎬 Entertainment</option>
<option value="bills">💡 Bills & Utilities</option>
<option value="health">💊 Health & Wellness</option>
<option value="subscriptions">📱 Subscriptions</option>
<option value="other">📦 Other</option>
</select>
</div>
</div>
</div>
<button class="btn-submit" id="addBtn">+ Add Expense</button>
</div>
</div>
<!-- Transaction History -->
<div class="panel">
<div class="panel-head">
<span class="panel-title">Transaction History</span>
<button class="btn-clear" id="clearBtn">Clear All</button>
</div>
<div class="panel-body panel-body--list">
<!-- Search + Filters -->
<div class="list-controls">
<div class="search-wrap">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none">
<circle cx="5" cy="5" r="3.5" stroke="#5A5A70" stroke-width="1.2"/>
<path d="M8 8l2 2" stroke="#5A5A70" stroke-width="1.2" stroke-linecap="round"/>
</svg>
<input class="search-input" id="searchInput"
placeholder="Search expenses…" />
</div>
<button class="filter-btn active" data-cat="all">All</button>
<button class="filter-btn" data-cat="food">Food</button>
<button class="filter-btn" data-cat="transport">Transport</button>
<button class="filter-btn" data-cat="shopping">Shopping</button>
</div>
<!-- Expense list -->
<ul id="expenseList"></ul>
<!-- Empty state -->
<div class="empty" id="emptyState">
<div class="empty-glyph">💳</div>
<h3>No expenses yet</h3>
<p>Add your first expense above to get started.</p>
</div>
</div>
</div>
</div><!-- /left-col -->
<!-- RIGHT COLUMN (Charts) -->
<div class="right-col">
<!-- Spending Trend Chart -->
<div class="panel">
<div class="panel-head">
<span class="panel-title">Spending Trend</span>
<span class="panel-hint">Last 7 days</span>
</div>
<div class="panel-body">
<div class="chart-wrap">
<canvas id="trendChart"></canvas>
</div>
</div>
</div>
<!-- Donut Chart -->
<div class="panel">
<div class="panel-head">
<span class="panel-title">By Category</span>
</div>
<div class="panel-body">
<div class="donut-row">
<div class="donut-wrap">
<canvas id="donutChart" width="110" height="110"></canvas>
<div class="donut-center">
<span class="donut-center__label">Total</span>
<span class="donut-center__value" id="donutCenter">$0</span>
</div>
</div>
<div class="legend" id="catLegend"></div>
</div>
</div>
</div>
<!-- Category Breakdown Bars -->
<div class="panel">
<div class="panel-head">
<span class="panel-title">Category Breakdown</span>
</div>
<div class="panel-body">
<div class="activity-list" id="catBars"></div>
</div>
</div>
</div><!-- /right-col -->
</div><!-- /layout -->
</div><!-- /shell -->
<!-- Toast notification -->
<div class="toast" id="toast"></div>
<!-- Chart.js CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js"></script>
<!-- App logic -->
<script src="script.js"></script>
</body>
</html>