This is my 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 active states for all interactive elements on the page
- Select and submit a number rating
- See the "Thank you" card state after submitting a rating
- Solution URL: github solution
- Live Site URL: live site
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
- Vanilla Javascript
Being that I'm still learning, I wasn't aware of how I could make a radio input look like a button. Thankfully, I was able to get some ideas from youtube and stackoverflow.
Here is my solution:
input[type="radio"] {
position: relative;
left: 30px;
display: none;
}
label {
color: hsl(217, 12%, 63%);
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
border-radius: 50px;
background-color: hsla(216, 12%, 54%, 0.088);
}
label:hover {
background-color: hsl(25, 97%, 53%);
color: white;
transition: 0.5s;
cursor:pointer;
}
input:checked + label {
background-color: hsla(216, 12%, 54%, 0.686);
color: white;
}
I look forward to expanding my knowledge in javascript functionality which I believe is my weakest skill in coding at the moment.
- StackOverflow - This helped me when I was trying to figure out how to to display the rating that was submitted in the span element.
- Frontend Mentor - @rnsnceman
- Instagram - @yurikoller