Flickering of CSS animation fix