-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
239 lines (217 loc) · 12.4 KB
/
index.html
File metadata and controls
239 lines (217 loc) · 12.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" href="/images/dp.png">
<title>Currency Counter</title>
<!-- Tailwind CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Library to save DOM as image -->
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
<!-- vercel web analytics -->
<script defer src="https://va.vercel-scripts.com/v1/script.js"></script>
<!-- vercel speed analytics -->
<script defer src="https://speed.vercel-scripts.com/v1/script.js"></script>
<!-- custom styles and scripts -->
<link rel="stylesheet" href="style.css" />
<script src="script.js" defer></script>
</head>
<body class="bg-gray-100 text-slate-800 min-h-screen flex flex-col">
<!-- saving area -->
<div id="capture-area" class="max-w-sm mx-auto px-4 pb-32">
<!-- header -->
<header class="w-full px-4 pt-6 pb-3">
<div class="max-w-sm mx-auto flex items-center justify-between">
<h1 class="text-lg font-semibold">Currency <span class="font-bold">Counter</span></h1>
<img src="./images/logo.png" alt="logo" class="h-9 opacity-80 " />
</div>
</header>
<main class="flex-1 w-full">
<!-- timestamp -->
<div class="text-xs text-slate-500 text-center mb-2">
saved time:
<span id="timestamp-text" class="font-medium">—</span>
</div>
<!-- target -->
<section class="bg-white rounded-2xl p-4 shadow-sm border border-slate-300">
<label class="text-sm text-slate-600 mb-2 block">Target amount</label>
<input id="target" type="number" min="0"
class="w-full p-3 text-right rounded-lg bg-slate-50 border border-slate-200 font-semibold"
placeholder="Enter target (₹)">
</section>
<!-- denominations -->
<section class="mt-2 space-y-1 min-w-[350px]">
<!-- 500 -->
<div class="denom-card flex items-center gap-3 bg-white rounded-xl p-3 shadow-sm border border-slate-300 "
data-denom="500">
<div class="min-w-[72px] flex items-center flex-col gap-1">
<img src="./images/500.png" alt="₹500" class="h-8 w-auto rounded-md object-contain" />
<div class="text-sm text-slate-800 font-semibold ">₹500</div>
</div>
<div class="flex items-center gap-2 flex-1">
<button type="button" class="decBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700" aria-label="decrease">
<span class="sym-idle">X</span> <span class="sym-active">−</span> </button>
<input id="note500" type="number" inputmode="numeric" min="0"
class="qtyInput w-20 text-right bg-slate-50 rounded-md p-2 font-semibold"
aria-label="Count of 500 rupee notes" placeholder="0" />
<button type="button" class="incBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700" aria-label="increase">
<span class="sym-idle">=</span> <span class="sym-active">+</span> </button>
</div>
<div class="text-center min-w-[84px] ">
<div class="text-xs text-slate-400">Subtotal</div>
<div id="note500Total" class="text-lg font-extrabold text-slate-800">₹0</div>
</div>
</div>
<!-- 200 -->
<div class="denom-card flex items-center gap-3 bg-white rounded-xl p-3 shadow-sm border border-slate-300"
data-denom="200">
<div class="min-w-[72px] flex items-center flex-col gap-1"> <img src="./images/200.png" alt="₹200"
class="h-10 w-auto rounded-md object-contain" />
<div class="text-sm text-slate-800 font-semibold">₹200</div>
</div>
<div class="flex items-center gap-2 flex-1"> <button type="button"
class="decBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">X</span> <span
class="sym-active">−</span> </button> <input id="note200" type="number" inputmode="numeric" min="0"
class="qtyInput w-20 text-right bg-slate-50 rounded-md p-2 font-semibold"
aria-label="Count of 200 rupee notes" placeholder="0" /> <button type="button"
class="incBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">=</span> <span
class="sym-active">+</span> </button> </div>
<div class="text-center min-w-[84px]">
<div class="text-xs text-slate-400">Subtotal</div>
<div id="note200Total" class="text-lg font-extrabold text-slate-800">₹0</div>
</div>
</div>
<!-- 100 -->
<div class="denom-card flex items-center gap-3 bg-white rounded-xl p-3 shadow-sm border border-slate-300"
data-denom="100">
<div class="min-w-[72px] flex items-center flex-col gap-1"> <img src="./images/100.png" alt="₹100"
class="h-8 w-auto rounded-md object-contain" />
<div class="text-sm text-slate-800 font-semibold">₹100</div>
</div>
<div class="flex items-center gap-2 flex-1"> <button type="button"
class="decBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">X</span> <span
class="sym-active">−</span> </button> <input id="note100" type="number" inputmode="numeric" min="0"
class="qtyInput w-20 text-right bg-slate-50 rounded-md p-2 font-semibold"
aria-label="Count of 100 rupee notes" placeholder="0" /> <button type="button"
class="incBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">=</span> <span
class="sym-active">+</span> </button> </div>
<div class="text-center min-w-[84px]">
<div class="text-xs text-slate-400">Subtotal</div>
<div id="note100Total" class="text-lg font-extrabold text-slate-800">₹0</div>
</div>
</div>
<!-- 50 -->
<div class="denom-card flex items-center gap-3 bg-white rounded-xl p-3 shadow-sm border border-slate-300"
data-denom="50">
<div class="min-w-[72px] flex items-center flex-col gap-1"> <img src="./images/50.png" alt="₹50"
class="h-8 w-auto rounded-md object-contain" />
<div class="text-sm text-slate-800 font-semibold">₹50</div>
</div>
<div class="flex items-center gap-2 flex-1"> <button type="button"
class="decBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">X</span> <span
class="sym-active">−</span> </button> <input id="note50" type="number" inputmode="numeric" min="0"
class="qtyInput w-20 text-right bg-slate-50 rounded-md p-2 font-semibold"
aria-label="Count of 50 rupee notes" placeholder="0" /> <button type="button"
class="incBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">=</span> <span
class="sym-active">+</span> </button> </div>
<div class="text-center min-w-[84px]">
<div class="text-xs text-slate-400">Subtotal</div>
<div id="note50Total" class="text-lg font-extrabold text-slate-800">₹0</div>
</div>
</div>
<!-- 20 -->
<div class="denom-card flex items-center gap-3 bg-white rounded-xl p-3 shadow-sm border border-slate-300"
data-denom="20">
<div class="min-w-[72px] flex items-center flex-col gap-1"> <img src="./images/20.png" alt="₹20"
class="h-8 w-auto rounded-md object-contain" />
<div class="text-sm text-slate-800 font-semibold">₹20</div>
</div>
<div class="flex items-center gap-2 flex-1"> <button type="button"
class="decBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">X</span> <span
class="sym-active">−</span> </button> <input id="note20" type="number" inputmode="numeric" min="0"
class="qtyInput w-20 text-right bg-slate-50 rounded-md p-2 font-semibold"
aria-label="Count of 20 rupee notes" placeholder="0" /> <button type="button"
class="incBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">=</span> <span
class="sym-active">+</span> </button> </div>
<div class="text-center min-w-[84px]">
<div class="text-xs text-slate-400">Subtotal</div>
<div id="note20Total" class="text-lg font-extrabold text-slate-800">₹0</div>
</div>
</div>
<!-- 10 -->
<div class="denom-card flex items-center gap-3 bg-white rounded-xl p-3 shadow-sm border border-slate-300"
data-denom="10">
<div class="min-w-[72px] flex items-center flex-col gap-1"> <img src="./images/10.png" alt="₹10"
class="h-8 w-auto rounded-md object-contain" />
<div class="text-sm text-slate-800 font-semibold">₹10</div>
</div>
<div class="flex items-center gap-2 flex-1"> <button type="button"
class="decBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">X</span> <span
class="sym-active">−</span> </button> <input id="note10" type="number" inputmode="numeric" min="0"
class="qtyInput w-20 text-right bg-slate-50 rounded-md p-2 font-semibold"
aria-label="Count of 10 rupee notes" placeholder="0" /> <button type="button"
class="incBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">=</span> <span
class="sym-active">+</span> </button> </div>
<div class="text-center min-w-[84px]">
<div class="text-xs text-slate-400">Subtotal</div>
<div id="note10Total" class="text-lg font-extrabold text-slate-800">₹0</div>
</div>
</div>
<!-- coins (1) -->
<div class="denom-card flex items-center gap-3 bg-white rounded-xl p-3 shadow-sm border border-slate-300"
data-denom="1">
<div class="min-w-[72px] flex items-center flex-col gap-1"> <img src="./images/coins.png" alt="coins"
class="h-8 w-auto rounded-md object-contain" />
<div class="text-sm text-slate-800 font-semibold">Coins</div>
</div>
<div class="flex items-center gap-2 flex-1"> <button type="button"
class="decBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">X</span> <span
class="sym-active">−</span> </button> <input id="note1" type="number" inputmode="numeric" min="0"
class="qtyInput w-20 text-right bg-slate-50 rounded-md p-2 font-semibold"
aria-label="Count of coins (₹1 each)" placeholder="0" /> <button type="button"
class="incBtn px-3 py-2 rounded-md bg-slate-50 text-slate-700"> <span class="sym-idle">=</span> <span
class="sym-active">+</span> </button> </div>
<div class="text-center min-w-[84px]">
<div class="text-xs text-slate-400">Subtotal</div>
<div id="note1Total" class="text-lg font-extrabold text-slate-800">₹0</div>
</div>
</div>
<!-- to see sticky bar correctly -->
<div style="height:35px;" class="min-w-[150px]"></div>
</section>
</main>
<!-- sticky bar -->
<div
class="fixed bottom-12 left-1/2 -translate-x-1/2 w-[calc(100%-30px)] max-w-sm bg-white p-3 rounded-2xl shadow-lg border flex justify-between border border-slate-200 items-center gap-4">
<div>
<div class="text-s">Grand total</div>
<div id="grand-total" class="font-extrabold">₹0</div>
<div id="diff" class="text-sm text-slate-500">Difference: ₹0</div>
</div>
<div class="flex flex-col gap-2">
<button id="saveBtn"
class="bg-green-50 text-green-700 px-3 py-2 rounded-lg text-sm border border-slate-200">Save</button>
<button id="resetBtn"
class="bg-red-50 text-red-600 px-3 py-2 rounded-lg text-sm border border-slate-200">Reset</button>
</div>
</div>
</div>
<!-- FOOTER -->
<footer class="fixed bottom-0 w-full text-center py-3 bg-white border-t text-sm">
Developed by
<a href="https://www.instagram.com/nashif.me/" target="_blank" class="
inline-block
font-semibold
text-slate-800
transform
text-green-500
hover:text-blue-700
transition-all duration-200
animate-[float_2s_ease-in-out_infinite]
">
Nashif !
</a>
</footer>
</body>
</html>