Skip to content

Instantly share code, notes, and snippets.

@marcelovani
Created June 12, 2015 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelovani/7cf763184244ea689189 to your computer and use it in GitHub Desktop.
Save marcelovani/7cf763184244ea689189 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Delay Repay
// @namespace work
// @description Tweaks for UI
// @include http://www.delayrepaysniper.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @version 1
// ==/UserScript==
$(document).ready(function() {
tweak();
setInterval(tweak, 15000);
});
function tweak() {
// Get the Date (second column).
$('td:nth-child(2)').filter(function () {
// Get the day using regex.
var patt = /(\d+)\/\d+\//;
var res = patt.exec($(this).text());
var day = parseInt(res[1]);
// Change the color of the row.
$(this).closest('tr').css('background-color', colorgen(day));
return;
});
// Change color of view claim.
$("a[href^=claim-information]").css("background-color", "greenyellow").css("padding", "6px");
}
function colorgen (i) {
var m = .3;
r = Math.sin(m*i + 0) * 127 + 128;
g = Math.sin(m*i + 2) * 127 + 128;
b = Math.sin(m*i + 4) * 127 + 128;
return 'rgb(' + Math.round(r) + ',' + Math.round(g) + ',' + Math.round(b) + ')';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment