-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
103 lines (96 loc) · 4.68 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Income Expense Calculator</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="shortcut icon" href="https://png.pngtree.com/png-clipart/20230918/original/pngtree-managing-finances-tracking-expenditures-and-revenue-with-paper-and-electronic-records-png-image_12606856.png" type="image/x-icon">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<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=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
</head>
<body class="bg-gray-300 p-4">
<!-- Top section for Total Income, Expense, and Balance -->
<div class="max-w-3xl mx-auto">
<div class="mb-4 text-center">
<h1 class="text-3xl font-bold text-blue-700 mb-4">Income & Expense Tracker</h1>
<div class="flex justify-around mb-4 p-4 bg-white rounded shadow">
<div>
<p class="text-lg font-semibold">Total Income</p>
<p class="text-green-600 text-xl font-bold" id="total-income">₹0.00</p>
</div>
<div>
<p class="text-lg font-semibold">Total Expense</p>
<p class="text-red-600 text-xl font-bold" id="total-expense">₹0.00</p>
</div>
<div>
<p class="text-lg font-semibold">Net Balance</p>
<p class="text-blue-600 text-xl font-bold" id="net-balance">₹0.00</p>
</div>
</div>
</div>
<!-- Buttons for Adding Income and Expense -->
<div class="flex justify-around mb-4">
<button id="add-income-btn" class="bg-green-500 text-white px-4 py-2 rounded-lg shadow hover:bg-green-600 transition-all transform hover:scale-105">
<i class="fas fa-plus"></i> Add Income
</button>
<button id="add-expense-btn" class="bg-red-500 text-white px-4 py-2 rounded-lg shadow hover:bg-red-600 transition-all transform hover:scale-105">
<i class="fas fa-plus"></i> Add Expense
</button>
</div>
<!-- Filters -->
<div class="mb-4 text-center">
<form id="filter-form">
<label>
<input type="radio" name="filter" value="all" checked> All
</label>
<label>
<input type="radio" name="filter" value="income"> Income
</label>
<label>
<input type="radio" name="filter" value="expense"> Expense
</label>
</form>
</div>
<!-- List of Entries -->
<ul id="entries-list" class="bg-white p-4 rounded shadow">
<!-- Dynamically populated list items will go here -->
</ul>
</div>
<!-- Income Modal -->
<div id="income-modal" class="fixed inset-0 bg-gray-600 bg-opacity-50 flex justify-center items-center hidden">
<div class="bg-white p-6 rounded shadow-lg w-full max-w-md transform modal-enter">
<h2 class="text-2xl font-bold mb-4">Add Income</h2>
<form id="income-form">
<label class="block mb-2">Description</label>
<input id="income-description" type="text" class="w-full mb-4 p-2 border rounded" required>
<label class="block mb-2">Amount</label>
<input id="income-amount" type="number" class="w-full mb-4 p-2 border rounded" required>
<div class="flex justify-between">
<button type="submit" class="bg-green-500 text-white px-4 py-2 rounded">Add</button>
<button type="button" id="close-income-modal" class="bg-gray-500 text-white px-4 py-2 rounded">Cancel</button>
</div>
</form>
</div>
</div>
<!-- Expense Modal -->
<div id="expense-modal" class="fixed inset-0 bg-gray-600 bg-opacity-50 flex justify-center items-center hidden">
<div class="bg-white p-6 rounded shadow-lg w-full max-w-md transform modal-enter">
<h2 class="text-2xl font-bold mb-4">Add Expense</h2>
<form id="expense-form">
<label class="block mb-2">Description</label>
<input id="expense-description" type="text" class="w-full mb-4 p-2 border rounded" required>
<label class="block mb-2">Amount</label>
<input id="expense-amount" type="number" class="w-full mb-4 p-2 border rounded" required>
<div class="flex justify-between">
<button type="submit" class="bg-red-500 text-white px-4 py-2 rounded">Add</button>
<button type="button" id="close-expense-modal" class="bg-gray-500 text-white px-4 py-2 rounded">Cancel</button>
</div>
</form>
</div>
</div>
<script src="script.js"></script>
</body>
</html>