JSFiddle - React, Tailwind, and code Playground
HTML
<div id="thing">Hello!</div>
CSS
#thing {
position: absolute;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
background-color: red;
border-spacing: 0px;
cursor: pointer;
}
JavaScript
function transformThing() {
$('#thing').animate({ top: '+=50', left: '+=50', borderSpacing: -90 }, {
step: function(now,fx) {
if(fx.prop === 'borderSpacing') {
$(this).css('-webkit-transform','rotate('+now+'deg)');
$(this).css('-moz-transform','rotate('+now+'deg)');
$(this).css('transform','rotate('+now+'deg)');
}
},
duration: 1000
}, 'swing');
}
$(document).ready(function() {
$('#thing').click(function () {
transformThing();
});
});