Need help with animation function code optimization

So this code will be responsible of creating 20+ animation by only calling one animation function but idk how it will handle that many callback or if it’s even good to use functions like this. I’m open to advices on how i can improve the code.

I think it’s perfectly ok to do it like that. Having 20+ animations should not be a problem.