Submitted about 1 year ago
Responsive NFT Preview Component easily done with Flexbox
@MikSanty
Design comparison
SolutionDesign
Solution retrospective
Is there a better way to do the view icon hover than this way?
Community feedback
- @rogacmatejPosted about 1 year ago
Hi,
You could use pseudo-elements instead to display overlay.
.image::after { content: ' '; display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; opacity: 0.503; background: var(--tertiary-color); } .image .view-icon { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; } .image:focus::after, .image:hover::after, .image:focus .view-icon, .image:hover .view-icon { display: block; }
0 - @vgarmyPosted about 1 year ago
Hi
No its looks good, but just maby add an transition in your
.image > div { .... transition: all .4s ease-in-out; }
So it doesn't pop up too quickly, and is a little more pleasant to look at.
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