This is a solution to the Interactive rating component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the app depending on their device's screen size
- See hover states for all interactive elements on the page
- Select and submit a number rating
- See the "Thank you" card state after submitting a rating
- If no rating is selected the submit button would be disabled
- Solution URL: Github solution URL here
- Live Site URL: live site URL here
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
For some reason i could not get get hiding one container and showing another simultaneously to work as I thought. hmmm
culprit found css was not working because i used
.thankyou-card-container .hide
with a space between instead of this
.thankyou-card-container.hide
That slight difference made the code fail. Another logic I encountered was if no score is selected what happens. I made the button disabled.
To see how you can add code snippets, see below:
- Would love to add animations to the elements on load.
- Add jiggle animation when no score is selected on submit
- event.target.id VS event.currentTarget.id VS this.id - I wanted to know the differences between them and use cases, this thread helped.
- Check for null in JavaScript - I was not sure what equality to use in this instance so this article helped.
- Frontend Mentor - @tchydy