Skip to content

Gusjafo/calculator-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Tip calculator app solution

This is a solution to the Tip calculator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Overview

The challenge

Users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Calculate the correct tip and total cost of the bill per person

Screenshot

image

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Bootstrap CSS framework

What I learned

I had two great difficulties to carry out this project.

  • The first was the positioning with Bootstrap since I had problems in positioning the two columns.

  • The second and unexpected difficulty was entering the point in the mobile device. The solution that I implemented was to set as a point any value that is different from a number.

function onlyNumberKeyDot(evt) {
  if (evt >= 0 && evt <= 9) {
    let inputBillPut = document.querySelector("#inputBillText").value;
    console.log(inputBillPut);
    let keyPush = evt;
    console.log(evt);
    bill = bill + keyPush;
    document.querySelector("#inputBillText").value = inputBillPut;    
    return false;
  } else
    if (evt == "Unidentified" || evt == ".") {
      bill = bill + ".";
      return false;
    } else return false;
}

This function runs when a value is entered. If it is a "." or "Identified", a "." to the final value is added.

Author

Have fun building! 🚀

About

Calculate the correct tip and total cost of the bill per person

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published