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

Componente do cartão de pré-visualização NFT

@gleidsonfagno

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


toda sugestão será bem vida

Community feedback

@Jorggyh

Posted

Boa tarde brother, beleza?

Sobre o efeito hover, não sei se é a única maneira, mas eu fiz da seguinte forma, no html, antes da tag img eu adicionei o seguinte:

<div class="overlay">
    <img alt="Eye view icon" src="img/icon-view.svg" />
</div>

E no CSS eu adicionei:

.overlay {
	position: absolute;
	background-color: rgba(0, 255, 247, 0.6);
	width: 30rem;
	height: 30rem;
	border-radius: 10px;
	display: flex;
	justify-content: center;
	align-items: center;
	opacity: 0;
	transition: 0.15s ease-in-out;
}

/* define o tamanho do ícone do olho */
.overlay img {
	height: 4rem;
	width: 4rem;
}

.overlay:hover {
	cursor: pointer;
	opacity: 1;
}

Explicação: esse overlay está sobrepondo a imagem, estão no mesmo lugar, isso isso com o position: absolute, mas ele não está aparecendo, porque está com opacidade 0, quando passo o mouse aí a opacidade muda para 1, aparecendo o overlay, a transparência eu consegui com rgba, que permite colocar transparência.

Tenta adaptar no seu código, depois me fala se deu certo, ou se não deu.

Marked as helpful

0

@gleidsonfagno

Posted

@Jorggyh valeu mano

0
Lucas 👾 104,420

@correlucas

Posted

👾Hi gleidson fagno, congrats on completing this challenge!

The approach you've used to center this card vertically is not the best way, because using margins you don't have much control over the component when it scales. My suggestion is that you do this alignment with flexbox using the body as a reference for the container.

The first thing you need to do is to remove the margins used to align it, then apply min-height: 100vh to make the body height size becomes 100% of the screen height, this way you make sure that whatever the situation the child element (the container) align the body with display: flex and align-items: center / justify-items: center.

body {
    min-height: 100vh;
    background-color: hsl(217, 54%, 11%);
    padding: 60px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

✌️ I hope this helps you and happy coding!

Marked as helpful

0

@samuelms21

Posted

Hello there! Nice work on your first project. Here are some improvements that you can make to this project:

  • Change the font-family to match the style guide (font-family: Outfit), you can find this specific font in Google Fonts
  • Change the card background-color to hsl(216, 50%, 16%), as specified in the style guide
  • Add rounded borders to the NFT image using the border-radius property
  • Reduce the font-size for the NFT price
  • Add the icon-view.svg when you hover over the NFT image

Stay positive and continue on your journey.

Marked as helpful

0

@gleidsonfagno

Posted

@samuelms21 e senhor pode me dar uma dica de como faz isso Adicione o icon-view.svg ao passar o mouse sobre a imagem NFT Não consegui fazer já pesquisei mas não encontrei a resposta.. obrigado

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