Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var colors = [ "#ededed", "rgb(172, 213, 242)", "rgb(127, 168, 201)", "rgb(82, 123, 160)", "rgb(37, 78, 119)" ];
- var currentColor = colors[0];
- window.onkeydown = (ev) => { window.currentColor = (colors[parseInt(ev.key) - 1]); console.log(window.currentColor); };
- var calendar = $(".contrib-calendar").first();
- var rawColls = calendar.children();
- for(let rawColl of rawColls) {
- let coll = $(rawColl);
- let rawRows = coll.children();
- for(let rawRow of rawRows) {
- let row = $(rawRow);
- if(!row.hasClass("user-contrib-cell")) continue;
- row.on("click", function() {
- this.setAttribute("fill", currentColor);
- });
- rawRow.setAttribute("fill", currentColor);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement