JSFiddle - React, Tailwind, and code Playground
HTML
<div id="playGround" class="suffix_2 grid_8 prefix_2 all_edges">
<table>
<tr class="columnDetection">
<td data-index="1"></td>
<td data-index="2"></td>
<td data-index="3"></td>
<td data-index="4"></td>
<td data-index="5"></td>
<td data-index="6"></td>
</tr>
<tr id="firstRow" data-index="1">
<td data-index="1-1"></td>
<td data-index="1-2"></td>
<td data-index="1-3"></td>
<td data-index="1-4"></td>
<td data-index="1-5"></td>
<td data-index="1-6"></td>
</tr>
<tr id="secondRow" data-index="2">
<td data-index="2-1"></td>
<td data-index="2-2"></td>
<td data-index="2-3"></td>
<td data-index="2-4"></td>
<td data-index="2-5"></td>
<td data-index="2-6"></td>
</tr>
<tr id="thirdRow" data-index="3">
<td data-index="3-1"></td>
<td data-index="3-2"></td>
<td data-index="3-3"></td>
<td data-index="3-4"></td>
<td data-index="3-5"></td>
<td data-index="3-6"></td>
</tr>
<tr id="fourthRow" data-index="4">
<td data-index="4-1"></td>
<td data-index="4-2"></td>
<td data-index="4-3"></td>
<td data-index="4-4"></td>
<td data-index="4-5"></td>
<td data-index="4-6"></td>
...
CSS
#playGround{
margin-top:10px;
background:rgba(0,0,0,0.3);
height:400px;
}
.bottom{
border-bottom-left-radius:10px;
border-bottom-right-radius:10px;
}
.all_edges{
border-radius:10px;
}
#playGround table{
margin:30px;
width:90%;
height:90%;
/*border:1px solid grey;*/
}
td{
width:30px;
height:30px;
border:1px solid black;
}
tr.columnDetection{
border:0 none;
}
tr.columnDetection > td{
border-top:0 none;
}
td.hoveredA{
background:red;
}
td.hoveredB{
background:yellow;
}
td.hasDataA{
background:red;
}
td.hasDataB{
background:yellow;
}
JavaScript
/* JS of Michael Stadler */
/*--------------------------*/
/* Table of Contents */
/*--------------------------*/
/* .Plugin JS */
/* .Customization */
/*--------------------------*/
/* .Plugin JS */
/**
* @name Shuffle Letters
* @author Martin Angelov
* @version 1.0
* @url http://tutorialzine.com/2011/09/shuffle-letters-effect-jquery/
* @license MIT License
*/
(function(a){function b(a){var b="";if(a=="lowerLetter"){b="abcdefghijklmnopqrstuvwxyz0123456789"}else if(a=="upperLetter"){b="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"}else if(a=="symbol"){b=",.?/\\(^)![]{}*&^%$#'\""}var c=b.split("");return c[Math.floor(Math.random()*c.length)]}a.fn.shuffleLetters=function(c){var d=a.extend({step:8,fps:25,text:"",callback:function(){}},c);return this.each(function(){var c=a(this),e="";if(c.data("animated")){return true}c.data("animated",true);if(d.text){e=d.text.split("")}else{e=c.text().split("")}var f=[],g=[];for(var h=0;h<e.length;h++){var i=e[h];if(i==" "){f[h]="space";continue}else if(/[a-z]/.test(i)){f[h]="lowerLetter"}else if(/[A-Z]/.test(i)){f[h]="upperLetter"}else{f[h]="symbol"}g.push(h)}c.html("");(function j(a){var h,i=g.length,k=e.slice(0);if(a>i){c.data("animated",false);d.callback(c);return}for(h=Math.max(a,0);h<i;h++){if(h<a+d.step){k[g[h]]=b(f[g[h]])}else{k[g[h]]=""}}c.text(k.join(""));setTimeout(function(){j(a+1)},1e3/d.fps)})(-d.step)})}})(jQuery)
/* .Customization */
var playersTurn = false;
var newItem;
$(document).ready(function(){
$('#header>h1').shuffleLetters();
//$('#desc').slideDown(1500);
var playGround= $('#playGround');
//console.log(playGround);
$('tr.columnDetection td').hover(function(){
if(playersTurn){
$(this).addClass("hoveredA").animate({opacity:1.0});
}else{
$(this).addClass("hoveredB");
}
},function(){
if(playersTurn){
...