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

Article Preview Component | JS

@MaanAlHababi

Desktop design screenshot for the Article preview component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

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.

Community feedback

Roselin Y 330

@Vanillatte68

Posted

Good job on completing the challenge!

I think your positioning is good enough in desktop size, you only need to adjust the right CSS property more.

I noticed the 'hidden' class for publisher toggle incorrectly when you open the share menu in desktop and then resize it to below 768px. You can adjust the event listener to toggle 'hidden' class for publisher when share menu is open and being resize.

I hope this will help. Happy coding

Marked as helpful

1

@MaanAlHababi

Posted

@Vanillatte68

The problem with adjusting the right property is that I can make it look fine on only one screen size, if I resize the window even slightly it gets messed up. There is a major difference between 1440px width and 1920px for example, I can only make it work for one which makes me believe that my method isn't optimal.

About the publisher section, I completely overlooked it! Thank you for pointing it out!

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