Guest User

Untitled

a guest
Aug 20th, 2019
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // execute this script in the github's page console
  2. let colors = ['#196127', '#239a3b', '#7bc96f', '#c6e48b'];
  3. function getRandomColor() {
  4. let index = Math.floor(Math.random() * colors.length);
  5. return colors[index];
  6. }
  7.  
  8. document.addEventListener('contextmenu', e => {
  9. e.preventDefault();
  10. e.target.setAttribute('fill', getRandomColor())
  11. })
  12.  
  13. function clear() {
  14. let elements = Array.from(document.querySelectorAll('rect.day'));
  15. elements.forEach(el => el.setAttribute('fill', '#ebedf0'));
  16. }
RAW Paste Data