Animation should help users understand where something came from, where it went, or whether an action succeeded. Keep it brief, avoid moving large blocks during reading, and limit decorative loops that pull attention away from the task.
Try a restrained transition in the CSS animation generator, then test it in context: does it make the interface easier to follow at normal speed? Check keyboard and touch interactions, not just a mouse hover. Respect prefers-reduced-motion by removing nonessential movement or offering a calmer alternative.
A loading indicator can communicate progress, but endless motion should not hide a stalled operation.