JSFiddle - React, Tailwind, and code Playground

by amadanNM

HTML

<div id="rects"></div>

JavaScript

var R = Raphael('rects', 600, 500);

var i=0;
var y=10; 
function setObj(inSet)
{
    var that=this;
    that.set = inSet;
    that.set.hover(function(){
              that.set.animate({fill: '#000'}, 300);
          }, function(){
              that.set.animate({fill: '#FFF'}, 300);
          }
    );

}

for (i=0;i<=5;i++){
    
    var set = R.set();
    var x=10;
    for (n=0;n<=9;n++){
        var rectangle = R.rect(x,y,50,50);
        set.push(rectangle);        
        x = x + 60;
    }
    new setObj(set);
    y = y + 60;
}