SHARE
TWEET

Untitled

a guest Mar 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var colors = [ "#ededed", "rgb(172, 213, 242)", "rgb(127, 168, 201)", "rgb(82, 123, 160)", "rgb(37, 78, 119)" ];
  2. var currentColor = colors[0];
  3.  
  4. window.onkeydown = (ev) => { window.currentColor = (colors[parseInt(ev.key) - 1]); console.log(window.currentColor); };
  5.  
  6. var calendar = $(".contrib-calendar").first();
  7. var rawColls = calendar.children();
  8. for(let rawColl of rawColls) {
  9.     let coll = $(rawColl);
  10.     let rawRows = coll.children();
  11.     for(let rawRow of rawRows) {
  12.         let row = $(rawRow);
  13.         if(!row.hasClass("user-contrib-cell")) continue;
  14.        
  15.         row.on("click", function() {
  16.             this.setAttribute("fill", currentColor);
  17.         });
  18.        
  19.         rawRow.setAttribute("fill", currentColor);
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top