Skip to content

Challenge is to build out this body mass index calculator page and get it looking as close to the design as possible

License

Notifications You must be signed in to change notification settings

srijanss/bmi-calculator

Repository files navigation

Frontend Mentor - Body Mass Index Calculator solution

This is a solution to the Body Mass Index Calculator challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

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

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • Vite - Lightweight frontend tooling
  • PostCSS - Tool to transform CSS using plugins

What I learned

  • I learned about the css to hide the spin button of input type number in different browsers
& input[type="number"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;

  &::-webkit-inner-spin-button,
  &::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
}

-- I also learned how to apply different border radius to the div element. This was the result of many hit and trials

& #bmi-calculator-info {
  --circle-radius: 150px;
  border-radius: 16px var(--circle-radius) var(--circle-radius) 16px;
}
  • I also learned about how to apply multiple linear gradients to create the background effect like the design
@define-mixin bmi-app-gradient {
  background-image: linear-gradient(
    to left top,
    #d6e6fe 0%,
    #d6fcfe50 50%,
    #d6fcfe00 100%
  );
}
#curved-background {
  width: 100%;
  height: 640px;
  position: absolute;
  top: 0;
  left: 0;
  @mixin bmi-app-gradient;
  border-radius: 0 0 35px 35px;
  background-color: var(--color-white);
  z-index: -1;
}

Useful resources

Author

About

Challenge is to build out this body mass index calculator page and get it looking as close to the design as possible

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published