NFT Preview Card Solution

Solution retrospective
I found using hover difficult because of the eye icon. I couldn't seem to get it completely opaque like in the design files. I feel like I also maybe could've been more efficient with my code too.
My main question is how could I make the eye icon more opaque when I hover over the main image?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @KaydenGiang2512
It was probably because I didn't phrase my suggestion well enough (quite hard to do so through text-only comments!), so I will paste in the link to my solution here so you can see what I tried to explain above. Hope this clears up any confusion you may have on our issue!
https://github.com/KaydenGiang2512/Article_Preview_Component
Best of luck :D
Marked as helpful - @KaydenGiang2512
Hi Lacey, great work on this project overall. I actually completed this project a few weeks ago so I might have a solution to your "eye image opacity" issue, which is by separating the eye-icon from the NFT image into 2 separate <div> tags. After that, create another <div> as the overlay and use position: absolute for all of these to ensure that they stack on top of one another. By putting the eye-icon in its own <div> tag, the opacity attribute from the NFT image will no longer affect it, and you can independently set the opacity of the eye to your choosing. Hope this helps and happy coding!
P.S. the image is not horizontally centered in the entire card element, so that's another thing you should look into.
- @Bayoumi-dev
Hey Lacey, It looks great!...
To fix the view-icon transparent, Use
background-color: hsla(178, 100%, 50%, 0.5);
instead ofbackground-color: #00fff7;
and changeopacity: 0.7;
toopacity: 1;
.overlay { background-color: hsla(178, 100%, 50%, 0.5); //... } .img-wrapper:hover .overlay { opacity: 1; }
Hope this is helpful to you... Keep coding👍
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