-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
executable file
·224 lines (218 loc) · 9.05 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE HTML>
<html lang="en-US" ng-app="ammortizeApp">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Real Time Mortgage Amortization Calculator</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="assets/css/bootstrap-material.min.css">
<link rel="stylesheet" href="assets/css/arrow-keys.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.4/paper/bootstrap.min.css">
<link rel="stylesheet" href="bower_components/angular-chart.js/dist/angular-chart.css">
<link rel="icon" href="favicon.ico">
<base href="/">
<style>
.input-group-addon {
width: 50px;
}
</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-63545492-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="container" ng-controller="AmortizationController">
<div class="content">
<div class="row">
<div class="col-sm-12">
<h2>Real Time Amortization Calculator</h2>
</div>
</div>
<div class="row">
<div class="col-sm-5">
<div class="bs-component">
<form class="form-horizontal" id="monthly_costs">
<fieldset>
<legend style="width:99%;">Costs</legend>
<label for="purchase_price" class="col-sm-4 control-label">Purchase Price</label>
<div class="form-group input-group col-sm-5">
<div class="input-group-addon">$</div>
<input type="number"
step="5000"
min="0"
id="purchase_price"
required
ng-model="ammortization_params.purchase_price"
ng-change="updateSchedule()"
class="form-control">
</div>
<div class="clearfix"></div>
<label for="down_payment" class="col-sm-4 control-label">Down Payment</label>
<div class="form-group input-group col-sm-5">
<div class="input-group-addon">$</div>
<input type="number"
step="1000"
min="0"
id="down_payment"
required
ng-model="ammortization_params.down_payment"
ng-change="updateSchedule()"
class="form-control">
</div>
<div class="clearfix"></div>
<label for="payments_per_year" class="col-sm-4 control-label">Payment Frequency</label>
<div class="form-group input-group col-sm-5">
<div class="input-group-addon"> </div>
<select
name="payments_per_year"
form="ammortization"
id="payments_per_year"
required
ng-model="ammortization_params.payments_per_year"
ng-change="updateSchedule()"
class="form-control"
ng-options="option.value as option.name for option in ppy_options">
</select>
</div>
<div class="clearfix"></div>
<label for="nominal_rate" class="col-sm-4 control-label">Nominal Rate</label>
<div class="form-group input-group col-sm-5">
<div class="input-group-addon">%</div>
<input type="number"
min="0.0"
max="99.9"
step="0.1"
id="nominal_rate"
required
ng-model="ammortization_params.nominal_rate"
ng-change="updateSchedule()"
class="form-control">
</div>
<div class="clearfix"></div>
<label for="nominal_rate" class="col-sm-4 control-label">Rate Type</label>
<div class="form-group input-group col-sm-5">
<div class="input-group-addon"> </div>
<select
class="form-control"
name="annual_compounding_periods"
form="ammortization"
id="annual_compounding_periods"
required
ng-model="ammortization_params.annual_compounding_periods"
ng-change="updateSchedule()"
ng-options="option.value as option.name for option in cp_options">
</select>
</div>
<div class="clearfix"></div>
<label for="nominal_rate" class="col-sm-4 control-label">Mortgage Term</label>
<div class="form-group input-group col-sm-5" style="position:relative;left:50px">
<input type="number"
min="5"
max="25"
step="1"
id="mortgage_term"
required
ng-model="ammortization_params.mortgage_term"
ng-change="updateSchedule()"
class="form-control">
<div class="input-group-addon">Years</div>
</div>
<div class="clearfix"></div>
<label for="condo_fees" class="col-sm-4 control-label">Condo Fees</label>
<div class="form-group input-group col-sm-5">
<div class="input-group-addon">$</div>
<input type="number"
step="50"
min="0"
id="condo_fees"
required
ng-model="ammortization_params.condo_fees"
ng-change="updateMonthlyCosts()"
class="form-control">
</div>
<div class="clearfix"></div>
<label for="condo_fees" class="col-sm-4 control-label">Property Tax</label>
<div class="form-group input-group col-sm-5">
<div class="input-group-addon">$</div>
<input type="number"
step="50"
min="0"
id="property_tax"
required
ng-model="ammortization_params.property_tax"
ng-change="updateMonthlyCosts()"
class="form-control">
</div>
</fieldset>
</form>
<br>
<div class="clearfix"></div>
<div class="col-sm-12">
<label for="easy_url">Copy URL to share</label>
<input ng-model="easy_url" id="easy_url" onClick="this.select();" class="form-control">
</div>
</div><!-- .row well bs-component -->
</div><!-- .col-sm-6-->
<div class="col-sm-7" id="line-chart">
<legend><b>Avg Monthly Cost: {{ total_monthly_cost }}</b><i style="font-size:13px;color:gray;margin-left:15px;">(payment amt * {{ payments_per_year }} annual payments / 12 months)</i></legend>
<div class="panel panel-default">
<div class="panel-heading">Loan payment principal to interest ratio</div>
<div class="panel-body">
<canvas id="line" class="chart chart-line" data="data"
labels="labels" legend="true" series="series"
click="onClick">
</canvas>
</div>
<span style="text-align:right;display:block;padding:15px;">
Principal: {{ principal }}<br>
Interest: {{ total_cost_of_interest }}<br>
Total: {{ total_cost_of_ammortization }}<br>
Nominal rate: {{ nominal_rate }}<br>
Effective rate: {{ effective_rate }}<br>
CMHC insurance: {{ cmhc_amount }}<br>
</span>
</div>
</div>
</div><!-- .row-->
</div><!--.content-->
<br><br><br>
<div class="modal" id="tip_modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Use the arrow keys to change values quickly</h4>
</div>
<div class="modal-body arrows">
<ul>
<li>↑</li>
<li>←</li>
<li>↓</li>
<li>→</li>
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary " data-dismiss="modal" aria-hidden="true">Thanks!</button>
</div>
</div>
</div>
</div>
</div><!--.container-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.1/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.1/angular-route.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js"></script>
<script src="real-time-ammortization/bower_components/angular-chart.js/dist/angular-chart.js"></script>
<script src="real-time-ammortization/assets/js/accounting.js"></script>
<script src="real-time-ammortization/assets/js/amortization.js"></script>
<script src="real-time-ammortization/assets/js/application.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="real-time-ammortization/assets/js/main.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</body>
</html>