-
Notifications
You must be signed in to change notification settings - Fork 461
/
index.html
80 lines (72 loc) · 2.93 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
<!DOCTYPE html>
<html class="h-100">
<head>
<title>EMI Calculator</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body class="d-flex flex-column h-100">
<!-- Nav -->
<header>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<div class="container container-fluid">
<h1 class="navbar-brand">EMI Calculator</h1>
</div>
</nav>
</header>
<!-- Nav End -->
<main class="flex-shrink-0">
<div class="container" style="padding-top: 70px">
<!-- Form -->
<div class="row g-2">
<div class="col-md">
<div class="form-floating">
<input type="text" class="form-control" id="amount" placeholder="100000">
<label for="floatingInput">Loan Amount</label>
</div>
</div>
<div class="col-md">
<div class="form-floating">
<input type="text" class="form-control" id="interest" placeholder="10" />
<label for="floatingInput">Annual Interest Rate</label>
</div>
</div>
<div class="col-md">
<div class="form-floating">
<input type="text" class="form-control" id="months" placeholder="120">
<label for="floatingInput">Loan Duration (months)</label>
</div>
</div>
<div class="col-md">
<input id="calculate" class="btn btn-primary btn-lg" type="button" value="Calculate" />
</div>
</div>
<!-- Form End -->
<!-- Results Container -->
<div id="results" class="table-responsive table-responsive-sm">
</div>
<!-- Results End -->
</div>
</main>
<!-- Footer -->
<footer class="footer mt-auto py-3 border-top bg-light">
<div class="container">
<span class="text-muted">Made with ❤ by <a href="https://www.improwised.com">Improwised Technologies Private Limited</a> for <a href="http://bit.ly/msd-workshop">Modern Software Development Workflows</a> Workshop.</span>
</div>
</footer>
<!-- Footer End -->
<!-- Scripts -->
<script type="application/javascript" src="src/emi.js"></script>
<script type="application/javascript">
const button = document.getElementById('calculate');
button.addEventListener('click', (event) => {
const amount = Number(document.getElementById('amount').value);
const months = Number(document.getElementById('months').value);
const interest = Number(document.getElementById('interest').value);
const emi = EMI.Loan(amount, months, interest);
const table = EMI.emiToHtmlTable(emi)
document.getElementById('results').innerHTML = table;
});
</script>
<!-- Scripts End -->
</body>
</html>