In this article, I implement a simple button animation with GSAP and use the Composition API introduced in Vue 3.x. If you are not familiar with the Composition API, you can refer to the resources linked at the end of the article.
What is GSAP?
Simple button animation
I have created a simple form and used GSAP to run an animation when the submit button is clicked. For this, I used the Composition API and ref from Vue. The animation itself takes only two lines of code:
Here's the codepen; you can tweak around to make some cool form animations as well:
- Simple GreenSock Tutorial by Petr Tichy
- A Beginner's Guide to GreenSock by Nicholas Kramer
- How to Animate on the Web With GreenSock by Sarah Drasner
- Official Vue docs on Composition API
- Vue Composition API by Shawn Wildermuth
- Comparing Composition API with Options API by Holly Guevara
Top comments (0)