JSFiddle - React, Tailwind, and code Playground
by neonDog
HTML
<img src="http://placehold.it/350x150" alt="placeholder" />
CSS
img {
/* Extend support as much as possible */
transform:translate(100px,20px) rotateZ(30deg) rotateX(40deg);
}
JavaScript
// Grab current rotation position
var $img,
position;
$img = $('img');
position = $img.css('-webkit-transform') || $img.css('-moz-transform') || $img.css('-ms-transform') || $img.css('-o-transform') || $img.css('transform');
console.log(position);
position = position.split('(')[1].split(')')[0].split(', ');
console.log(position);
// Concert matrix to degrees value
position = Math.round(Math.atan2(position[1], position[0]) * (180/Math.PI));
window.alert(position + " degrees");