Skip to content

Instantly share code, notes, and snippets.

@karataev
Created August 8, 2019 12:48
Show Gist options
  • Save karataev/2dcb58e4e0fb28f5a7f773ceadc0ef4b to your computer and use it in GitHub Desktop.
Save karataev/2dcb58e4e0fb28f5a7f773ceadc0ef4b to your computer and use it in GitHub Desktop.
Draw images on github's profile contribution graph with right mouse clicks
// 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