JSFiddle - React, Tailwind, and code Playground
by Roger Sanchez
HTML
<body>
<div class="iceburg">
<img src="http://static.guim.co.uk/sys-images/Observer/Pix/pictures/2010/4/14/1271265014795/Small-Iceberg-Drifting-in-001.jpg" width="200" height="100">
</div>
CSS
.iceburg{
width:200px;
height:30px;
position:absolute;
}
JavaScript
var ice = $('.iceburg');
function anim() {
setInterval(function(){
ice.animate({
top:'+=20'},
{ duration:1000,
step:function()
{ ice.css('-webkit-transform','rotate(-0.5deg)');}
});
ice.animate({
top:'-=20'},
{ duration:1000,
step:function()
{ ice.css('-webkit-transform','rotate(0.5deg)');}
});
});
}
anim();