Tip Calculator with javascript

Solution retrospective
I think my JavaScript code should be more reusable
Please log in to post a comment
Log in with GitHubCommunity feedback
- @JepardMay
Hi! Nice work with this project. Found some things that can be fixed:
-
The page doesn't look good before mobile breakpoint https://gyazo.com/b1842ccec3bd06218dd196ae0c5066e9. Maybe it's worth changing the breakpoint earlier. Also, an icon in the second input goes wild.
-
When you choose custom input whole section hops because of the border. An easy solution is to set the border by default, make it transparent, and change border-color on hover and focus.
-
In the JS file I see that you use the same code twice. Try to create a function, that contains that code, and use it when you need it. All lines of actions that can be used more than one (even only in theory) are worth putting in separate functions as an option.
Marked as helpful -
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