Design comparison
Solution retrospective
Hello, this is my next project. The javascript is really messy as I'm not certain about what I'm doing. I added the activeGiver function so it both removes and adds active, as it didn't seem to work without the function. But with the function it requires 2 clicks to work, so if anyone has any tips on that or any other thing on the js code that'd be nice. As for the css bits, I think it was fairly easy but if anyone has any tips on that as well it would be appreciated.
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, great work on this one. Layout in desktop is bit smaller and not centered right now but it's fine I guess. It is responsive though the mobile layout could make the buttons to occupy more width since right now, they are small.
Also, I didn't get the bug like what you said with using 2 clicks, everything seems working fine, but there is an error in the console, you might want to fix that since if you open up dev tools, then refresh the page, you won't get it to reload since the debugger will fire because of the bug.
Some other suggestions on the site would be:
- Do not directly type the wordings as uppercase on the markup, if you do this, screen-reader will read the text letter-by-letter and not by the wordings. Use only the lowercase version to write in the markup and instead use
text-transform: uppercase
on it. - Also you don't need
br
on theh1
tag, you just need to first use aword-break: break-all
property on it, then usemargin: 0 auto
to center it and finally use amax-width
on it, adjust until you get the desired look. But remember to remove thebr
. - Each text above the
input
should be thelabel
for theinput
itself and not a heading tag. - Those decorative images on the site could have use an extra
aria-hidden="true"
attribute so that they will be totally hidden alongside with thealt=""
- Also on the
input
don't add a defaultvalue
attribute, those are supposedplaceholders
and notvalue
. By usingvalue
users will be confused on why there is already a value added. - Since you are using
button
on this, it would be really great to add aaria-live
element that will announce a certainbutton
has been selected. Sincebutton
itself is not informative enough you will need this to further inform a user the selection. You might want to search foraria-live
if you were to implement this. - Make the visual indicator for the
button
more visible. Right now, usingtab
key on those, it is hard to tell where I am at right now so better tweaking the:focus-visible
state of thebutton
. - The custom-input needs to have an associated screen-reader
label
to it or anaria-label
. The value for whatever method you pick will describe what does theinput
needs. - Adding a
cursor: pointer
to the desktop version for eachbutton
just to make it more natural. - Try to limit the output value for decimal place so that the text won't overlap the container if the result value has many decimal digits.
- Lastly, another idea is to have a
aria-live
element that announces the calculator has reset if the reset-button has been pressed.
Aside from those, great job on this again.
Marked as helpful1@CoderPr0Posted about 3 years ago@pikamart Thx allot for all the tips, it's of great help. I will look into all of this and make fixes.
1 - Do not directly type the wordings as uppercase on the markup, if you do this, screen-reader will read the text letter-by-letter and not by the wordings. Use only the lowercase version to write in the markup and instead use
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