GitHub Halloween

Experience Halloween every day

当前为 2017-01-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name GitHub Halloween
  3. // @namespace https://github.com/KeyWeeUsr/Userscripts
  4. // @version 0.4
  5. // @description Experience Halloween every day
  6. // @author Peter Badida
  7. // @copyright 2016+, Peter Badida
  8. // @license GNU GPLv3
  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. // ==/UserScript==
  17. /* jshint -W097 */
  18. 'use strict';
  19. (function () {
  20. var items = document.getElementsByClassName("day");
  21. var dayFill;
  22. for (var i=0; i < items.length; i++) {
  23. dayFill = $(items[i]).attr('fill');
  24. if (dayFill == "#1e6823") {
  25. $(items[i]).attr('fill', '#03001C');
  26. } else if (dayFill == "#44a340") {
  27. $(items[i]).attr('fill', '#FE9600');
  28. } else if (dayFill == "#8cc665") {
  29. $(items[i]).attr('fill', '#FFC501');
  30. } else if (dayFill == "#d6e685") {
  31. $(items[i]).attr('fill', '#FFEE4A');
  32. } else {
  33. $(items[i]).attr('fill', '#EEEEEE');
  34. }
  35. }
  36.  
  37. var css = '\
  38. ul.legend > li {\
  39. background-color: #EEEEEE !important;\
  40. }\
  41. ul.legend > li + li {\
  42. background-color: #FFEE4A !important;\
  43. }\
  44. ul.legend > li + li + li {\
  45. background-color: #FFC501 !important;\
  46. }\
  47. ul.legend > li + li + li + li {\
  48. background-color: #FE9600 !important;\
  49. }\
  50. ul.legend > li + li + li + li + li {\
  51. background-color: #03001C !important;\
  52. }';
  53. GM_addStyle(css);
  54. })();
  55. /*
  56. Notify me if there's something missing/undesirable.
  57. */