JSFiddle - React, Tailwind, and code Playground
HTML
<img id="snowman" alt="Boneco de Neve" src="http://www.srcentro.oet.pt/_public_/newsmail/natal_2014/img/snowman.png" width="200" height="300">
CSS
img {
-moz-transition: all 1s ease-in-out;
-webkit-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
JavaScript
var prefix = (function () {
var styles = window.getComputedStyle(document.documentElement, ''),
pre = (Array.prototype.slice.call(styles)
.join('')
.match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o']))[1];
if (pre == 'moz') return '';
return '-' + pre + '-';
})();
var ang = -5;
var el = document.querySelector('img');
setInterval(function () {
ang = -ang;
el.style[prefix + 'transform'] = 'rotate(' + ang + 'deg)';
}, 1000);