Design comparison
SolutionDesign
Solution retrospective
I appreciate any suggestion. I would like to write cleaner code, I'm working on it.
Community feedback
- @abhik-bPosted almost 4 years ago
Good job Shade , your solution looks nice. Keep it up 💯
You can do something like this to reduce creating & calling a extra function (just a opinion)
hamburger.addEventListener("click", () => { mobileMenu.style.display = "block"; if (hamburger.dataset.status === "open") { hamburger.src = "./images/icon-close.svg"; hamburger.dataset.status = "close"; mobileMenu.classList.add("fadeInMobileMenuAnimation"); mobileMenu.classList.remove("fadeOutMobileMenuAnimation"); } else { hamburger.src = "./images/icon-hamburger.svg"; hamburger.dataset.status = "open"; mobileMenu.classList.add("fadeOutMobileMenuAnimation"); mobileMenu.classList.remove("fadeInMobileMenuAnimation"); } });
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