Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Article preview with cool animation and dark mode

accessibility, cube-css
Azhar•600
@azhar1038
A solution to the Article preview component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


This is my solution for Article Preview Component with dark mode and cool circular expanding reveal animation for share menu in mobile view and fade-in animation in desktop.

The most difficult part for me was to position the share menu in desktop mode. I ended up using properties and calc to calculate its position so that it stays in center even if we add more links later.

Another part is accessibility. I did try to make it accessible but I am not sure if I missed something or overdid something.

For show/hide share menu, I have used data attribute instead of toggling class which is as per cube-css methodology.

For JS, I decided to use query selector instead of id. This allows to add multiple cards without any issue. But I think in real projects using any library like react, it is better to just use states.

Do let me know your thoughts :-)

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Azhar's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License