Last active
November 20, 2016 14:58
-
-
Save leplay/312f00b436d1557e5ebd4fbdce7f42f3 to your computer and use it in GitHub Desktop.
Github contribution marquee effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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