-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
296 lines (264 loc) · 17.3 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>Body Fat 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 free body fat calculator uses the US Navy and BMI methods to approximate body fat percentage. It provides weight loss information to help you achieve your ideal body fat.">
<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">
<input type="hidden" value="male" id="gender"/>
<p class="input__title">Gender</p>
<button class="button-switcher button-switcher--active" type="button" onclick="switcher(this, 'gender', '')" value="male" id="gender-a">
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path stroke='#9CA3AF' d="M8.875 17.5C11.9816 17.5 14.5 14.9816 14.5 11.875C14.5 8.7684 11.9816 6.25 8.875 6.25C5.7684 6.25 3.25 8.7684 3.25 11.875C3.25 14.9816 5.7684 17.5 8.875 17.5Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
<path stroke='#9CA3AF' d="M12.8516 7.89844L17.625 3.125" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
<path stroke='#9CA3AF' d="M13.875 3.125H17.625V6.875" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
<span class="button-switcher__text button-switcher__text--active">Male</span>
</button>
</label>
<label class="input col">
<p class="input__title"></p>
<button class="button-switcher" type="button" onclick="switcher(this, 'gender', '')" value="female" id="gender-b">
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path stroke='#9CA3AF' d="M10.75 13.125C13.8566 13.125 16.375 10.6066 16.375 7.5C16.375 4.3934 13.8566 1.875 10.75 1.875C7.6434 1.875 5.125 4.3934 5.125 7.5C5.125 10.6066 7.6434 13.125 10.75 13.125Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
<path stroke='#9CA3AF' d="M10.75 13.125V18.75" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
<path stroke='#9CA3AF' d="M7.625 16.25H13.875" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
<span class="button-switcher__text">Female</span>
</button>
</label>
</div>
<div class="input-wrapper row">
<label class="input col bmi-calculator,calorie-calculator,bmr-calculator,ideal-weight-calculator,tdee-calculator,macro-calculator,body-type-calculator,calories-burned-calculator,protein-calculator,army-body-fat-calculator,pregnancy-weight-gain-calculator ">
<p class="input__title">Age</p>
<div class="input-field row">
<input type="text" class="input-field__input" placeholder="" id="age" value="30" />
<span class="input-field__hint">years</span>
</div>
</label> </div>
<div class="input-wrapper row">
<label class="input col">
<p class="input__title">Height</p>
<div class="input-field input-field--height row">
<input type="text" class="input-field__input imperial-system-item" id="height_ft" data-target="height" value="5" onchange="updateHeight(this)" />
<span class="input-field__hint imperial-system-item">ft</span>
<input type="text" class="input-field__input imperial-system-item" id="height_in" data-target="height" value="11.65" onchange="updateHeight(this)" />
<span class="input-field__hint imperial-system-item">in</span>
<input type="text" class="input-field__input metric-system-item system-item-hidden" id="height" data-target="height" value="182" onchange="updateHeight(this)" />
<span class="input-field__hint metric-system-item">cm</span>
</div>
</label>
<label class="input col ">
<p class="input__title">Weight</p>
<div class="input-field row">
<input type="text" class="input-field__input imperial-system-item" id="weight_imperial" data-target="weight" data-formula="value * 2.20462262185" value="176.4" onchange="sysnumconv(this)" />
<span class="input-field__hint imperial-system-item">pounds</span>
<input type="text" class="input-field__input metric-system-item system-item-hidden" id="weight" data-target="weight" data-formula="value / 2.20462262185" value="80" onchange="sysnumconv(this)" />
<span class="input-field__hint metric-system-item system-item-hidden">kg</span>
</div>
</label>
</div>
<div class="input-wrapper row">
<label class="input col">
<input type="hidden" value="bmi" id="method"/>
<p class="input__title">Method</p>
<button class="button-switcher button-switcher--active" type="button" onclick="switcher(this, 'method', '')" value="bmi" id="method-a">
<span class="button-switcher__text button-switcher__text--active">BMI</span>
</button>
</label>
<label class="input col">
<p class="input__title"></p>
<button class="button-switcher" type="button" onclick="switcher(this, 'method', '')" value="navy" id="method-b">
<span class="button-switcher__text">US Navy</span>
</button>
</label>
</div>
<span class="method related-item-hidden related-to-method-navy">
<div class="input-wrapper row">
<label class="input col ">
<p class="input__title">Neck</p>
<div class="input-field row">
<input type="text" class="input-field__input imperial-system-item" id="neck_imperial" data-target="neck" data-formula="value * 0.393701" value="19.29" onchange="sysnumconv(this)" />
<span class="input-field__hint imperial-system-item">inches</span>
<input type="text" class="input-field__input metric-system-item system-item-hidden" id="neck" data-target="neck" data-formula="value / 0.393701" value="49" onchange="sysnumconv(this)" />
<span class="input-field__hint metric-system-item system-item-hidden">cm</span>
</div>
</label>
<label class="input col ">
<p class="input__title">Waist</p>
<div class="input-field row">
<input type="text" class="input-field__input imperial-system-item" id="waist_imperial" data-target="waist" data-formula="value * 0.393701" value="37.40" onchange="sysnumconv(this)" />
<span class="input-field__hint imperial-system-item">inches</span>
<input type="text" class="input-field__input metric-system-item system-item-hidden" id="waist" data-target="waist" data-formula="value / 0.393701" value="95" onchange="sysnumconv(this)" />
<span class="input-field__hint metric-system-item system-item-hidden">cm</span>
</div>
</label>
</div>
</span>
<span class="method related-item-hidden related-to-method-navy">
<div class="input-wrapper row gender related-item-hidden related-to-gender-female" >
<label class="input col ">
<p class="input__title">Hip</p>
<div class="input-field row">
<input type="text" class="input-field__input imperial-system-item" id="hip_imperial" data-target="hip" data-formula="value * 0.393701" value="37.40" onchange="sysnumconv(this)" />
<span class="input-field__hint imperial-system-item">inches</span>
<input type="text" class="input-field__input metric-system-item system-item-hidden" id="hip" data-target="hip" data-formula="value / 0.393701" value="95" onchange="sysnumconv(this)" />
<span class="input-field__hint metric-system-item system-item-hidden">cm</span>
</div>
</label>
</div>
</span>
</div>
<div class="calculator-content calculator-content--gray calculator-content--footer calculator-content--small row " >
<button class="system-switcher" onclick="toggleSystem(this)" aria-label="Switch System">
<div class="system-switcher__circle"></div>
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.5 9.5H10C9.44772 9.5 9 9.05228 9 8.5V2.5M4.5 2.5H3.5C2.94772 2.5 2.5 2.94772 2.5 3.5L2.5 9.5M7.5 4.5L10.5 4.5M1.5 5.5L4.5 5.5" stroke="white" stroke-width="2" stroke-linecap="round"></path>
</svg>
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 3.5L2 8.5M2 8L2 5.5C2 4.39543 2.89543 3.5 4 3.5C5.10457 3.5 6 4.39543 6 5.5M6 5.5L6 8.5M6 5.5L6 8M6 5.5C6 4.39543 6.89543 3.5 8 3.5C9.10457 3.5 10 4.39543 10 5.5V8.5" stroke="white" stroke-width="2" stroke-linecap="round"></path>
</svg>
</button>
<script type="text/javascript">
$$(".imperial-system-item, .metric-system-item").forEach(function(element, index){
element.classList.remove("system-item-hidden");
});
$$((defaultSystem == "metric") ? ".imperial-system-item" : ".metric-system-item").forEach(function(element, index){
element.classList.add("system-item-hidden");
});
if(defaultSystem == "metric") $('.system-switcher').classList.add('system-switcher--active');
</script>
<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"><style>
.table-progress-list--fat {
max-width: 100%;
}
.table-progress-list__item {
position: relative;
}
@media (min-width: 768px) {
.table-progress-list--fat .essential {
left: 40px;
}
.table-progress-list--fat .athletes {
left: 40px;
}
.table-progress-list--fat .fitness {
left: 20px;
}
.table-progress-list--fat .average {
}
.table-progress-list--fat .obese {
right: 36px;
}
.table-progress-list--fat[data-gender=female] .essential {
left: 40px;
}
.table-progress-list--fat[data-gender=female] .athletes {
left: 33px;
}
.table-progress-list--fat[data-gender=female] .fitness {
left: 2px;
}
.table-progress-list--fat[data-gender=female] .average {
right: 30px;
}
.table-progress-list--fat[data-gender=female] .obese {
right: 42px;
}
}
</style>
<div class="calculator-result col">
<p class="table-cell table-cell--dark table-cell--only-title">Body Fat</p>
<div class="table-cell table-cell--big table-cell--age table-cell--only row">
<div class="table-progress-list table-progress-list--fat" data-gender="male">
<p class="table-progress-list__item essential">Essential Fat</p>
<p class="table-progress-list__item athletes">Athletes</p>
<p class="table-progress-list__item fitness">Fitness</p>
<p class="table-progress-list__item average">Average</p>
<p class="table-progress-list__item obese">Obese</p>
</div>
<div class="table-progress table-progress--fat" style="background: linear-gradient(90deg, #ff8686 0, #ffdd84 7%, #ffdd84 19%, #9cff84 21%, #9cff84 47%, #87b958 49%, #87b958 61%, #ffdd86 63%, #ffdd86 85%, #ff8585 87.5%, #ff8585 100%);">
<div class="table-progress__indicator" style="left: 68.887%;"></div>
</div>
</div>
<div class="result-table__wrapper">
<table class="result-table">
<thead class="result-table__head">
<tr class="result-table__row">
<td class="result-table__cell result-table__cell--header result-table__cell--semibold">Body Fat Percentage</td>
<td class="result-table__cell result-table__cell--semibold animate" id="bf">19.7%</td>
</tr>
</thead>
<tbody class="result-table__body animate">
<tr class="result-table__row">
<td class="result-table__cell result-table__cell--header">Body Fat Category</td>
<td class="result-table__cell" id="bf-category">Average</td>
</tr>
<tr class="result-table__row">
<td class="result-table__cell result-table__cell--header">Body Fat Mass</td>
<td class="result-table__cell" id="bf-mass">34.7 lbs</td>
</tr>
<tr class="result-table__row">
<td class="result-table__cell result-table__cell--header">Lean Body Mass</td>
<td class="result-table__cell" id="lb-mass">99.8 lbs</td>
</tr>
<tr class="result-table__row">
<td class="result-table__cell result-table__cell--header">Ideal Body Fat for Given Age</td>
<td class="result-table__cell" id="bf-ideal">12.7%</td>
</tr>
<tr class="result-table__row">
<td class="result-table__cell result-table__cell--header">Body Fat to Lose to Reach Ideal</td>
<td class="result-table__cell" id="bf-to-lose">12.3 lbs</td>
</tr>
</tbody>
</table>
</div>
</div>
</span>
</div>
</div>
<script async src="./assets/js/lib/math.min.js"></script>
<script defer src="./assets/js/functions.js"></script>
</body>
</html>