A CSS smiley face with dynamic googly eyes

In the previous article I demonstrated how to make an element rotate to follow the position of a cursor or a touch on the screen. At the time, I explained that the technique was not necessarily limited to a single element: in this article, I’ll show how to apply the code to two elements simultaneously, in the form of eyes that follow the mouse / touch position.

Who doesn’t love googly eyes.