Skip to content

Latest commit

 

History

History
96 lines (69 loc) · 2.51 KB

README.md

File metadata and controls

96 lines (69 loc) · 2.51 KB

Frontend Mentor - Interactive rating component solution

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.

Table of contents

Overview

The challenge

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

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Mobile-first workflow
  • Vanilla Javascript

What I learned

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;
}

Continued development

I look forward to expanding my knowledge in javascript functionality which I believe is my weakest skill in coding at the moment.

Useful resources

  • StackOverflow - This helped me when I was trying to figure out how to to display the rating that was submitted in the span element.

Author