JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael-min.js"></script>
<div id="thepaper"></div>
CSS
#thepaper {
width: 300px;
height: 300px;
}
JavaScript
var rot=0,r=Raphael("thepaper",800,600);
var img = r.image("http://icons.iconarchive.com/icons/designbolts/disney-planes-2013/128/Colin-Cowling-icon.png", 0, 0, 96, 96);
img.rotate(0);
var start = function () {
this.ox = this.attr("x");
this.oy = this.attr("y");
this._transform = this.transform();
}
,move = function (dx, dy) {
// move will be called with dx and dy
this.transform("t" + (this.ox + dx) + "," + (this.oy + dy) + this._transform);
}
,up = function () {
}
img .drag(move, start, up);