Included page refresh when clicking on Rating state end image.
Design comparison
Solution retrospective
To add the events to the evaluation "buttons", I used the For loop instead of ForEach. Although functional, is it correct to do it only with the For loop?
In the final state, I have inserted an image click event to refresh the page, and also mouseover and mouseout events to raise a "warning". Is it done that way on a daily basis?
Community feedback
- @fazzaamiarsoPosted over 2 years ago
Hello Rodrigo! Nice solution!
It's OK and valid to use for loop. I prefer forEach because it's faster to not deal with the increment and length logic.
Answering your question on
mouseover
andmouseout
, CSS actually have:hover
pseudo-class that handle that logic. Instead of using event, you can just do this in CSS..some-class:hover { opacity : 1 }
https://developer.mozilla.org/en-US/docs/Web/CSS/:hover Hope it helps! Cheers!
Marked as helpful0@rodrigompiresPosted over 2 years ago@fazzaamiarso Hello Fazza Razaq Amiarso! Many thanks for the reply. At the time, I ended up forgetting about the hover. Hugs
0 - @correlucasPosted about 2 years ago
👾Oi Rodrigo Pires, tudo bem? Parabéns pelo desafio!
Acabei de ver o preview da sua solução e tenho algumas dicas pra você:
Pra deixar seu component responsivo vc tem que substituir
min-width
commax-width
pra fazer com que ele se ajuste com a tela:.container .card { max-width: 21.8rem; border-radius: 1.1rem; background-color: var(--Dark-Blue); padding: 1.6rem; }
Adicione
flex-wrap: wrap
pra fazer com que os botões de avaliação ajustem de acordo com o tamanho do card:.container .numbers { flex-wrap: wrap; margin-top: 2.5rem; display: flex; align-items: center; justify-content: space-between; }
👋 Espero que essas dicas tenham sido úteis e continue codando!
0@rodrigompiresPosted about 2 years ago@correlucas Hello Lucas. Thanks for the answer. Hugs
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