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

CSS Grid, Flex Box, JavaScript

Daniel 100

@Daniellios

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


Couldn't make buttons stay different color when pressing the other ones. In terms of calculation, you have to re-enter the percent value or re-click the percent button whenever you change the bill or number of people.

Any help on how to do it would be appreciated!

Community feedback

HYDROCODER 555

@HYDROCODER

Posted

Hey there! Your solution works and it looks good.

For your button problem, I would suggest that you use radio buttons instead; radio buttons have a :checked pseudo selector which can be used to make the buttons have a different color when pressed and stay with it unless you press some other tip percent. In short, it would be better to scrap the buttons in the "percentages" div and use <input type ="radio"> form inputs instead. Although styling them is another issue to take care of, using radio buttons is more semantic and gets the job done.

You can put some background color (grey) on your input fields (number of people, custom and bill).

You can disable your reset button once you click it and use it as default state for that button, using disabled property in your js code (document.querySelector('reset__button').disabled=true) and put a styling in your css for the disabled button using :disabled selector.

You have used a transition of .7s in your container. When zooming in or out of the viewport, it is taking it slow. You may remove it if you wish to since it has no purpose. In case you are using it for hover effects, just use the same transition in button: hover itself instead of applying it to all elements.

Hope this helps :).

Marked as helpful

0

Daniel 100

@Daniellios

Posted

@HYDROCODER Thank you very much, I will try to re-do some things as you said.

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