Created
August 8, 2019 12:48
-
-
Save karataev/2dcb58e4e0fb28f5a7f773ceadc0ef4b to your computer and use it in GitHub Desktop.
Draw images on github's profile contribution graph with right mouse clicks
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
// execute this script in the github's page console | |
let colors = ['#196127', '#239a3b', '#7bc96f', '#c6e48b']; | |
function getRandomColor() { | |
let index = Math.floor(Math.random() * colors.length); | |
return colors[index]; | |
} | |
document.addEventListener('contextmenu', e => { | |
e.preventDefault(); | |
e.target.setAttribute('fill', getRandomColor()) | |
}) | |
function clear() { | |
let elements = Array.from(document.querySelectorAll('rect.day')); | |
elements.forEach(el => el.setAttribute('fill', '#ebedf0')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment