Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive Rating Component with HTML, CSS and Vanilla JS

@gfernan24373

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Please, if you see something wrong or there's another way to do it better, tell me as soon as possible.

Community feedback

Ivan 2,630

@isprutfromua

Posted

Hi there. You did a good job 😎

keep improving your programming skills🛠️

your solution looks great, however, if you want to improve it, you can follow these steps:

✅ it is better to avoid double cycles

for(let i of circulos) {
  i.onclick = function() {
    for (let circulo of circulos) {
      circulo.style.background = 'var(--DarkBlue)';
      circulo.style.color = 'var(--MediumGrey)';        
    }

✅ it would be better to do it with css

document.addEventListener('mousemove', function(e){
    if(e.target == i && i.style.background == 'var(--DarkBlue)') {
      i.style.background = 'var(--LightGrey)';
      i.style.color = 'var(--White)'; 
    }
    if(e.target != i && i.style.background != 'var(--primary)') {
      i.style.background = 'var(--DarkBlue)';
      i.style.color = 'var(--MediumGrey)';
    }
  });

I hope my feedback will be helpful. You can mark it as useful if so 👍

Good luck and fun coding 🤝⌨️

1

@gfernan24373

Posted

@isprutfromua Many many thanks for giving your feedback!!!! I really appreciate your comment and I'm gonna follow your tips.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord