User:Numbermaniac/colorSweep.js

setTimeout(function{switch($('#firstHeading').css('color')){	case "rgb(187, 102, 0)": // Start		color="rgb(255, 139, 0)";		break;	case "rgb(153, 153, 51)": // C		color="rgb(230, 230, 80)";		break;	case "rgb(0, 119, 0)": // GA		color="rgb(0, 160, 0)";		break;	case "rgb(34, 153, 204)": // A		color="rgb(0, 205, 255)";		break;	case "rgb(0, 102, 204)": // FA		color="rgb(0, 102, 255)";		break;	case "rgb(0, 0, 0)": // None		color="#5bf";		break;	default:		color=$('#firstHeading').css('color'); }

var i=1; sID=setInterval(function{  $('#mw-page-base').css("background-image","linear-gradient(to left,"+color+",#f6f6f6 "+i+"%)");   if(i++==80){clearInterval(sID)} }, 10); }, 3000); // I kind of like how this approach doesn't need 80 recursive function calls

/* old method: function sweep(i){ setTimeout(function{     $('#mw-page-base').attr('style',"background-image:linear-gradient(to left,"+color+",#f6f6f6 "+i+"%)");      if (i<80){sweep(i+1)}   },10)} sweep(1)},3000)