Created a hover animation using the Web Animations API. The origin of the circle is a random set of coordinates inside the box.
The circle will always be as small as possible to fully cover the box.
I decided to use 2 different animations for the hover in/out for more control, but you could also use "animation.reverse()
". (Chrome, Firefox)
If you see any improvements please let me know, I want to learn!
A Pen by Gennadi Debbaut on CodePen.