BMI Calculator is simple aplication to calculate Your BMI index. It's my first project which I will prepare for train my skills in basic html, scss and Vanilla JS. This project was prepared without any framework. For styling I used pure scss styling. Structure of the project is very simple: index.html file with HTML code, style.scss file with styles and script.js file with all js code.
https://webster2020.github.io/BMI_CALCULATOR/
- git clone git@github.com:Webster2020/BMI_CALCULATOR.git
- npm install
- npm run watch - run the project and than You can see it on Your device
*...or use link if You only want to check how it works
Used technologies:
- Vanilla js without any framework with ES6+ standard
- Scss for styling
- HTML5 for content
Implemented solutions
- Content of aplication is putted in one container
- Styles are divided into several parts:
- global
- description
- inputs
- buttons
- output
- proposal
- @media
- JS code is divided to several functions and constants
- BMI Button functionality:
- calculate BMI index
- change color after calculation
- change proposal text
- shadow efect with mouse events
- set position of pointer on diagram
- set proposal text
- Inputs functionality:
- change color of BMI button dynamically with changing value of input
- change proposal text dynamically with changing value of input
- set dynamically position of pointer on diagram
- Reset Button functionality:
- shadow efect with mouse events
- clear inputs
- clear color of BMI Button
- reset diagram to default position
- reset proposal text to default value
Project is not diveded on component (like in e.g. React), because of its size structure is very simple:
- html - content of aplication
- scss - all styles
- js - all functions and all logic for aplication
- root file: index.html
- configuration files: gitignore, package.json etc.
Project was prepared based on my own idea.
- Handling the situation when user input incorrect value of weight or height (e.g.: value belowe 0 or not a number)...
- Refactoring code
- Michal Szwajgier - Webster2020 -
Free licence