Skip to content

From Frontend Mentor: Website with interactive rating components from 1-5, with feedback after submiting rating.

Notifications You must be signed in to change notification settings

danielkull/FrontM-interactive-rating-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Interactive rating component solution

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.

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

Screenshot

Rating Desktop Solution Thank you Desktop Solution Rating Mobile Solution Thank you Solution Rating Mobile-rotate-viewport Solution Thank you Mobile-rotate-viewport Solution

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • @media screen for breakpoints
  • JS DOM

What I learned

Using shadow inside of a button to give the user a feeling when it's activated.

.btn-submit:active {
  box-shadow: inset 0 0 5px var(--dark-blue);
}

To use min or max-width/height in different ways to define a tile with it's content, but also make sure that the tiles look the same, without content loss.

.content-tiles {
  display: grid;
  place-content: center;
  padding: 2rem 1rem;
  gap: 1.5rem;

  max-width: min-content;
  min-height: 25rem;
}

p {
  min-width: 31ch;
}

.rating-response {
  min-width: fit-content;
}

Creating an array from a selected html element with css selector like structure(like here with input elements in the wrapper-rating), to then work with it.

const inputList = Array.from(
  document.querySelectorAll(".wrapper-rating input")
);

Continued development

I want to focus more on placement of the html content with css. And also want to increase the html semantic knowledge about forms and its respective elements. In addition working more with input and label elements witht the help of the CSS Tricks article (See Useful resources).

Useful resources

Author

Acknowledgments

My thanks goes again to the Coding-bootcamps-eu, it's teachers and fellow students. Also a special thanks to Amber Wilson's article, about Inputs and Labels on CSS Tricks, which gave me a deeper understanding.

About

From Frontend Mentor: Website with interactive rating components from 1-5, with feedback after submiting rating.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published