This pen uses minimal vanilla js to track mouse's movement over an image. Based on its offset compared to the image's center, a rotation of up to ±5º is applied.
Photo cred: https://unsplash.com/photos/TApAkERW5pQ
Idea recreated based on a concept seen on https://erudi.to/. They also have an awesome url + contact form!