Jump to content
GreenSock

coco

Using SVGs for gsap fireworks type of animation

Recommended Posts

Hi there .. I took a hiatus from using Greensock and am coming back into it again. Just got into the Creative Coding Club. wooo!

My question:  I want to create an explosion much like this demo from Greensock


but I want to use SVGs (or even PNGs) instead of objects created by the JS or even CSS. I want to even know if it's even possible before I begin.
The effect I want to achieve is an explosion of say, for example, cookies (because they aren't circles with one color) or perhaps a coin, where there one or 2 or 3 cookie/coin SVGs which would explode upward like the demo above.

Since it's been a while that I've used the API, and I really haven't found any examples online yet using GSAP, I just want to know if it's possible to use images instead of JS generated elements with simply a defined color and diameter. Any guidance is greatly appreciated!
Coco

See the Pen emjgxw by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Welcome back, @coco!

 

Absolutely that's possible. You can use <img> elements or SVG or whatever - GSAP doesn't really care. It can animate literally anything that JavaScript can touch. 

 

Have fun!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×