Skip to content

Commit

Permalink
feat(prosperous): 添加富强民主上升文字鼠标点击特效
Browse files Browse the repository at this point in the history
  • Loading branch information
nineya committed Dec 4, 2023
1 parent 28746ab commit 3b34374
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,8 @@ enhance:
label: 烟花特效
- value: granule
label: 粒子爆炸
- value: prosperous
label: 富强民主
enable_sw:
name: enable_sw
label: "启用 Service Worker 优化"
Expand Down
1 change: 1 addition & 0 deletions source/css/cursor.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions source/js/cursor/click/prosperous.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions src/js/cursor/click/prosperous.js
Original file line number Diff line number Diff line change
@@ -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()
})
})
})

0 comments on commit 3b34374

Please sign in to comment.