Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive NFT Preview Component easily done with Flexbox

@MikSanty

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Is there a better way to do the view icon hover than this way?

Community feedback

P

@rogacmatej

Posted

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

@vgarmy

Posted

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 GitHub
Discord logo

Join 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