Merge pull request #486 from chengzhongxue/main

宠物挂件点击效果
This commit is contained in:
困困鱼 2023-09-14 20:28:30 +08:00 committed by GitHub
commit 18a1afcd27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 14 deletions

View File

@ -34,9 +34,6 @@ let halo = {
return; return;
} }
const enable = GLOBAL_CONFIG.prism.enable; const enable = GLOBAL_CONFIG.prism.enable;
if (!enable) return; if (!enable) return;
const isEnableTitle = GLOBAL_CONFIG.prism.enable_title; const isEnableTitle = GLOBAL_CONFIG.prism.enable_title;
@ -133,9 +130,6 @@ let halo = {
return settings; return settings;
} }
var r = Prism.plugins.toolbar.hook = function (a) { var r = Prism.plugins.toolbar.hook = function (a) {
@ -181,8 +175,6 @@ let halo = {
} }
const prismToolsFn = function (e) { const prismToolsFn = function (e) {
const $target = e.target.classList; const $target = e.target.classList;
if ($target.contains("code-expander")) prismShrinkFn(this); if ($target.contains("code-expander")) prismShrinkFn(this);
@ -200,7 +192,6 @@ let halo = {
} }
const expandCode = function () { const expandCode = function () {
this.classList.toggle("expand-done"); this.classList.toggle("expand-done");
this.style.display = "none"; this.style.display = "none";
@ -217,9 +208,6 @@ let halo = {
r.offsetParent.appendChild(ele); r.offsetParent.appendChild(ele);
} }
const prismShrinkFn = ele => { const prismShrinkFn = ele => {
const $nextEle = r.offsetParent.lastElementChild.classList const $nextEle = r.offsetParent.lastElementChild.classList
toolbar.classList.toggle('c-expander') toolbar.classList.toggle('c-expander')
@ -269,7 +257,6 @@ let halo = {
document.head.appendChild(a) document.head.appendChild(a)
}, },
danmu: (url,token,maxBarrage)=>{ danmu: (url,token,maxBarrage)=>{
const e = new EasyDanmakuMin({ const e = new EasyDanmakuMin({
el: "#danmu", el: "#danmu",
@ -314,6 +301,11 @@ let halo = {
)) ))
} }
document.getElementById("danmuBtn").innerHTML = "<button class=\"hideBtn\" onclick=\"document.getElementById('danmu').classList.remove('hidedanmu')\">显示弹幕</button> <button class=\"hideBtn\" onclick=\"document.getElementById('danmu').classList.add('hidedanmu')\">隐藏弹幕</button>" document.getElementById("danmuBtn").innerHTML = "<button class=\"hideBtn\" onclick=\"document.getElementById('danmu').classList.remove('hidedanmu')\">显示弹幕</button> <button class=\"hideBtn\" onclick=\"document.getElementById('danmu').classList.add('hidedanmu')\">隐藏弹幕</button>"
},
changeMarginLeft(element) {
var randomMargin = Math.floor(Math.random() * 901) + 100; // 生成100-1000之间的随机数
element.style.marginLeft = randomMargin + 'px';
} }

View File

@ -8480,7 +8480,7 @@ li {
display: block; display: block;
position: absolute; position: absolute;
max-width: 270px; max-width: 270px;
z-index: 1; z-index: 2;
margin-top: -26.6px; margin-top: -26.6px;
margin-left: 5px; margin-left: 5px;
cursor: pointer cursor: pointer

View File

@ -33,6 +33,7 @@
</th:block> </th:block>
<img th:if="${theme.config.top.climb.climbEnable && theme.config.top.recentTop} " class="climb" id="climb" <img th:if="${theme.config.top.climb.climbEnable && theme.config.top.recentTop} " class="climb" id="climb"
th:src="${isLazyload ? loadingImg : theme.config.top.climb.climbImg}" th:src="${isLazyload ? loadingImg : theme.config.top.climb.climbImg}"
onclick="halo.changeMarginLeft(this)"
th:data-lazy-src="${ isLazyload ? theme.config.top.climb.climbImg : ''}"> th:data-lazy-src="${ isLazyload ? theme.config.top.climb.climbImg : ''}">
</div> </div>