Skip to content

Instantly share code, notes, and snippets.

@lelinhtinh
Created June 28, 2015 06:45
Show Gist options
  • Save lelinhtinh/e8927fca19acea5ab9f1 to your computer and use it in GitHub Desktop.
Save lelinhtinh/e8927fca19acea5ab9f1 to your computer and use it in GitHub Desktop.
colorrun hack
// http://colorrun.pl/
// This is fun! ^^
// by Zzbaivong
var $c1 = document.getElementById("color-1"),
$c2 = document.getElementById("color-2"),
c1,
c2,
colorrun = function() {
c1 = parseInt($c1.style.backgroundColor.match(/\d+/)[0], 10);
c2 = parseInt($c2.style.backgroundColor.match(/\d+/)[0], 10);
console.log(c1 + "|" + c2);
c1 > c2 ? $c1.click() : $c2.click();
};
var loop = setInterval(function() {
colorrun();
}, 1);
document.getElementsByClassName('play')[0].click();
// clearInterval(loop);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment