
Article preview component with flexbox (+vite)
Design comparison
Solution retrospective
All feedback is welcome!
Community feedback
- @TarestaPosted 2 months ago
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 helpful0P@DocForLoopPosted 2 months ago@Taresta Thank you, and thank you for your suggestions, I've refactored my code to get simpler. ;)
0 - P@wraith-wallPosted 2 months ago
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.
0
Please log in to post a comment
Log in with GitHubJoin 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