JSFiddle - React, Tailwind, and code Playground

by Rahul Sharma

HTML

<p>
  steam sales : low review games removal
</p>

JavaScript

$.each( $(".app > td:nth-child(7) > span"), function( i, v ) {2
	t = $(v).attr("aria-label").split('-');
  p = parseInt(t[0].split(':')[1]);
  n = parseInt(t[1].split(':')[1]);
  s = p+n;
  if( s >= 1000){
    s = Math.pow(s, .5);
    s = (s > 255)? 1: s/255;
    if(s < .2){
      c = "0123456789ABCDEF"[Math.floor(15.9*s/.2)];
      c = '#F' + c + '7';
    }
    else if(s < .5){
      c = "FEDCBA9876543210"[Math.floor(15.9*(s-.2)/.3)];
      c = '#' + c + 'F7';
    }
    else {
      c = "FEDCBA9876543210"[Math.floor(15.9*(s-.5)/.5)];
      c = '#0' + c + '7';
      $(v).parent().parent().find('a').css('color','#FFF');
    }
  	$(v).parent().parent().css('background-color',c);
    gameTitle = $(v).parent().parent().find('a').text() + " review";
    query = gameTitle.trim().replace(/\s+/g, '+').toLowerCase();
    $(v).parent().parent().append('<td><a target="_blank" href="https://www.youtube.com/results?search_query='+ query +'">Review</a></td>');
  }
  //console.log();
});