Responsive Tip Calculator using Grid and Flexbox and js module
Design comparison
Solution retrospective
I'm pretty happy with the auto-calculation that occurs once all required fields have valid data. I think the validation process could probably be better, but this works pretty well for what's needed here. I contemplated clearing out the custom tip percentage when another option was selected, but opted to leave it alone.
What challenges did you encounter, and how did you overcome them?The only real challenge I encountered here was disabling the reset
button when pressed. I eventually just gave up and let it always be enabled, which is probably better UX anyways.
Otherwise, no real challenges, just digging more into a couple JS events, and slowly finding a better flow for naming things and organizing the JS. I don't think this is perfect, but I think it's better than what I've done previously, at least.
What specific areas of your project would you like help with?Any feedback is greatly appreciated.
Community feedback
- @alvarozamaPosted 5 months ago
This looks pretty good all around. Only thing I'd add is some way of also setting the "total / person" and "tip / person" to $0.00 whenever the reset button is clicked, so that the whole thing resets to default state. This should be easily done through some innerText or innerHTML stuff. Other than that, you did a great work. So much so that I think I'll be looking into your code to see how I can improve mine. Keep it up!
1@nullpuppyPosted 5 months ago@alvarozama Oooh, good catch! I meant to do that, but then obviously forgot. Fixed!
0
Please log in to post a comment
Log in with GitHubJoin 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