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.

Table of contents

Note: Delete this note and update the table of contents based on what sections you keep.

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

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • JavaScript

What I learned

Since I personally lack experience in working with forms more often, this challenge helped me a lot in getting the hang of them more. In particular with using them in JavaScript. I had some other personal projects I made before that involved checkboxes, but it had been a while since then, and this challenge was a good way to get back into it.

Continued development

I had some issues with calculating the tip, which is ironic because I thought that would have been the easy part. The issue was that I kept misunderstanding how numbers and floats were cast in JavaScript, and I made a lot of my if-statements too complicated. I ended up with a bit of a simpler solution, however this made me miss working with TypeScript more.