-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
326 lines (291 loc) · 14.9 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Simple Unit Converter</title>
<meta name="Description" content="Simple Unit Converter - A simple, right-to-the-point, easy-to-use online unit converter.
You can convert just about anything.
Easily convert:
Area:
- Square Mile
- Square Yard
- Square Foot
- Square Inch
- Hectare
- Acre
- Square Kilometer
- Square Meter
- Square Centimeter
- Square Millimeter
Energy:
- Btus
- Calories
- Ergs
- Foot-Pounds
- Joules
- Kilogram-Calories
- Kilogram-Meters
- Kilowatt-Hours
- Newton-Meters
- Watt-Hours
Temperature:
- Celsius
- Fahrenheit
- Kelvin
Length:
- Mile (nautical)
- Mile
- Yard
- Foot
- Inch
- Kilometer
- Meter
- Centimeter
- Millimeter
Weight:
- Short Ton (US)
- Pound (US)
- Ounce (US)
- Stone
- Long Ton (UK)
- Metric Ton
- Kilogram
- Gram
Speed:
- Knots
- Miles/Hour
- Miles/Minute
- Feet/Minute
- Feet/Second
- Kilometers/Hour
- Kilometers/Minute
- Meters/Second
Volume:
- Cubic Feet
- Gallon (Imperial)
- Gallon (US)
- Quart (US)
- Pint (US)
- Fluid Ounce (US)
- Cup
- Tablespoon
- Teaspoon
- Dram (US)
- Cubic Meter
- Liter
Time:
- Years
- Weeks
- Days
- Hours
- Minutes
- Seconds
- Milliseconds
- Microseconds
- Nanoseconds">
<meta name="keywords" content="unit, converter, simple, easy, fast, Area, Energy, Temperature, Length, Weight, Speed, Volume, Time">
<meta name="author" content="Ricardo Fabila">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta charset="utf-8">
<!-- JS & CSS-->
<script src="./bower_components/angular/angular.js"></script>
<script src="./bower_components/jquery/dist/jquery.min.js"></script>
<script src="./bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="./bower_components/clipboard/dist/clipboard.min.js"></script>
<link rel="stylesheet" href="./bower_components/bootstrap/dist/css/bootstrap.min.css" type="text/css">
<script src="javascript/converter.js"></script>
<script src="javascript/controllers.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body ng-app="app">
<main class="main fixedSize">
<div>
<form name="form" ng-controller="MainCtrl" novalidate>
<!-- Images-->
<ng-switch on="type">
<div ng-switch-when="none">
<div id="over">
<span class="Centerer"></span><img class="Centered images balance" ng-src="images/Balance.svg" alt="Simple Unit Converter"/>
</div>
</div>
<div ng-switch-default>
<div id="over">
<span class="Centerer"></span><img class="Centered images" ng-src="images/{{type}}.png" alt="{{type}}"/>
</div>
</div>
</ng-switch>
<!--
<div id="over">
<span class="Centerer"></span><img class="Centered images" ng-src="images/{{type}}.png" alt="{{type}}"/>
</div>
-->
<!-- /Images-->
<!-- break line to separate elements using bootstrap-->
<div class="clearfix separator" style="margin: 20px"></div>
<!-- Type select combo box-->
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<select class="form-control input-lg" ng-model="type" ng-options="item for item in typeArray">
<option style="display:none" value="">select an unit type</option>
</select>
</div>
<!-- /Type select combo box-->
<!-- break line to separate elements using bootstrap-->
<div class="clearfix separator" style="margin: 20px"></div>
<!-- input unit select combo box-->
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 bottom-space">
<ng-switch on="type">
<div ng-switch-when="Area">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in areaArray" ng-change="convert(type, from, to, inputUnit)" >
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Computer Storage">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in computerStorageArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Energy">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in energyArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Length">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in lengthArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Weight">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in weightArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Speed">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in speedArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Temperature">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in temperatureArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Time">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in timeArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Volume">
<select class="form-control input-lg" ng-model="$parent.from" ng-options="item for item in volumeArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
<option ng-repeat="item in volumeArray">{{item}}</option>
</select>
</div>
<div ng-switch-default>
<select class="form-control input-lg" ng-model="$parent.from">
<option style="display:none" value="">select unit</option>
</select>
</div>
</ng-switch>
</div>
<!-- /input unit select combo box-->
<!-- output unit select combo box-->
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 bottom-space">
<ng-switch on="type">
<div ng-switch-when="Area">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in areaArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Computer Storage">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in computerStorageArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Energy">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in energyArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Length">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in lengthArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Weight">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in weightArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Speed">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in speedArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Temperature">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in temperatureArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Time">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in timeArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
</select>
</div>
<div ng-switch-when="Volume">
<select class="form-control input-lg" ng-model="$parent.to" ng-options="item for item in volumeArray" ng-change="convert(type, from, to, inputUnit)">
<option style="display:none" value="">select unit</option>
<option ng-repeat="item in volumeArray">{{item}}</option>
</select>
</div>
<div ng-switch-default>
<select class="form-control input-lg" ng-model="$parent.to">
<option style="display:none" value="">select unit</option>
</select>
</div>
</ng-switch>
</div>
<!-- output unit select combo box-->
<!-- break line to separate elements using bootstrap-->
<div class="clearfix separator" style="margin: 10px"></div>
<!-- Text input -->
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 bottom-space" >
<input class="form-control" type="text" ng-model="inputUnit" placeholder="0" valid-number required="true" autofocus>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 bottom-space">
<div class="input-group">
<input type="text" class="form-control" placeholder="0" ng-model="outputUnit" readonly id="result">
<span class="input-group-addon" id="copy_button" data-clipboard-target="#result">
<img src="images/copy.svg" alt="Copy to clipboard" width="16">
</span>
</div>
</div>
<!-- /Text input -->
<!-- break line to separate elements using bootstrap-->
<div class="clearfix separator" style="margin: 15px"></div>
<!-- Field required warning -->
<p ng-show="inputUnit.$invalid && inputUnit.$touched" style="text-align: center; color: #ED4337;" name="warning" ng-model="warning">Please enter a number.</p>
<!-- /Field required warning -->
<!-- Buttons -->
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8" style="left:15%">
<button type="button" class="btn btn-primary btn-lg btn-block" ng-click="convert(type, from, to, inputUnit)">Convert</button>
<button type="button" class="btn btn-danger btn-lg btn-block" ng-click="invert(type, from, to, inputUnit)">Invert</button>
</div>
<!-- /Buttons -->
</form>
<!-- break line to separate elements using bootstrap-->
<div class="clearfix separator" style="margin: 10px"></div>
</div>
<p style="text-align: center; color: #bfbcbc;">Made with ♥ by Ricardo Fabila</p>
</main>
<script>
var btn = document.getElementById('copy_button');
var clipboard = new Clipboard(btn);
clipboard.on('success', function(e) {
//console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
console.log("It seams the copy to clipboard funciton is not working correctly.");
});
</script>
</body>
</html>