You can try to use CSS for this. One way is through CSS animations. Here is a video for it https://www.youtube.com/watch?v=z2LQYsZhsFw. You can directly change the border property of the icons through this without affecting the width being stretched.
The animations can be activated through a CSS property animation-play-state
That can be changed through JS also.