-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
119 lines (96 loc) · 5.58 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Compound Interest Calculator</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<style>
* {
transition: all 0.2s ease-in;
}
</style>
<body>
<div class="container mx-auto px-4 mb-10">
<h1 class="text-3xl text-center mb-1">Simple & Compound <br> Interest Calculator</h1>
<div id="theme" class="flex justify-center my-3">
<div class="bg-blue-500 rounded-full border-2 mx-2 theme-color" data-color="blue-500"
style="width: 30px;height: 30px;cursor:pointer;"></div>
<div class="bg-rose-500 rounded-full border-2 mx-2 theme-color" data-color="rose-500"
style="width: 30px;height: 30px;cursor:pointer;"></div>
<div class="bg-green-500 rounded-full border-2 mx-2 theme-color" data-color="green-500"
style="width: 30px;height: 30px;cursor:pointer;"></div>
<div class="bg-orange-500 rounded-full border-2 mx-2 theme-color" data-color="orange-500"
style="width: 30px;height: 30px;cursor:pointer;"></div>
</div>
<div class="w-1/2 container mx-auto border-2 border-blue-500 theme-border p-4 rounded">
<div class="container mx-auto px-4 mb-8">
<input type="radio" name="interest" id="si" class="calc" value="si" checked>
<span class="font-semibold mr-10">Simple Interest</span>
<input type="radio" name="interest" id="ci" class="calc" value="ci">
<span class="font-semibold">Compound Interest</span>
</div>
<div class="container mx-auto px-4 mb-4">
<h2>Principal</h2>
<div class="grid grid-cols-2 w-90 gap-10">
<input type="range" name="principal-range" id="principal-range" value="500" min="1" max="1000000"
step="500">
<input type="number" value="500" name="principal-input" id="principal-input"
class="border-2 border-blue-500 theme-border rounded p-2" placeholder="Principal Amount">
</div>
</div>
<div class="container mx-auto px-4 mb-4">
<h2>Number of years</h2>
<div class="grid grid-cols-2 w-90 gap-10">
<input type="range" name="time-range" id="time-range" value="5" min="1" max="60" step="1">
<input type="number" value="5" name="time-input" id="time-input"
class="border-2 border-blue-500 theme-border rounded p-2" placeholder="No. of years">
</div>
</div>
<div class="container mx-auto px-4 mb-4">
<h2>Interest Rate (in %)</h2>
<div class="grid grid-cols-2 w-90 gap-10">
<input type="range" name="rate-range" id="rate-range" value="8" min="1" max="50" step="1">
<input type="number" value="8" name="rate-input" id="rate-input"
class="border-2 border-blue-500 theme-border rounded p-2" placeholder="Interest %">
</div>
</div>
<div class="container mx-auto px-4 mb-4">
<button class="bg-blue-500 theme-bg p-3 text-white rounded" id="calculate-btn">Calculate
<span id="calculate-btn-text">Simple Interest</span></button>
</div>
<div class="container mx-auto px-4 mt-10">
<div class="grid grid-cols-2 w-90 gap-10">
<h1 class="font-semibold">Amount: </h1>
<h2 class="font-semibold">₹ <span id="amount-div">0</span></h2>
</div>
</div>
<div class="container mx-auto px-4">
<div class="grid grid-cols-2 w-90 gap-10">
<h1 class="font-semibold">Principal: </h1>
<h2 class="font-semibold">₹ <span id="principal-div">0</span></h2>
</div>
</div>
<div class="container mx-auto px-4">
<div class="grid grid-cols-2 w-90 gap-10">
<h1 class="font-semibold">Interest Earned: </h1>
<h2 class="font-semibold">₹ <span id="interest-div">0</span></h2>
</div>
</div>
</div>
<div class="flex justify-center mt-5">
<a target="_blank" href="https://github.com/pradeepkumarverma1/simple-compound-interest-calculator">
<svg height="32" aria-hidden="true" viewBox="0 0 16 16" version="1.1" width="32"
data-view-component="true" class="octicon octicon-mark-github v-align-middle color-fg-default">
<path
d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z">
</path>
</svg>
</a>
</div>
</div>
<script type="module" src="./scripts/main.js"></script>
<script src="./scripts/theme.js"></script>
</body>
</html>