-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
243 lines (189 loc) · 14 KB
/
index.html
File metadata and controls
243 lines (189 loc) · 14 KB
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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>Percentage Calculator</title>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<meta name="description" content="This percentage calculator computes the percent of a number, the percentage change, and the quantity of a number whose percentage is provided.">
<link rel="preload" href="./assets/fonts/inter-v12-latin-regular.woff2" as="font" crossorigin type="font/woff2">
<link rel="preload" href="./assets/fonts/inter-v12-latin-500.woff2" as="font" crossorigin type="font/woff2">
<link rel="preload" href="./assets/fonts/inter-v12-latin-600.woff2" as="font" crossorigin type="font/woff2">
<link rel="preload" href="./assets/fonts/inter-v12-latin-800.woff2" as="font" crossorigin type="font/woff2">
<script type="text/javascript">
window._ = document.getElementById.bind(document);
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
window.defaultSystem = "imperial";
localStorage.setItem("theme", "light");
</script>
<link rel="stylesheet" href="./assets/css/main.min.css" />
<script src="./assets/js/all-calculators.js" defer></script>
</head>
<body style="background-color: transparent !important; min-height: 0 !important">
<div style="width: 100%;">
<div style="width:350px;float:left;padding: 15px;">
<div class="calculator-settings">
<div class="calculator-setting" id="calculator_form">
<div class="calculator-content col">
<div class="input-wrapper row">
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator">
<div class="dropdown-wrapper">
<div class="input-field row " tabindex="0">
<select class="input-field__text" onchange="switchTab(this)" id="type">
<option value="Common Phrases" >
Common Phrases
</option>
<option value="Simple Percentage" >
Simple Percentage
</option>
<option value="Percentage Change" >
Percentage Change
</option>
<option value="Percentage Difference" >
Percentage Difference
</option>
</select>
</div>
</div>
</label> </div>
<div class="input-wrapper input-wrapper--square row tab tab--active" data-tab="0">
<p class="input-field__hint">What is</p>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="a" id="number_a_a" value="30" />
<span class="input-field__hint">%</span>
</div>
</label> <p class="input-field__hint">of</p>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="b" id="number_a_b" value="20" />
</div>
</label> </div>
<div class="input-wrapper input-wrapper--square row tab tab--active" data-tab="0">
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="c" id="number_a_c" value="" />
</div>
</label> <p class="input-field__hint">is what % of</p>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="d" id="number_a_d" value="" />
</div>
</label> </div>
<div class="input-wrapper input-wrapper--square row tab tab--active" data-tab="0">
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="e" id="number_a_e" value="" />
</div>
</label> <p class="input-field__hint">is</p>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="f" id="number_a_f" value="" />
<span class="input-field__hint">%</span>
</div>
</label> <p class="input-field__hint">of what</p>
</div>
<div class="input-wrapper row tab" data-tab="1">
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="a" id="number_b_a" value="15" />
<span class="input-field__hint">%</span>
</div>
</label> <div class="input input--separator col">
<div class="input-field input-field--separator">
of
</div>
</div>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="b" id="number_b_b" value="200" />
</div>
</label> </div>
<div class="input-wrapper input-wrapper--square row tab" data-tab="2">
<p class="input-field__hint">Increase</p>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="a" id="number_c_a" value="3500" />
</div>
</label> <p class="input-field__hint">by</p>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="b" id="number_c_b" value="22" />
<span class="input-field__hint">%</span>
</div>
</label> </div>
<div class="input-wrapper input-wrapper--square row tab" data-tab="2">
<p class="input-field__hint">Decrease</p>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="c" id="number_c_c" value="9700" />
</div>
</label> <p class="input-field__hint">by</p>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="d" id="number_c_d" value="35" />
<span class="input-field__hint">%</span>
</div>
</label> </div>
<div class="input-wrapper row tab" data-tab="3">
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<p class="input__title">Value 1</p>
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="a" id="number_d_a" value="1" />
</div>
</label> <div class="input input--separator col">
<div class="input-field input-field--separator">
VS
</div>
</div>
<label class="input col percentage-increase-calculator,percentage-change-calculator,percentage-difference-calculator,percentile-calculator,percent-to-fraction-calculator,percentage-decrease-calculator ">
<p class="input__title">Value 2</p>
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="b" id="number_d_b" value="3" />
</div>
</label> </div>
</div>
<div class="calculator-content calculator-content--gray calculator-content--footer calculator-content--small row " >
<button class="button button--primary ml-auto" onclick="calculate(this); animateElements();" data-action="calculate" id="action-button">Calculate</button>
</div>
<script type="text/javascript" src="./assets/js/calculator.js" defer></script>
</div>
</div>
</div>
<div style="float:left;padding: 15px; overflow: scroll;">
<div class="calculator-result calculator-result--error col" id="error-box">
<div class="row">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM8.70711
7.29289C8.31658 6.90237 7.68342 6.90237 7.29289 7.29289C6.90237 7.68342 6.90237 8.31658 7.29289 8.70711L8.58579 10L7.29289 11.2929C6.90237 11.6834 6.90237 12.3166 7.29289
12.7071C7.68342 13.0976 8.31658 13.0976 8.70711 12.7071L10 11.4142L11.2929 12.7071C11.6834 13.0976 12.3166 13.0976 12.7071 12.7071C13.0976 12.3166 13.0976 11.6834 12.7071
11.2929L11.4142 10L12.7071 8.70711C13.0976 8.31658 13.0976 7.68342 12.7071 7.29289C12.3166 6.90237 11.6834 6.90237 11.2929 7.29289L10 8.58579L8.70711 7.29289Z" fill="#F87171" class="dark:fill-red-200"></path>
</svg>
<p class="calculator-error__title">There was an error with your calculation.</p>
</div>
<div class="col" id="error-list"></div>
</div> <span id="calculator_result"><div class="calculator-result col">
<p class="table-cell table-cell--dark table-cell--only-title">Result</p>
<p class="table-cell table-cell--only tab tab--active animate" data-tab="0" id="result_a">
6 is 30% of 20
</p>
<p class="table-cell table-cell--only tab animate" data-tab="1" id="result_b">
15% of 200 = 30
</p>
<p class="table-cell table-cell--only tab animate" data-tab="2" id="result_c">
3500 increase 22% = 4270 <br>
9700 decrease 35% = 6305
</p>
<p class="table-cell table-cell--only tab animate" data-tab="3" id="result_d">
Difference of 1 and 3 is 100%, <br>
and 3 is a 200% increase of 1
</p>
</div>
</span>
</div>
</div>
<script async src="./assets/js/lib/math.min.js"></script>
<script defer src="./assets/js/functions.js"></script>
</body>
</html>