html + tailwindcss + typescript + gsap animation

Solution retrospective
drop down animation GSAP conveniently provides a way to animate the height change, which is not trivial when it comes to vanilla js & css keyframes.
if (mobileNavCompanyAccordian.style.height === "1.5rem") { arrowImg.src = ArrowUpImg gsap.to(mobileNavCompanyAccordian, {height: "auto", duration: 0.5, ease: "power2.out"}) } else { arrowImg.src = ArrowDownImg gsap.to(mobileNavCompanyAccordian, {height: "1.5rem", duration: 0.5, ease: "power2.out"}) }
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Zup'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