-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·200 lines (186 loc) · 11.4 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="utf-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Student loan payment calculator using AngularJS.">
<meta name="keywords" content="HTML, CSS, Javascript, JQuery, AngularJS">
<meta name="author" content="Kaitlin Kidd">
<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<!-- Title -->
<title>Student Loan Payment Calculator</title>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet">
<!-- CSS -->
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link type="text/css" rel="stylesheet" media="screen" href="css/styles.css">
<link type="text/css" rel="stylesheet" media="screen" href="css/styles-responsive.css">
<link type="text/css" rel="stylesheet" media="screen" href="js/angular-tooltips-master/dist/angular-tooltips.min.css" />
</head>
<body>
<h1>Student Loan Repayment Calculator</h1>
<h2>Calculating payment options for your student loans</h2>
<!-- App -->
<div ng-app = "loanApp">
<!-- Views -->
<a id="monthlyPaymentBtn" class="btn btn-info" href = "#monthlyPayment">Monthly Payment</a>
<a id="payoffTimeBtn" class="btn btn-info" href = "#payoffTime">Payoff Time</a>
<div ng-view></div>
<!--- /////////////////////////////////////// -->
<!--- //// Monthly Payment View //// -->
<!--- /////////////////////////////////////// -->
<script type = "text/ng-template" id = "monthlyPayment.htm">
<div ng-controller="monthlyPaymentController">
<form name="monthlyPaymentForm">
<!-- Principal (P) -->
<div class="loanInput">
<a href="#" tooltips tooltip-template="{{loan.principalToolTip}}" tooltip-side="right" tooltip-size="medium"><label>Principal amount:</label></a>
<input type="number" class="form-control" id="principalInput" name="principalInput" ng-model="loan.principal" min="1" max="999999" tabindex=1 required />
<div ng-messages="monthlyPaymentForm.principalInput.$error">
<div class="error" ng-message="required">Principal is required.</div>
<div class="error" ng-message="min">Principal must be at least $1.</div>
<div class="error" ng-message="max">Principal must be less than $1,000,000.</div>
</div>
</div>
<!-- Interest Rate (R) -->
<div class="loanInput">
<a href="#" tooltips tooltip-template="{{loan.interestRateToolTip}}" tooltip-side="left" tooltip-size="medium"><label>Interest rate:</label></a>
<input type="number" class="form-control" id="interestInput" name="interestInput" ng-model="loan.interestRate" min="0.0001" max="100" tabindex=2 required />
<div ng-messages="monthlyPaymentForm.interestInput.$error">
<div class="error" ng-message="required">Interest rate is required.</div>
<div class="error" ng-message="min">Interest rate must be greater than 0%.</div>
<div class="error" ng-message="max">Interest rate must be less than 100%.</div>
</div>
</div>
<!-- Period (N) -->
<div class="loanInput">
<a href="#" tooltips tooltip-template="{{loan.periodToolTip}}" tooltip-side="right" tooltip-size="medium"><label>Period in years:</label></a>
<input type="number" class="form-control" id="periodInput" name="periodInput" ng-model = "loan.period" min="1" max="100" tabindex=3 required />
<div ng-messages="monthlyPaymentForm.periodInput.$error">
<div class="error" ng-message="required">Period is required.</div>
<div class="error" ng-message="min">Period must be at least 1.</div>
<div class="error" ng-message="max">Period must be less than 100.</div>
</div>
</div>
</form>
<!-- Generated Interest -->
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h3>Generated interest</h3>
<hr id="interestHr">
</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<p class="loan-label"><i class="fa fa-usd" aria-hidden="true"></i> Daily: </p>
<p class="loan-value">{{loan.dailyInterest() | currency}}</p>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<p class="loan-label"><i class="fa fa-usd" aria-hidden="true"></i> Weekly: </p>
<p class="loan-value">{{loan.weeklyInterest() | currency}}</p>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<p class="loan-label"><i class="fa fa-usd" aria-hidden="true"></i> Monthly: </p>
<p class="loan-value">{{loan.monthlyInterest() | currency}}</p>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<p class="loan-label"><i class="fa fa-usd" aria-hidden="true"></i> Annually: </p>
<p class="loan-value">{{loan.annualInterest() | currency}}</p>
</div>
</div>
<!-- Payment -->
<div class="row">
<div class="col-lg-12">
<h3>Payment</h3>
<hr id="paymentHr">
</div>
</div>
<div class="row">
<div class="col-md-6">
<p class="payment-label"><i class="fa fa-calendar-check-o" aria-hidden="true"></i> Monthly payment required to pay off loan in {{loan.period | number}} year(s):</p>
<p class="payment-value">{{loan.emi() | currency}}</p>
</div>
<div class="col-md-3">
<p class="loan-label">Total paid for loan: </p>
<p class="loan-value">{{loan.repayment() | currency}}</p>
</div>
<div class="col-md-3">
<p class="loss-label"><i class="fa fa-arrow-down" aria-hidden="true"></i> Net loss: </p>
<p class="loss-value">{{loan.loss() | currency}}</p>
</div>
</div>
</div>
</script>
<!--- /////////////////////////////// -->
<!--- //// Payoff Time View //// -->
<!--- /////////////////////////////// -->
<script type = "text/ng-template" id = "payoffTime.htm">
<div ng-controller="payoffTimeController">
<form name="payoffTimeForm">
<!-- Principal (P) -->
<div class="loanInput">
<a href="#" tooltips tooltip-template="{{loan.principalToolTip}}" tooltip-side="right" tooltip-size="medium"><label>Principal amount:</label></a>
<input type="number" class="form-control" id="principalInput" name="principalInput" ng-model="loan.principal" min="1" max="999999" required />
<div ng-messages="payoffTimeForm.principalInput.$error">
<div class="error" ng-message="required">Principal is required.</div>
<div class="error" ng-message="min">Principal must be at least $1.</div>
<div class="error" ng-message="max">Principal must be less than $1,000,000.</div>
</div>
</div>
<!-- Interest Rate (R) -->
<div class="loanInput">
<a href="#" tooltips tooltip-template="{{loan.interestRateToolTip}}" tooltip-side="left" tooltip-size="medium"><label>Interest rate:</label></a>
<input type="number" class="form-control" id="interestInput" name="interestInput" ng-model="loan.interestRate" min="0.0001" max="100" required />
<div ng-messages="payoffTimeForm.interestInput.$error">
<div class="error" ng-message="required">Interest rate is required.</div>
<div class="error" ng-message="min">Interest rate must be greater than 0%.</div>
<div class="error" ng-message="max">Interest rate must be less than 100%.</div>
</div>
</div>
<!-- Monthly Payment (M) -->
<div class="loanInput">
<a href="#" tooltips tooltip-template="{{loan.paymentToolTip}}" tooltip-side="right" tooltip-size="medium"><label>Monthly payment contributed:</label></a>
<input type="number" class="form-control" id="paymentInput" name="paymentInput" ng-model = "loan.payment" min="1" max="999999" required />
<div ng-messages="payoffTimeForm.paymentInput.$error">
<div class="error" ng-message="required">Monthly payment is required.</div>
<div class="error" ng-message="min">Monthly payment must be at least $1.</div>
<div class="error" ng-message="max">Monthly payment must be less than $1,000,000.</div>
</div>
</div>
</form>
<!-- Payoff Time -->
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h3>Payoff Time</h3>
<hr id="payoffHr">
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<p class="payoff-label"><i class="fa fa-calendar-o" aria-hidden="true"></i> Months: </p>
<p class="payoff-value">{{loan.payoffMonths() | number}} ≈ {{loan.payoffMonths() | roundup}}</p>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<p class="payoff-label"><i class="fa fa-calendar" aria-hidden="true"></i> Years: </p>
<p class="payoff-value">{{loan.payoffYears() | number}} ≈ {{loan.payoffYears() | roundup}}</p>
</div>
<div class="clear"><br></div>
</script>
</div>
<!-- Javascript-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.4/angular-messages.min.js"></script>
<script src="js/loanApp.js"></script>
<script src="js/monthlyPaymentController.js"></script>
<script src="js/payoffTimeController.js"></script>
<script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-route.min.js"></script>
<script src="js/angular-tooltips-master/dist/angular-tooltips.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://use.fontawesome.com/79523df6a7.js"></script>
</body>
</html>