@OGShawnLee
Posted
Hey. Good job!
- Firstly. If you are using VS Code I recommend installing Prettier to keep your code looking nice and tidy.
- The HTML seems fine some improvements would be not wrapping the rating result inside of a <p/> tag. I think a <div/> and a <span/> inside it would be better.
- CSS. Well I think you could have used CSS variables and relative units like rem instead of px. I don't remember when was the last time I used vanilla CSS so I cannot give you more feedback about it :'(
- About the JavaScript you should have used a loop to add an event listener to each button instead of hard coding each one. If you had 100 buttons that would not be easy to do. You could have got all the buttons with a querySelectorAll and loop over them with a forEach loop. Get the element and the index, add an eventListener and handle the click event with a function that uses the index as the rating. Maybe I could help with a pull request in case you get stuck.
Hope my feedback was useful. Overall good job mate :) Have a great day/night.
Marked as helpful