Design comparison
SolutionDesign
Solution retrospective
Some codes were repetitive, if anyone can advise me I appreciate it!
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, great work on this one. Layout in desktop seems fine as well for mobile layout. The functionality works but I don't know why I couldn't select the percentages, I could select them but only after adding the
bill
and the #ofpeople
.Some suggestions would be:
- On the
body
tag, usingheight: 100vh
is not great since it will limit the elementsheight
based on the remaining viewport's height. Replacing it withmin-height: 100vh
is much better, because this will expand if it needs to. - Remove the
width: 100vw
on thebody
as well since this creates a horizontal scrollbar which you can see.block
elements likebody
have a default of taking the 100% of the screen's width, so you don't need to specify it. - The
alt
value of theimg
inside theheader
could only usedalt="spliter"
only. Avoid adding words that relates to "graphic" like "image, icon, illustration" on thealt
attribute. - On your
h1
I see that you are making the text be for screen-reader only, but right now it is not being used that way. Usingdisplay: none
only just completely remove it in the dom, you can search for sr-only class on google and apply those :> - The visual indicator for the
button
could have been better, right now it is hard to know where I am at when using my keyboard. Maybe applying moreoutline-offset
would be better. - On the tip percentage, I would not use
button
for those, instead if I were to tackle this, I would use afieldset
and radio buttons, since those are selections and I can select only 1, and radio buttons are intended for those. - It would be great to have a
aria-live
element, the live element will say whatbutton
has the user pressed, because using justbutton
there is no indication that is has been selected, that is why creating aaria-live
element would be really great. - I would as well wrap the
tip amount
andtotal
in a heading tag, the reason is that, if I navigate through that heading, I will know that the next element could either be thetip amount value
or thetotal value
. - For the reset functionality, it would be great as well to have an
aria-live
element, announcing that the calculator has reset its value.
Other than those, great work on this one. I haven't checked your js but i'm leaving the refactoring to you :>
Marked as helpful0 - On the
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