-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
314 lines (296 loc) · 13.4 KB
/
index.html
File metadata and controls
314 lines (296 loc) · 13.4 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Finance 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=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./styles.css" />
<script src="https://cdn.jsdelivr.net/npm/chart.js" defer></script>
<script src="./app.js" defer></script>
</head>
<body>
<header class="app-header">
<div class="container header-inner">
<div class="brand">
<span class="brand-logo">₽</span>
<span class="brand-name">Finance Tracker</span>
</div>
<nav class="nav" aria-label="Основная навигация">
<button class="nav-link active" data-section="dashboard">Дашборд</button>
<button class="nav-link" data-section="entries">Операции</button>
<button class="nav-link" data-section="budgets">Бюджеты</button>
<button class="nav-link" data-section="debts">Долги</button>
<button class="nav-link" data-section="recurring">Повторения</button>
<button class="nav-link" data-section="settings">Настройки</button>
</nav>
<div class="auth-box" id="auth-box">
<a id="btn-login" class="btn btn-secondary" href="/auth/google">Войти с Google</a>
<div id="user-box" class="user-box hidden">
<img id="user-pic" alt="" />
<span id="user-name"></span>
<button id="btn-logout" class="btn btn-secondary" type="button">Выйти</button>
</div>
</div>
</div>
</header>
<main class="container">
<!-- Dashboard -->
<section id="dashboard" class="section visible" aria-labelledby="dashboard-title">
<h2 id="dashboard-title">Дашборд</h2>
<div class="cards">
<div class="card">
<div class="card-title">Доходы (период)</div>
<div class="card-value" id="dash-income">0</div>
</div>
<div class="card">
<div class="card-title">Расходы (период)</div>
<div class="card-value" id="dash-expense">0</div>
</div>
<div class="card">
<div class="card-title">Баланс (период)</div>
<div class="card-value" id="dash-balance">0</div>
</div>
<div class="card">
<div class="card-title">Ежедневный бюджет</div>
<div class="card-value" id="dash-daily">0</div>
<div class="card-sub" id="dash-days-left"></div>
</div>
</div>
<div class="panel">
<div class="panel-header">
<h3>Расходы по категориям (текущий период)</h3>
<div class="panel-actions">
<input type="month" id="dash-month-filter" aria-label="Месяц" />
<button id="dash-reset-month" class="btn btn-secondary">Текущий</button>
</div>
</div>
<canvas id="categoryChart" height="120"></canvas>
</div>
</section>
<!-- Entries -->
<section id="entries" class="section" aria-labelledby="entries-title">
<h2 id="entries-title">Операции</h2>
<div class="panel">
<div class="panel-header"><h3>Добавить операцию</h3></div>
<form id="entry-form" class="form-grid">
<div class="form-row">
<label for="entry-type">Тип</label>
<div class="segmented">
<input type="radio" id="type-income" name="type" value="income" checked />
<label for="type-income">Доход</label>
<input type="radio" id="type-expense" name="type" value="expense" />
<label for="type-expense">Расход</label>
</div>
</div>
<div class="form-row">
<label for="entry-amount">Сумма</label>
<input id="entry-amount" name="amount" type="number" min="0" step="0.01" required />
</div>
<div class="form-row">
<label for="entry-category">Категория</label>
<input id="entry-category" name="category" list="category-suggestions" required />
<datalist id="category-suggestions"></datalist>
</div>
<div class="form-row">
<label for="entry-date">Дата</label>
<input id="entry-date" name="date" type="date" required />
</div>
<div class="form-row">
<label for="entry-note">Заметка</label>
<input id="entry-note" name="note" type="text" placeholder="Необязательно" />
</div>
<div class="form-row form-row-actions">
<button class="btn" type="submit">Добавить</button>
<button class="btn btn-secondary" type="reset">Сброс</button>
</div>
</form>
</div>
<div class="panel">
<div class="panel-header">
<h3>Список операций</h3>
<div class="panel-actions">
<select id="entries-type-filter" aria-label="Тип">
<option value="all">Все</option>
<option value="income">Доходы</option>
<option value="expense">Расходы</option>
</select>
<input type="month" id="entries-month-filter" />
<button id="entries-reset-filters" class="btn btn-secondary">Сбросить</button>
</div>
</div>
<div class="table-wrap">
<table class="table" id="entries-table" aria-describedby="entries-title">
<thead>
<tr>
<th>Дата</th>
<th>Тип</th>
<th>Категория</th>
<th>Сумма</th>
<th>Заметка</th>
<th></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</section>
<!-- Budgets -->
<section id="budgets" class="section" aria-labelledby="budgets-title">
<h2 id="budgets-title">Бюджеты</h2>
<div class="panel">
<div class="panel-header"><h3>Добавить бюджет (месячный)</h3></div>
<form id="budget-form" class="form-grid">
<div class="form-row">
<label for="budget-category">Категория</label>
<input id="budget-category" name="category" list="category-suggestions" required />
</div>
<div class="form-row">
<label for="budget-amount">План, ₽</label>
<input id="budget-amount" name="amount" type="number" min="0" step="0.01" required />
</div>
<div class="form-row form-row-actions">
<button class="btn" type="submit">Сохранить</button>
</div>
</form>
</div>
<div class="panel">
<div class="panel-header"><h3>План vs Факт (текущий период)</h3></div>
<div id="budgets-list" class="budgets-list"></div>
</div>
</section>
<!-- Debts -->
<section id="debts" class="section" aria-labelledby="debts-title">
<h2 id="debts-title">Долги</h2>
<div class="panel">
<div class="panel-header"><h3>Добавить долг</h3></div>
<form id="debt-form" class="form-grid">
<div class="form-row">
<label for="debt-direction">Тип</label>
<select id="debt-direction" required>
<option value="borrowed">Я занял(а)</option>
<option value="lent">Я одолжил(а)</option>
</select>
</div>
<div class="form-row">
<label for="debt-person">Контрагент</label>
<input id="debt-person" type="text" required />
</div>
<div class="form-row">
<label for="debt-amount">Сумма</label>
<input id="debt-amount" type="number" min="0" step="0.01" required />
</div>
<div class="form-row">
<label for="debt-date">Дата</label>
<input id="debt-date" type="date" required />
</div>
<div class="form-row">
<label for="debt-due">Срок</label>
<input id="debt-due" type="date" />
</div>
<div class="form-row">
<label for="debt-note">Заметка</label>
<input id="debt-note" type="text" placeholder="Необязательно" />
</div>
<div class="form-row form-row-actions">
<button class="btn" type="submit">Сохранить</button>
</div>
</form>
</div>
<div class="panel">
<div class="panel-header"><h3>Список долгов</h3></div>
<div id="debts-list" class="debts-list"></div>
</div>
</section>
<!-- Recurring -->
<section id="recurring" class="section" aria-labelledby="recurring-title">
<h2 id="recurring-title">Повторяющиеся операции</h2>
<div class="panel">
<div class="panel-header"><h3>Добавить повторение</h3></div>
<form id="recurring-form" class="form-grid">
<div class="form-row">
<label for="rec-type">Тип</label>
<select id="rec-type" required>
<option value="expense">Расход</option>
<option value="income">Доход</option>
</select>
</div>
<div class="form-row">
<label for="rec-category">Категория</label>
<input id="rec-category" list="category-suggestions" required />
</div>
<div class="form-row">
<label for="rec-amount">Сумма</label>
<input id="rec-amount" type="number" min="0" step="0.01" required />
</div>
<div class="form-row">
<label for="rec-frequency">Периодичность</label>
<select id="rec-frequency">
<option value="monthly">Ежемесячно</option>
<option value="weekly">Еженедельно</option>
</select>
</div>
<div class="form-row">
<label for="rec-start">Начало</label>
<input id="rec-start" type="date" required />
</div>
<div class="form-row">
<label for="rec-end">Окончание</label>
<input id="rec-end" type="date" />
</div>
<div class="form-row form-row-actions">
<button class="btn" type="submit">Сохранить</button>
<button class="btn btn-secondary" id="rec-post-now" type="button">Добавить за текущий период</button>
</div>
</form>
</div>
<div class="panel">
<div class="panel-header"><h3>Список повторений</h3></div>
<div id="recurring-list" class="recurring-list"></div>
</div>
</section>
<!-- Settings -->
<section id="settings" class="section" aria-labelledby="settings-title">
<h2 id="settings-title">Настройки</h2>
<div class="panel">
<div class="panel-header"><h3>Общие</h3></div>
<form id="settings-form" class="form-grid">
<div class="form-row">
<label for="set-payday">День зарплаты</label>
<input id="set-payday" type="number" min="1" max="28" required />
</div>
<div class="form-row">
<label for="set-credit">Кредитный лимит</label>
<input id="set-credit" type="number" min="0" step="0.01" />
</div>
<div class="form-row">
<label for="set-currency">Валюта</label>
<input id="set-currency" type="text" maxlength="5" placeholder="₽, ₸, $, €" />
</div>
<div class="form-row form-row-actions">
<button class="btn" type="submit">Сохранить</button>
</div>
</form>
</div>
<div class="panel">
<div class="panel-header"><h3>Данные</h3></div>
<div class="settings-row">
<button id="btn-export" class="btn">Экспорт JSON</button>
<label class="btn btn-secondary" for="import-file">Импорт JSON</label>
<input id="import-file" type="file" accept="application/json" hidden />
<button id="btn-reset" class="btn btn-danger">Сбросить всё</button>
</div>
<textarea id="export-output" class="export-output" rows="8" readonly></textarea>
</div>
</section>
</main>
<footer class="footer">
<div class="container">
<span>© Finance Tracker</span>
</div>
</footer>
</body>
</html>