diff --git a/settings.yaml b/settings.yaml index 1919f42..33382d6 100644 --- a/settings.yaml +++ b/settings.yaml @@ -977,6 +977,8 @@ spec: label: 烟花特效 - value: granule label: 粒子爆炸 + - value: prosperous + label: 富强民主 - $formkit: radio name: enable_sw label: "启用 Service Worker 优化" diff --git a/src/js/cursor/click/prosperous.js b/src/js/cursor/click/prosperous.js new file mode 100644 index 0000000..d19140d --- /dev/null +++ b/src/js/cursor/click/prosperous.js @@ -0,0 +1,23 @@ +var a_idx = 0 +jQuery(document).ready(function ($) { + $('body').click(function (e) { + var a = ['富强', '民主', '文明', '和谐', '自由', '平等', '公正', '法治', '爱国', '敬业', '诚信', '友善'] + var $i = $('<span/>').text(a[a_idx]) + a_idx = (a_idx + 1) % a.length + var x = e.pageX, y = e.pageY + let scrolly = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop + y = y - scrolly + $i.css({ + 'z-index': 999, + 'top': y - 20, + 'left': x, + 'position': 'fixed', + 'font-weight': 'bold', + 'color': /*"#ff6651" 随机颜色写法:*/ 'rgb(' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ')' + }) + $('body').append($i) + $i.animate({'top': y - 180, 'opacity': 0}, 1500, function () { + $i.remove() + }) + }) +}) \ No newline at end of file diff --git a/templates/assets/js/cursor/click/prosperous.min.js b/templates/assets/js/cursor/click/prosperous.min.js new file mode 100644 index 0000000..5b7f8b2 --- /dev/null +++ b/templates/assets/js/cursor/click/prosperous.min.js @@ -0,0 +1 @@ +(()=>{var a=0;jQuery(document).ready(function(n){n("body").click(function(o){var t=["富强","民主","文明","和谐","自由","平等","公正","法治","爱国","敬业","诚信","友善"],e=n("<span/>").text(t[a]),t=(a=(a+1)%t.length,o.pageX),o=o.pageY;o-=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,e.css({"z-index":999,top:o-20,left:t,position:"fixed","font-weight":"bold",color:"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}),n("body").append(e),e.animate({top:o-180,opacity:0},1500,function(){e.remove()})})})})(); \ No newline at end of file