Interactive Rating Component Sass/Scss & JS

Solution retrospective
Hi, I am Tux3er 🐧
It was an easy challenge to practice my JS skills,
I also put an dark/light ☀️/🌙 mode in the page!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @ApplePieGiraffe
Hey, Ismail Hammaini Farhane / Tux3er! 👋
Well done on this challenge! 👍 I like the extra touches that you added to your solution! 👏
It would be good to use
button
orinput
elements for the options in the card component. You are currently usingtabindex
to make theli
elements keyboard-focusable, which is generally discouraged as using semantic, interactive elements from the start is a better way to go. The options would be a good opportunity to use radio input elements since only one option can be selected at a time. You can also wrap the input elements and submit button in aform
element and collect the form data by listening for thesubmit
event on the form in your JS. 😉Adding some form validation to the card would be a nice idea, too, in order to make sure that users select an option before submitting the form. 🙂
Hope you find this helpful. 😊
Keep coding (and happy coding, too)! 😁
Marked as helpful - @alexgabriel8
Wow, your project is really beautiful. Using the star as a way of toggling between light/dark mode was really creative and the animations just make it even better.
One thing I think would make your project even better is to put a
cursor: pointer;
in the star and in the "go back" arrow icons. Your screenshot also seems to be outdated, with the submit button in a strange location.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