Submitted over 2 years ago
Interactive Rating Component with HTML, CSS and Vanilla JS
@gfernan24373
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
- @isprutfromuaPosted over 2 years ago
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@gfernan24373Posted over 2 years ago@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 GitHubJoin 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