[ticket/12911] Refactor animation to be simpler

PHPBB3-12911