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

NFT card using Sass and some simple transitions

@KristinaRadosavljevic

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


Any feedback is welcome of course, but if you have some tips on how to optimize my code in Sass (especially if you spot any opportunities for code reusability and/or better organization), that would be highly appreciated! :)

Community feedback

Travolgi πŸ•β€’ 31,420

@denielden

Posted

Hi Kristina, congratulations on completing the challenge, great job! 😁

Very clean code and amazing animation on the hover effect!! I love it.

Some little tips for optimizing your code:

  • use the main tag to wrap the card and improve the Accessibility
  • you can use article tag instead of a simple div to the container card for improve the Accessibility
  • Using <hr> for the line is not the best way because this tag have a semantic meaning... in this case use div with border-bottom because this line is decorative

Hope this help! Happy coding πŸ˜‰

Marked as helpful

0

@KristinaRadosavljevic

Posted

@denielden Thanks for your feedback, Deniel! :)

I did consider just using a border for the line, but I wasn't aware that <hr> is semantic so I opted for that. Lesson learned! :D

And I actually did use the <main> tag for the entire card in HTML, I just selected it using its class name in CSS, not sure if that messes with accessibility somehow and what the best approach is?

Anyway, great points and thanks again for taking the time to review my solution, much appreciated! :)

1
Travolgi πŸ•β€’ 31,420

@denielden

Posted

@KristinaRadosavljevic You are welcome and keep it up :)

The best approach is to use main for the purpose of accessibility and then use it to contain all the central elements and contents of the page, as written in the docs

The <main> HTML element represents the dominant content of the <body> of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application.

1
Lucas πŸ‘Ύβ€’ 104,420

@correlucas

Posted

πŸ‘ΎHello @KristinaRadosavljevic, Congratulations on completing this challenge!

Wow! This hover effect is just amazing!Its really nice that you’ve used some animation and effects! Something to improve the accessibility its to add a media query reducing the motion.The prefers-reduced-motion CSS media feature is used to detect if the user has requested that the system minimize the amount of non-essential motion it uses. Here’s the code for that:

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

✌️ I hope this helps you and happy coding!

Marked as helpful

0

@KristinaRadosavljevic

Posted

@correlucas Thanks, Lucas, I'm really glad you liked the hover effect, I am kind of proud of it :D

And also, your comment was really helpful, I wasn't even aware of this media feature but it sure seems handy, I'll definitely try to remember to use it in the future!

Thanks again! :)

1

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