Skip to content

Instantly share code, notes, and snippets.

@leplay
Last active November 20, 2016 14:58
Show Gist options
  • Save leplay/312f00b436d1557e5ebd4fbdce7f42f3 to your computer and use it in GitHub Desktop.
Save leplay/312f00b436d1557e5ebd4fbdce7f42f3 to your computer and use it in GitHub Desktop.
Github contribution marquee effect
// open someone's github page, and run this script in your console
var eles = $$('svg > g > g');
var shift = 0;
var marquee = setInterval(function() {
shift++;
for(var i = 0; i < eles.length; i++) {
var rectShift = 13 - i;
var x = ((i + shift) % eles.length) * 12 - rectShift + 13;
eles[i].setAttribute('transform', 'translate(' + x + ', 0)')
}
}, 100);
// open someone's github page, and run this script in your console
var eles = $$('svg > g > g');
var shift = 0;
var marquee = setInterval(function() {
shift++;
shift = shift > eles.length ? 0 : shift;
for(var i = 0; i < eles.length; i++) {
var rectShift = 13 - i;
var x = ((eles.length + i - shift) % eles.length)*12 + 13 - rectShift;
eles[i].setAttribute('transform', 'translate(' + x + ', 0)');
}
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment