-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
89 lines (89 loc) · 4.54 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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Note to peer reviewer:. I add Bootstrap to make the page prettier :) -->
<!-- This is a popular CSS framework, like Angular is for JS -->
<!-- Bootstrap 4.5 imports. -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<!-- personal note: Not importing JS part just yet -->
<!-- Project specific CSS and JS. -->
<script src="script.js"></script>
<link rel="stylesheet" href="style.css">
<title>WebApp - Simple Interest Calculator</title>
</head>
<body class="background-dotted h-100 d-flex flex-column">
<main class="">
<div class="container body-block border rounded-corners background-flat">
<div class="row mb-1 justify-content-center">
<!-- logo -->
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" fill="currentColor" class="bi bi-percent" viewBox="0 0 16 16">
<path d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0zM4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"/>
</svg>
</div>
<div class="row mb-3 justify-content-center">
<h1>Simple Interest Calculator</h1></div>
<form onsubmit="return false">
<div class="form-group">
<div class="row mb-1 justify-content-center align-items-center">
<div class="col-sm-3">Amount: </div>
<div class="col-sm-9 input-group">
<div class="input-group-prepend">
<span class="input-group-text">$</span>
</div>
<input type="number" placeholder="Enter amount..." class="form-control" id="principal" min=0 required>
</div>
</div>
<div class="row mb-1 justify-content-center align-items-center">
<div class="col-sm-3">Rate: </div>
<div class="col-sm-6">
<input type="range" class="form-control-range" id="rate_slider" value=15 min=10 max=200 onchange="updateRatePct('slider')" required>
</div>
<div class="col-sm-3 input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">%</span>
</div>
<input type="float" class="form-control" id="rate_box" value="1.2" onchange="updateRatePct('box')">
</div>
</div>
<div class="row mb-3 justify-content-center align-items-center">
<div class="col-sm-3">No. of Years: </div>
<div class="col-sm-9">
<select class="form-control" id="years" required>
<option value>Select...</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
</div>
</div>
<div class="row mb-3 justify-content-center">
<div class="col-sm-6">
<button class="btn btn-success btn-block" onclick="compute()">Compute</button>
</div>
</div>
<div class="row container mb-0" id="interest_result" hidden>
<p>If you deposit <mark><span id="result_principal">$100</span></mark>,<br>
at an interest rate of <mark><span id="result_interest">10.0%</span></mark>,<br>
you will receive <mark><span id="result_fv">$110</span></mark><br>
at the end of the year <mark><span id="result_year">2000</span></mark>.</p>
</div>
</div>
</form>
</div>
</main>
<footer class="footer mt-auto py-3 bg-light">
<div class="container">
<span class="text-muted">Ⓒ Everyone Can Get Rich</span>
</div>
</footer>
</body>
</html>