Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Fully Responsive Tip Calculator App

Amit Kumar 100

@amit-kumar-18

Desktop design screenshot for the Tip calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


What is the best/better practice for responsive layout @media-query / bootstrap or other CSS frameworks?

Community feedback

@ObaidAshraf

Posted

Great work. I can see that RESET bug is also fixed. But, I just found another bug in the code which also seems a minor glitch and can be fixed easily.

If I add Bill as "10" and Number of People as "1", now if I add lets say 10 in "Custom" box, it works fine like it is intended to. Now, if I write "100" it still works fine, The problem arises when I keep increasing number of zeros. Lets say, I added 10,000 or even 100,000. At this point, UI starts to show incorrect data and behavior.

0

Amit Kumar 100

@amit-kumar-18

Posted

@ObaidAshraf updated the code, just restricted the custom percentage up to 100%

0

@ObaidAshraf

Posted

Great .. You have fixed the points I mentioned. however I found another bug in it :) ..

  1. On RESET, the textboxes do show 0 value and it looks like everything is reset (or back to zero) but if I press any of the tips percentage box, it shows results according to last inserted value.. I think internal variables are not zero ..

  2. If I refresh the page and press any of the Tip percentage boxes, it shows NaN in Tip/person box which I think should always show zero if there is no input ..

0

Amit Kumar 100

@amit-kumar-18

Posted

@ObaidAshraf Once again thank you for taking the time to check my work I really appreciate it, Updated the solution please check it out and let me know if something comes up.

Thanks.

0

@ObaidAshraf

Posted

  1. The UI is very good and almost matches with the desired design. However, there is one issue which I observed that for a Bill value of 12, number of people 5 and Tip % as 5%, 10% or 50%, the corresponding "Tip Amount" and "Total" shows a value which contains multiple numbers after decimal places and the text goes out of the Calculator window which does not produce good result. I would suggest to round the value upto like 3 or 4 decimal places.

  2. Instead of reloading the whole page on pressing "RESET" button, I would suggest to just zero out all values and variables.

  3. Bootstrap is a good choice for beginners and provides a number of classes to make design responsive. You can also give a try to tailwindcss.

0

Amit Kumar 100

@amit-kumar-18

Posted

@ObaidAshraf appreciate your feedback. I have updated my solution with all the points in mind please check it out.

Thanks.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord