Article preview component with flexbox (+vite)

Solution retrospective
All feedback is welcome!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Taresta
Your code is excellent. I am still learning SASS so I will focus on Javascript here, which by the way was impressive. I learned a lot by reading through your code. When I did this project myself I had unintentionally added a lot of redundancy and someone was kind enough to point that to me. Maybe it could help in making your code a bit simpler too. So, here is how I think you can get rid of some of the extra code.
//Create a toggle function to toggle classList const toggleClasses = () => { shareOptions.classList.toggle("show"); if (isMobile()) { footer.classList.toggle("hide"); } }; //Create a remove function to remove the class List const removeClasses = () => { shareOptions.classList.remove("show"); footer.classList.remove("hide"); }; button.addEventListener("click", toggleClasses); activeButton.addEventListener("click", toggleClasses); window.addEventListener("resize", removeClasses);
Marked as helpful - P@wraith-wall
The solution includes semantic HTML and is accessible. The layout looks good on a range of screen sizes, the code is well-structured, readable, and reusable. The solution matches the design.
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