Design comparison
Solution retrospective
Had a hard time figuring out how to access some style properties and how to assign them the correct way for them to make the needed change on the page.
Tried my best on making the functions, although I think it could be more clean and less code.
Community feedback
- @vitorlfariaPosted over 3 years ago
Fala @Igor-mit, tudo bem?
Ficou muito bom! Estou aprendendo js pra começar a pegar uns desafios aqui também.
A única dica que eu daria é, como a @AgataLiberska já disse, colocar um
max-width
pra quando crescer a tela depois de um ponto ele ficar em um tamanho fixo e não ficar estranho ser dar pra ver direito a imagem de fundo.Keep coding and happy coding!
0 - @AgataLiberskaPosted over 3 years ago
Hi @igor-mit! I think your solution looks really nice, although I would set a max-width to the card when in mobile layout just so you don't lose most of the image when the card resizes.
I see that you used a JS function to fade the modal in and out, can I ask why you chose to do that instead of a keyframes animation? I've never seen this approach and I'm curious :)
0@igor-mitPosted over 3 years agoAs the challenge said to use JS, that was my first thought on how to make the animations, the onclick with the interval making the movement...
Now I see I couold've done a LOT of other ways, but this one was my first thought and when I was doing it the easier way to do it, so I went with it...
But how could it be done with CSS keyframes? Does CSS have an onClick alike?
0@AgataLiberskaPosted over 3 years ago@igor-mit you would define a class with the animation in it and then apply / remove the class with JS
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