mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 15:29:41 +08:00
feat(prosperous): 添加富强民主上升文字鼠标点击特效,#71
This commit is contained in:
parent
74c40244a3
commit
649400ba17
@ -977,6 +977,8 @@ spec:
|
||||
label: 烟花特效
|
||||
- value: granule
|
||||
label: 粒子爆炸
|
||||
- value: prosperous
|
||||
label: 富强民主
|
||||
- $formkit: radio
|
||||
name: enable_sw
|
||||
label: "启用 Service Worker 优化"
|
||||
|
23
src/js/cursor/click/prosperous.js
Normal file
23
src/js/cursor/click/prosperous.js
Normal file
@ -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()
|
||||
})
|
||||
})
|
||||
})
|
1
templates/assets/js/cursor/click/prosperous.min.js
vendored
Normal file
1
templates/assets/js/cursor/click/prosperous.min.js
vendored
Normal file
@ -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()})})})})();
|
Loading…
x
Reference in New Issue
Block a user