Any help would be appreciated. It's based on TTD3 and can also stop the animation when the button is clicked again.
We can't really spoon feed people but, lemme provide you some links:
1. Detecting Button Click
2. Loading Animations
3. Loading Animation (Deprecated)