There are many ways to create a gif. If you wasn’t sure on how to create a gif here is a quick way to create one.
First on illustrator you select the pieces that you want to animate. Each piece that you want to animate you will export by right-clicking and selecting export selection.
Once you have selected each piece you want animate, you will then export them into a file.
Then you will open app Photoshop from there you will import import the files by going to file then import the video frames to layers.
Once you have your layers you will go your workspace and select motion. You will then select create video timeline.
From there you will then use whatever you want to animate you can choose to change the opacity, the style, or transform the object to create is animation frame by frame.
After you have finished animating your piece, you will then exported bye going to file save for web and select gif then save.
The ending will result in your animation gif.