Design comparison
Solution retrospective
Hi,
I used absolute distances and sizes in the solution. Instead of a form and radio buttons, I made a simple list, which I then designed. Not the cleanest solution, but with the form I had problems with the design of the radio buttons.
Any help how to properly desin radio buttons when they are selected will be very helpful to me.
Thank you
Community feedback
- @VCaramesPosted almost 2 years ago
Hey there! 👋 Here are some suggestions to help improve your code:
- The “icons/illustrations” in this component serve no other purpose than to be decorative; They add no value. There
alt tag
should be left blank and have anaria-hidden=“true”
to hide them from assistive technology.
More Info:📚
https://www.w3.org/WAI/tutorials/images/
- The proper way to build the "rating buttons" in this challenge is to create a
form
and inside of it, there should be fiveinput radios
and eachinput
should have alabel
attached to it to make the buttons accessible. Finally wrap all theinputs
andlabels
inside afieldset
to prevent users from making more than one selection.
More Info:📚
MDN <fieldset>: The Field Set element
If you have any questions or need further clarification, feel free to reach out to me.
Happy Coding!🎄🎁
Marked as helpful0 - The “icons/illustrations” in this component serve no other purpose than to be decorative; They add no value. There
- @AdrianoEscarabotePosted almost 2 years ago
Hello Franci Melink, how are you? Welcome to the community of front-end mentors! I truly loved your project's outcome, however I have some advice that I hope you'll find useful:
To make the submit button work only when the user selects a number, we can do this:
for (let index = 0; index < ratingRates.length; index++) { ratingRates[index].addEventListener('click', function () { selectedRateIndex = index + 1; for (const rate of ratingRates) { rate.classList.remove('active'); } this.classList.add('active'); submitButton.addEventListener('click', function () { ratingSec.style.display = 'none'; thankSection.style.display = 'flex'; let thankRate = thankSection.querySelector('.thank__rate'); thankRate.textContent = selectedRateIndex; }); }) }
The remainder is excellent.
I hope it's useful. 👍
Marked as helpful0 - @arkaroy135Posted almost 2 years ago
Hello Franci, Hope you are doing well. You did fantastic job in this project, perfect design. I have one thing to add here, that use
cursor: pointer;
on the submit button.0@francimelinkPosted almost 2 years ago@arkaroy135
thank you. I was focused on rates and forgot about sumbit....
0
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