JSFiddle - React, Tailwind, and code Playground

by davidhong

HTML

<script src="https://github.com/DmitryBaranovskiy/raphael/raw/master/raphael.js"></script>

JavaScript

// Creates canvas 320 Ă— 200 at 10, 50
var r = Raphael(0, 0, 500, 500);
var counter = 0;

// on page load, we have 93 / 100
var pointer = r.path('M15 250L250 260L250 240L15 250').attr({
    'fill': '#000'
}).click(function() {
    var degree = ((counter += 10) / 100) * 180;
    pointer.animate({
        rotation: degree + " 250 250"
    }, 2000, "bounce");
});