Mouse click effects

Mouse click effects.

  1. // ==UserScript==
  2. // @name Mouse click effects
  3. // @auther miraku
  4. // @version 0.3
  5. // @description Mouse click effects.
  6. // @namespace https://greasyfork.org/zh-CN/users/144063-miraku
  7. // @include *
  8. // ==/UserScript==
  9. /**
  10. * @name onclick
  11. * @auther miraku
  12. * @description effects of click
  13. */
  14.  
  15. (function() {
  16. var random_num = 0;
  17. var colors = ["#DC9FB4", "#E16BBC", "#F4A7B9", "#F596AA", "#FEDFE1"];
  18. jQuery(document).ready(function($) {
  19. $("html").click(function(nowp) {
  20. var x = nowp.pageX,
  21. y = nowp.pageY;
  22. var fsize = 18;
  23. var $click_dot;
  24. random_num = Math.round(Math.random() * 50);
  25. switch (random_num) {
  26. case 0:
  27. $click_dot = $("<b></b>").text("( ̄▽ ̄)");
  28. // statements_1
  29. break;
  30. case 1:
  31. $click_dot = $("<b></b>").text("(o゚v゚)ノ");
  32. // statements_1
  33. break;
  34. case 2:
  35. $click_dot = $("<b></b>").text("ε=ε=ε=(~ ̄▽ ̄)~");
  36. // statements_1
  37. break;
  38. case 3:
  39. $click_dot = $("<b></b>").text("o((>ω< ))o");
  40. // statements_1
  41. break;
  42. case 4:
  43. $click_dot = $("<b></b>").text("= ̄ω ̄=");
  44. // statements_1
  45. break;
  46. case 5:
  47. $click_dot = $("<b></b>").text("(。>︿<)_θ");
  48. // statements_1
  49. break;
  50. case 6:
  51. $click_dot = $("<b></b>").text("o(* ̄︶ ̄*)o");
  52. // statements_1
  53. break;
  54. case 7:
  55. $click_dot = $("<b></b>").text("(づ ̄3 ̄)づ╭❤~");
  56. // statements_1
  57. break;
  58. case 8:
  59. $click_dot = $("<b></b>").text("(☆▽☆)");
  60. // statements_1
  61. break;
  62. case 9:
  63. $click_dot = $("<b></b>").text("?");
  64. fsize = Math.round(Math.random() * 14 + 6);
  65. break;
  66. default:
  67. $click_dot = $("<b></b>").text("❤");
  68. fsize = Math.round(Math.random() * 14 + 6);
  69. // statements_def
  70. break;
  71. }
  72. $click_dot.css({
  73. "-moz-user-select": "none",
  74. "-webkit-user-select": "none",
  75. "-ms-user-select": "none",
  76. "z-index": 1008,
  77. "top": y - 20,
  78. "left": x,
  79. "position": "absolute",
  80. "color": colors[Math.round(Math.random() * 5)],
  81. "font-size": fsize
  82. });
  83. $("body").append($click_dot);
  84. $click_dot.animate({
  85. "top": y - 200,
  86. "opacity": 0
  87. }, 1500, function() {
  88. $click_dot.remove();
  89. });
  90. });
  91. });
  92. })();