GitHub Halloween

Experience Halloween every day

  1. // ==UserScript==
  2. // @name GitHub Halloween
  3. // @namespace https://github.com/KeyWeeUsr/Userscripts
  4. // @version 0.6
  5. // @description Experience Halloween every day
  6. // @author Peter Badida
  7. // @copyright 2016+, Peter Badida
  8. // @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
  9. // @homepage https://github.com/KeyWeeUsr/Userscripts/tree/master/Halloween
  10. // @supportURL https://github.com/KeyWeeUsr/Userscripts/issues
  11. // @icon https://github.com/favicon.ico
  12. // @include https://*github.com/*
  13. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  14. // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ACVM74AYCXVWQ
  15. // @grant GM_addStyle
  16. // @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
  17. // ==/UserScript==
  18. /* jshint -W097 */
  19. 'use strict';
  20. (function () {
  21. var items = document.getElementsByClassName("day");
  22. var dayFill;
  23. for (var i=0; i < items.length; i++) {
  24. dayFill = $(items[i]).attr('fill');
  25. if (dayFill == "#196127") {
  26. $(items[i]).attr('fill', '#03001C');
  27. } else if (dayFill == "#239a3b") {
  28. $(items[i]).attr('fill', '#FE9600');
  29. } else if (dayFill == "#7bc96f") {
  30. $(items[i]).attr('fill', '#FFC501');
  31. } else if (dayFill == "#c6e48b") {
  32. $(items[i]).attr('fill', '#FFEE4A');
  33. } else {
  34. $(items[i]).attr('fill', '#EEEEEE');
  35. }
  36. }
  37.  
  38. var css = '\
  39. ul.legend > li {\
  40. background-color: #EEEEEE !important;\
  41. }\
  42. ul.legend > li + li {\
  43. background-color: #FFEE4A !important;\
  44. }\
  45. ul.legend > li + li + li {\
  46. background-color: #FFC501 !important;\
  47. }\
  48. ul.legend > li + li + li + li {\
  49. background-color: #FE9600 !important;\
  50. }\
  51. ul.legend > li + li + li + li + li {\
  52. background-color: #03001C !important;\
  53. }';
  54. GM_addStyle(css);
  55. })();
  56. /*
  57. Notify me if there's something missing/undesirable.
  58. */