JSFiddle - React, Tailwind, and code Playground
HTML
<img src="https://daks2k3a4ib2z.cloudfront.net/55a65f66bd1f99042d3580a0/55f29ba123bb0c973e6d7b1d_laptop.png" />
CSS
img {
height:300px;
}
JavaScript
$.fn.clockwiseRotate = function () {
$(this).each(function () {
var self = $(this);
var degree = 0;
var scale = 0;
var interval = setInterval(function () {
self.css({
'-webkit-transform': 'rotate(' + degree + 'deg) scale(' + scale + ')'
});
self.css({
'-moz-transform': 'rotate(' + degree + 'deg) scale(' + scale + ')'
});
self.css({
'transform': 'rotate(' + degree + 'deg) scale(' + scale + ')'
});
degree++;
scale += (1 / 360);
if (degree === 361) {
clearInterval(interval);
}
}, 1);
});
};
$('img').clockwiseRotate();