Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

My solution to the Tip Calculator App

wannacode•760
@kwngptrl
A solution to the Tip calculator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


The HTML and CSS for this was done in two days, but the JS tied me down. Also, I was confused why there was no 'submit' button for this since this was a form. Anyway, calculator apps also behave like this, so...

Recognized a previous challenge can be included here and that was the Interactive Rating Component. It would be used where the user would select the tip in percent, but what about 'custom'? I thought about it and ended up using six radiobuttons with the last tied to an input field as 'custom'. I utilized event delegation to avoid assigning too many event listeners. A lot of tiny little things had to be tracked in order for keyboard navigation to behave in a standard manner.

Have a look see. If anyone can look at my JS and offer general tips for improvement I'd be grateful.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on wannacode's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License