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.
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
- Solution URL: Frontend Mentor Solution
- Live Site URL: GitHub Pages Live Site
- Semantic HTML5 markup
- CSS
- Mobile-first workflow
- Vanilla JavaScript
Using addEventListener
is the key to this project. I was stumbling around and was trying to find ways to register the inputs. That is entirely what the index.js
file is composed of.
I'm fairly proud that I was able to complete this using pure JavaScript. Most solutions to problems I came across recommended jQuery, but I wanted to stick to JavaScript only.
Hoping to develop more websites with less hacky methods. My main struggle was getting the dimensions and layout right. My solution felt inadequate as I hardcoded pixels in to get it right on my screen. I felt satisfied with how it looks, but in the future I plan to use more methods that aren't absolute in the pixel placements.
- GitHub - Brandon Nhem
- Frontend Mentor - @brandonnhem