This is a solution to the Body Mass Index Calculator. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- Select whether they want to use metric or imperial units
- Enter their height and weight
- See their BMI result, with their weight classification and healthy weight range
- View the optimal layout for the interface depending on their device's screen size
- See hover and focus states for all interactive elements on the page
Desktop View Imperial.
- Solution URL: BMI-Calculator
- GitHub Repo: Link to the GitHub Repo
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- jQuery - JS library
- TypeScript - JS Compiler
Use this section to recap over some of your major learnings while working through this project. Writing these out and providing code samples of areas you want to highlight is a great way to reinforce your own knowledge.
To see how you can add code snippets, see below:
<h1>Some HTML code I'm proud of</h1>
<input type="number" class="height-input-value ft-value" placeholder="0" min="0" required/>/* Ways to remove the arrows in an input field*/
/* For WebKit-based browsers */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* For Mozilla Firefox */
input[type="number"]::-moz-number-spin-box {
-moz-appearance: textfield;
}const updateBMI = () => {
console.log('...🎉')
}
const updateBMI = () => {
//Calculate THE BMI in kg and cm
const heightInCm: number = parseFloat(inputHeight.val() as string);
const weightInKg: number = parseFloat(inputWeight.val() as string);
if (isNaN(heightInCm) || isNaN(weightInKg)) {
welcomeBlock.show();
resultBlock.hide();
return;
}- jQuery - This helped me with the transition. I really liked how I was switching betweeen Metric and Imperial easily.
- The TypeScript Handbook - This is an amazing article which helped me finally understand TypeScript. I'd recommend it to anyone still learning this concept. A reader who completes the walkthrough should be able to:
- Read and understand commonly-used TypeScript syntax and patterns
- Explain the effects of important compiler options
- Correctly predict type system behavior in most cases
- Name - Fidelis Takyi Mensah
- Twitter - @fidelistakyi
- LinkedIn - @fidelistakyi



