This is a solution to the NFT preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
This is a responsive card component built with HTML & CSS.
Users should be able to:
- View the optimal layout depending on their device's screen size
- See hover states for interactive elements
- Solution URL: GitHub Repo
- Live Site URL: NFT Card Component Live
- I gathered the design assets on my Figma board.
- Designed the interface on Figma.
- Proceeded to initialize a git repo and connect the repo.
- I created a working branch to ensure that changes are well tracked and prevent errors from the main branch.
- Then, I started writing the code to the working branch.
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Clamp
I learnt how to make good use of css flexbox and clamp() to make responsive layouts.
To see how you can add code snippets, see below:
<div class="image-overlay">
<img
src="images/icon-view.svg"
alt="icon-view"
/>
</div>
.image-overlay {
position: absolute;
opacity: 0;
background-color: var(--Cyan);
width: clamp(304px, 90%, 314px);
height: clamp(304px, 90%, 314px);
border-radius: 10px;
transform: translate(0%, -100%);
transition: 0.5s ease;
display: flex;
justify-content: center;
align-items: center;
}
const proudOfThisFunc = () => {
console.log('🎉');
};
I will keep exploring creating responsive and reusable code in future projects.
- MDN Docs - This helped me with css clamp() and the hover effect on the image.
- Website - Design Portfolio
- Frontend Mentor - @kwekuduahh
- Twitter - @kwekuduahh