Frontend Mentor - Body Mass Index Calculator
Welcome! ?
Thanks for purchasing this premium Frontend Mentor coding challenge.
Frontend Mentor challenges help you improve your coding skills by building realistic projects. These premium challenges are perfect portfolio pieces, so please feel free to use what you create in your portfolio to show others.
To do this challenge, you need a strong understanding of HTML, CSS, and JavaScript.
The Challenge
Your challenge is to build out this body mass index calculator page and get it looking as close to the design as possible.
You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go.
Your users should be able to:
1. Input their height and weight.
2. Calculate their BMI based on the values they input.
3. See their BMI result displayed in the results component.
4. See their weight classification displayed in the results component.
5. See their healthy weight range displayed in the results component.
Want some support on the challenge? Join our community and ask questions in the #help channel.
Expected Behaviour
Below you will find the BMI ranges and their weight classifications. Based on the person's BMI results, add their weight classification to the sentence "Your BMI suggests you’re" within the results component.
| BMI Range | Weight Classification |
| ------------------ | --------------------- |
| Less than 18.5 | Underweight |
| 18.5 to 24.9 | Healthy Weight |
| 25 to 29.9 | Overweight |
| 30 or greater | Obese |
Add the individual's healthy weight range based on the lower and upper BMI categorisations and the person's height.
Where to Find Everything
Your task is to build out the project to the design file provided. We provide both Sketch and Figma versions of the design, so you can choose which tool you prefer to use. You can download the design file on the platform. Please be sure not to share them with anyone else. The design download comes with a README.md file as well to help you get set up.
All the required assets for this project are in the /assets folder. The images are already exported for the correct screen size and optimized. Some are reusable at multiple screen sizes. So if you don't see an image in a specific folder, it will typically be in another folder for that page.
We also include variable and static font files for the required fonts for this project. You can choose to either link to Google Fonts or use the local font files to host the fonts yourself. Note that we've removed the static font files for the font weights that aren't needed for this project.
The design system in the design file will give you more information about the various colors, fonts, and styles used in this project. Our fonts always come from Google Fonts.
Building Your Project
Feel free to use any workflow that you feel comfortable with. Below is a suggested process, but do not feel like you need to follow these steps:
1. Set up your project: Create a new folder for your project and initialize it with Git.
2. Add the HTML, CSS, and JavaScript files: Create the necessary files for your project.
3. Build the HTML structure: Use the design file as a reference to build out the basic structure of your project.
4. Style the HTML with CSS: Use the design file to style the elements of your project.
5. Add functionality with JavaScript: Use JavaScript to handle user input and calculations.
6. Test your project: Use your browser's developer tools to test the functionality of your project.
7. Deploy your project: Host your project on a free hosting platform.
Deploying Your Project
As mentioned above, there are many ways to host your project for free. Our recommended hosts are:
GitHub Pages
Netlify
Vercel
You can host your site using one of these solutions or any of our other trusted providers. Read more about our recommended and trusted hosts.
Create a Custom README.md
We strongly recommend overwriting this README.md with a custom one. We've provided a template inside the README-template.md file in this starter code.
The template provides a guide for what to add. A custom README will help you explain your project and reflect on your learnings. Please feel free to edit our template as much as you like.
Once you've added your information to the template, delete this file and rename the README-template.md file to README.md. That will make it show up as your repository's README file.
Submitting Your Solution
Submit your solution on the platform for the rest of the community to see. Follow our "Complete guide to submitting solutions" for tips on how to do this.
Remember, if you're looking for feedback on your solution, be sure to ask questions when submitting it. The more specific and detailed you are with your questions, the higher the chance you'll get valuable feedback from the community.
⚠️ IMPORTANT ⚠️: With these premium challenges, please be sure not to upload the design files to GitHub when you're submitting to the platform and sharing it around. If you've created a brand new project, the easiest way to do that is to copy across the .gitignore provided in this starter project.
Sharing Your Solution
There are multiple places you can share your solution:
Frontend Mentor: Share your solution on the platform for the rest of the community to see.
GitHub: Share your solution on GitHub.
Twitter: Share your solution on Twitter.
We provide templates to help you share your solution once you've submitted it on the platform. Please do edit them and include specific questions when you're looking for feedback.
The more specific you are with your questions the more likely it is that another member of the community will give you feedback.
Got Feedback for Us?
We love receiving feedback! We're always looking to improve our challenges and our platform. So if you have anything you'd like to mention, please email hi[at]frontendmentor[dot]io.
Have fun building! ✨