Submitted almost 2 years ago
Tip Calculator App (Mobile first, SCSS, vanilla JS)
@abhijithmuthyala
Design comparison
SolutionDesign
Solution retrospective
I tried to implement these features / practices in the app:
- Use appropriate aria tags for accessibility.
- Debounce all the input fields' event handlers.
- Use Event delegation pattern for the tip percentage button events.
- Display error message (and also alert AT users) if the validation for an input field fails.
- Focus the first input element of the form when the reset button is used, for better accessibility.
- Data/State driven approach, i.e, state variables (captured in closures) are the single source of truth for the application's view layer.
- Follow POLE (Principle Of Least Exposure) using closures and the Classic Module Pattern.
Implementing all these was quite a challenge. Any feedback, code organisation in particular, is much appreciated. I'm also interested to know if there's any solution to this challenge that uses the class based approach. Thanks!
Community feedback
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