Interactive rating component using basic front end tools

Solution retrospective
Hi everyone! I'm really happy to be joining this awesome community.
This is the first project I've ever completed in a very long time, and as such, I have lots of questions. I'll try to prioritize the ones that are bothering me the most.
The technologies I used:
- HTML5
- CSS3
- JavaScript
My questions:
-
I struggled for quite a while with Flexbox and element positioning. While I was able to get everything mostly right, I felt unsatisfied with the way the numbers inside the rating options were positioned. They seem to be slightly off-centered. I tried fixing it with line-height and padding, but nothing really worked and gave up in the end. Any suggestions as to what might be causing this issue and how to fix it? CSS Code
-
While using JavaScript to add the required features, I got stuck implementing the rating selection. I managed to solve that problem and then every other feature after it didn't take half as long to develop, but still, I keep looking at it and it seems like A LOT of code for something relatively simple. I guess my question is, is there any way I could have created that feature using less lines of code? JS Code
I appreciate those of you kind enough to help me. I know this is just a rookie project but I still feel quite proud of what I have accomplished. Any feedback regarding best practices or other mistakes that I overlooked is also welcome.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Nicolás Pírez's solution.
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