-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloan.html
146 lines (120 loc) · 3.46 KB
/
loan.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Loan Calculator</title>
<script>
function Calculate() {
// Extracting value in the amount
// section in the variable
const amount = document.querySelector("#amount").value;
// Extracting value in the interest
// rate section in the variable
const rate = document.querySelector("#rate").value;
// Extracting value in the months
// section in the variable
const months = document.querySelector("#months").value;
// Calculating interest per month
const interest = (amount * (rate * 0.01)) / months;
// Calculating total payment
const total = (amount / months + interest).toFixed(2);
document.querySelector("#total").innerHTML = "EMI : (₹)" + total;
}
</script>
<style>
@font-face {
font-family: "goodtimes";
src: url(./fonts/good-times/good\ times\ rg.otf);
}
body {
padding-top: 15%;
padding-left: 50%;
font-family: "Trebuchet MS";
background-color: #001f4f;
background-image: url(https://www.allinonecalculator.com/images/home/background.jpg);
}
.calculator {
font-family: "goodtimes", sans-serif;
width: 500px;
height: 400px;
background: linear-gradient(to bottom right, #FE6244, #F7DB6A);
transform: translateX(-50%) translateY(-50%);
padding: 20px 0px 0px 100px;
border-radius: 50px;
color: black;
font-size: 1rem;
box-shadow: rgb(0, 0, 0)0px 1px 30px;
}
input {
padding: 7px;
width: 70%;
margin-top: 7px;
}
p {
font-size: 20px;
padding-right: 100px;
}
#home {
color: #FCE22A;
text-decoration: none;
font-size: 20px;
}
/* CSS */
.button-36 {
background-image: linear-gradient(92.88deg, #455EB5 9.16%, #5643CC 43.89%, #673FD7 64.72%);
border-radius: 8px;
border-style: none;
box-sizing: border-box;
color: #ffff00;
cursor: pointer;
flex-shrink: 0;
font-family: "Inter UI", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-size: 16px;
font-weight: 500;
height: 4rem;
padding: 0 1.6rem;
text-align: center;
text-shadow: rgba(0, 0, 0, 0.25) 0 3px 8px;
transition: all .5s;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
margin-left: -12.8%;
transition: all;
transition-duration: 1s;
}
.button-36:hover {
box-shadow: rgba(0, 0, 0, 3) 0 1px 30px;
transition-duration: .1s;
}
@media (min-width: 768px) {
.button-36 {
padding: 0 2.6rem;
}
}
</style>
</head>
<body>
<div class="calculator">
<h1>Loan Calculator</h1>
<!-- Calling Calculate function defined in app.js -->
<p>
Amount (₹) :
<input id="amount" type="number" onchange="Calculate()" />
</p>
<p>
Interest Rate :
<input id="rate" type="number" onchange="Calculate()" />
</p>
<p>
Months to Pay :
<input id="months" type="number" onchange="Calculate()" />
</p>
<h2 id="total"></h2>
</div>
<div>
<strong><button type="button" class="button-36"><a id="home" href="./index.html" rel="noopener noreferrer">Back to
homepage</a></button></strong>
</div>
<script src="app.js"></script>
</body>
</html>