Design comparison
SolutionDesign
Community feedback
- @0xabdulkhaliqPosted 6 months ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have a suggestion regarding your code that I believe will be of great interest to you.
FIXING INCOMPLETE TRANSITION
- Currently the Hover effect which has been applied for the component (
.container
) has an issue intransition
property, It's simply because you've been using it wrongly.
.container:hover { box-shadow: 10px 10px #000; transform: scale(1.02); transition: transform 500ms ease; }
- Due to that whenever the user hovers the component it will smoothly animate but as soon as the user get out of hovering area the component itself will suddenly goes to it's initial state without smoothness as like it's starting state.
- To fix this we need to declare the
transition
property on normal class, i mean the class where we not linked to any pseudostates likehover
,active
etc.
- These are the fixed css rules,
.container { transition: all 0.1s ease-in-out; } .container:hover { box-shadow: 16px 16px 0px 2px hsl(0, 0%, 7%); }
- Now you will get a smooth-in-out transition effect without sudden drop during hover.
- I would recommend you to read this Transitions Reference article by MDN to get an overview with it's usecases.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful0@azurecodersPosted 4 months ago@0xabdulkhalid Really thanks a lot. I would definitely work on it thanks.
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