Skip to content

Commit

Permalink
update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
artbindu committed May 12, 2024
1 parent 4a777b6 commit 8544066
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions converter.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h4 style="padding-bottom: 25px;">Billion, Million, Trillion Converter</h4>
</div>
</div>
<div class="card-body converter">
<h4 style="padding-bottom: 25px;">BMI Calculator</h4>
<h4 style="padding-bottom: 25px;"><a href="calculator.net/bmi-calculator.html">BMI Calculator</a></h4>
<div>
<form class="form-inline" action="">
<div>
Expand Down Expand Up @@ -79,7 +79,8 @@ <h4 style="padding-bottom: 25px;">BMI Calculator</h4>
<input type="number" id="bmiOutputValue01" value="0.00" placeholder="Indian Format" name="bmiOutputValue01">
<select name="bmiOutputType01" id="bmiOutputType01" disabled>
<!-- Adult BMI Class & SubClass -->
<option value="Underweight-Severe Thinness" selected>Underweight (Adult - Severe Thinness)</option>
<option value="" selected>Check Your BMI</option>
<option value="Underweight-Severe Thinness">Underweight (Adult - Severe Thinness)</option>
<option value="Underweight-Moderate Thinness">Underweight (Adult - Moderate Thinness)</option>
<option value="Underweight-Mild Thinness">Underweight (Adult - Mild Thinness)</option>

Expand Down
3 changes: 2 additions & 1 deletion src/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function onBMIConvert(key = 'bmi_config') {
inputVal.height.val = _inputHeight?.map((x, i) => i === 0 ? Number(x) : (Number(x) / 12))?.reduce((acc, ele) => acc + ele, 0);
console.log(`Filter Input Height: ${_inputHeight} ${inputVal.height.type} \n Formatted Height: ${inputVal.height.val} ${inputVal.height.type}`);

if(!inputVal.age.val) inputVal.age.val = 20.01; // default age is adult (> 20)
if (inputVal.weight.val > 0 && inputVal.height.val > 0 && inputVal.age.val > 0) {
let _isChild = jsonData.age[Object.keys(jsonData.age)?.map(x => x.split(/\s+\-\s+/g))
?.filter(x => Number(inputVal.age.val) >= x[0] && Number(inputVal.age.val) <= x[1])[0].join(' - ')];
Expand Down Expand Up @@ -153,7 +154,7 @@ function onBMIConvert(key = 'bmi_config') {
document.getElementById('bmiInputValue02').value = '',
document.getElementById('bmiInputType02').selectedIndex = 0;

document.getElementById('bmiOutputValue01').value = 0.00;
document.getElementById('bmiOutputValue01').value = "0.00";
document.getElementById('bmiOutputType01').selectedIndex = 0;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ mark {
margin: 10px;
text-align: center;
}
p.uppercase {
text-transform: uppercase;
}

0 comments on commit 8544066

Please sign in to comment.