Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Article Preview Component | JS

Maan Al-Hababi•190
@MaanAlHababi
A solution to the Article preview component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am proud of trying one more time every time I faced a challenge.

  1. The JavaScript was really simple, but this is the first time I had to think on my feet with no guidance since I learned JavaScript.
  2. I am proud of the structure of the HTML that made it possible for me to work with two sections that are practically one but they alternate in display, but in desktop size, one is permanently visible while the other switches state from being an element in flow display to a 'floating' element that doesn't take up any space with the main content.
  3. I am also proud of he little pop-up animation, considering how tiny it is.
What specific areas of your project would you like help with?

I struggled with the positioning of the 'share menu' in desktop size. The approach I took was to position it absolutely relative to its parent which is the '.bottom' section element and try to match it up with the '.share-button' button element which is, too, positioned absolutely relative to the '.bottom' element. However, my approach was very explicit and did not work well when resizing the window.

A thought I had was to, in some way or another, position it relative to the button considering they're on the same level in the DOM tree, but I couldn't quite figure it out.

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 Maan Al-Hababi'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