Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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'));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement