Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 7 days ago

Article Preview Component Solution - Challenge #10

bem
P
Fraser Jubb•190
@fraserjubb
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?
  • This was my first time working on a JavaScript project that was not part of a video course where I follow tutorials. It felt good. I also gave myself an extension goal of making the share options disappear when either 1) The button is clicked again or 2) Anywhere else outside the share menu is clicked.
  • I greatly improved my understanding of stopPropagation() and how it prevents the event from moving up the DOM tree to parent elements and triggering their event listeners. Particularly useful for pop-up menus (in this case it was the simple share menu).
  • This was also my first time using AI (ChatGPT) to assist when I was troubleshooting my code. I was careful to 1) Not include any actual code from my project and 2) Treat it similarly to MDN documentation where I try to break down the problem and understand it so I can then apply it to the code myself. I do not intend to have ChatGPT to write my code at any point (other than very basic boilerplates) or to read my own code as this could lead to problems - both in the code itself and its origin.
What challenges did you encounter, and how did you overcome them?
  • In this project, I was having issues with my 'hidden' class when I moved it toward the top of the code. Ensuring Utility Classes are at the bottom of my CSS file (or for future projects, in a separate 'utilities' file that is loaded last) makes sure that it is not overwritten.
What specific areas of your project would you like help with?
  • This was my first time properly writing my own JavaScript code. How does it look?
  • Any other feedback is welcome.
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 Fraser Jubb'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

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