File size: 7,958 Bytes
7b78975
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ReceiptRanger - Track Your Spending</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="components/navbar.js"></script>
    <script src="components/receipt-card.js"></script>
    <script src="components/spending-chart.js"></script>
</head>
<body class="bg-gray-50 min-h-screen">
    <custom-navbar></custom-navbar>
    
    <main class="container mx-auto px-4 py-8">
        <div class="flex flex-col md:flex-row gap-8">
            <!-- Dashboard Summary -->
            <div class="md:w-1/3">
                <div class="bg-white rounded-xl shadow-md p-6 mb-6">
                    <h2 class="text-xl font-bold text-gray-800 mb-4">Monthly Summary</h2>
                    <div class="space-y-4">
                        <div>
                            <p class="text-gray-500">Total Spent</p>
                            <p class="text-3xl font-bold text-indigo-600">$1,245.67</p>
                        </div>
                        <div>
                            <p class="text-gray-500">Categories</p>
                            <div class="flex flex-wrap gap-2 mt-2">
                                <span class="px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm">Food</span>
                                <span class="px-3 py-1 bg-green-100 text-green-800 rounded-full text-sm">Transport</span>
                                <span class="px-3 py-1 bg-purple-100 text-purple-800 rounded-full text-sm">Shopping</span>
                                <span class="px-3 py-1 bg-yellow-100 text-yellow-800 rounded-full text-sm">Entertainment</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="bg-white rounded-xl shadow-md p-6">
                    <h2 class="text-xl font-bold text-gray-800 mb-4">Add New Receipt</h2>
                    <div class="space-y-4">
                        <div class="text-center">
                            <button id="scanReceiptBtn" class="w-full bg-indigo-600 text-white py-3 px-4 rounded-lg hover:bg-indigo-700 transition duration-200 flex items-center justify-center">
                                <i data-feather="camera" class="mr-2"></i> Scan Receipt
                            </button>
                            <p class="text-gray-500 text-sm mt-2">or</p>
                            <button id="uploadReceiptBtn" class="w-full bg-white text-indigo-600 py-3 px-4 rounded-lg border border-indigo-600 hover:bg-indigo-50 transition duration-200 flex items-center justify-center">
                                <i data-feather="upload" class="mr-2"></i> Upload Image
                            </button>
                        </div>
                        <div id="receiptPreview" class="hidden">
                            <img id="previewImage" src="" class="w-full h-48 object-contain rounded-lg border border-gray-200 mb-2">
                            <div class="flex justify-between">
                                <button id="retakeBtn" class="text-indigo-600 hover:text-indigo-800 flex items-center">
                                    <i data-feather="refresh-cw" class="mr-1"></i> Retake
                                </button>
                                <button id="processBtn" class="bg-indigo-600 text-white py-1 px-3 rounded-lg hover:bg-indigo-700 transition duration-200 flex items-center">
                                    <i data-feather="zap" class="mr-1"></i> Process
                                </button>
                            </div>
                        </div>
                        <form id="receiptForm" class="hidden space-y-4">
                            <div>
                                <label class="block text-gray-700 mb-2">Amount</label>
                                <input type="number" name="amount" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
                            </div>
                            <div>
                                <label class="block text-gray-700 mb-2">Category</label>
                                <select name="category" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
                                    <option>Food</option>
                                    <option>Transport</option>
                                    <option>Shopping</option>
                                    <option>Entertainment</option>
                                    <option>Utilities</option>
                                </select>
                            </div>
                            <div>
                                <label class="block text-gray-700 mb-2">Date</label>
                                <input type="date" name="date" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
                            </div>
                            <div>
                                <label class="block text-gray-700 mb-2">Merchant</label>
                                <input type="text" name="merchant" class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
                            </div>
                            <button type="submit" class="w-full bg-indigo-600 text-white py-2 px-4 rounded-lg hover:bg-indigo-700 transition duration-200">
                                Save Receipt
                            </button>
                        </form>
                    </div>
</div>
            </div>

            <!-- Receipts List and Chart -->
            <div class="md:w-2/3">
                <div class="bg-white rounded-xl shadow-md p-6 mb-6">
                    <custom-spending-chart></custom-spending-chart>
                </div>

                <div class="bg-white rounded-xl shadow-md p-6">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-xl font-bold text-gray-800">Recent Receipts</h2>
                        <button class="text-indigo-600 hover:text-indigo-800 flex items-center">
                            <i data-feather="filter" class="mr-1"></i> Filter
                        </button>
                    </div>
                    
                    <div class="space-y-4">
                        <custom-receipt-card 
                            amount="45.67" 
                            category="Food" 
                            date="2023-05-15" 
                            merchant="Burger Palace">
                        </custom-receipt-card>
                        
                        <custom-receipt-card 
                            amount="28.50" 
                            category="Transport" 
                            date="2023-05-14" 
                            merchant="City Taxi">
                        </custom-receipt-card>
                        
                        <custom-receipt-card 
                            amount="120.99" 
                            category="Shopping" 
                            date="2023-05-12" 
                            merchant="Fashion Store">
                        </custom-receipt-card>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <script>
        feather.replace();
    </script>
    <script src="script.js"></script>
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
</body>
</html>