汇聚访-汇聚访-第42页
汇聚访的头像-汇聚访
UID:1 已加入汇聚访333天 总消费:0 徽章-身份唯一-汇聚访徽章-收藏新秀-汇聚访徽章-不败赞神-汇聚访11枚徽章河南省漯河市管理员
2026-02-11
02-11
子比主题 – F12顶部提示框效果美化-汇聚访

实用子比主题 – F12顶部提示框效果美化

这是一款给子比主题适配的网站顶部提示框,这款是从张洪Heo博客里复刻到子比主题的,其他主题应该也是可以正常使用的,相关提示颜色以及文字颜色都可在代码中进行修改,有需要的自行部署吧! 演示效果: 代码部署: [hidecontent type="payshow"] CSS代码JS代码 定位:子比主题设置–>>自定义代码–>>自定义 CSS 样式添加以下代码即可: #huijuf_dev-tool-alert{position:fixed;top:0;left:0;width:100%;height:60px;z-index:9998;overflow:hidden;background-color:#425aef;display:flex;align-items:center;justify-content:center;transform:translateY(-100%);transition:transform .5s ease-out}#huijuf_dev-tool-alert.huijuf_show{transform:translateY(0)}#huijuf_dev-tool-alert.huijuf_exit{transform:translateY(-100%);transition:transform .3s ease-in}.huijuf_alert-content{color:#fff;font-size:18px;font-weight:500;text-align:center;padding:0 20px} 定位:后台子比主题设置–>>自定义代码–>>自定义 javascript中添加以下代码: function huijuf_createAlert(){if(document.getElementById('huijuf_dev-tool-alert'))return;const huijuf_alert=document.createElement('div');huijuf_alert.id='huijuf_dev-tool-alert';const huijuf_content=document.createElement('div');huijuf_content.className='huijuf_alert-content';huijuf_content.textContent='开发者模式已打开,请遵循协议';huijuf_alert.appendChild(huijuf_content);document.body.appendChild(huijuf_alert);return huijuf_alert}let huijuf_alertShown=false;let huijuf_hideTimeout=null;function huijuf_showAlert(){if(huijuf_alertShown)return;const huijuf_devToolAlert=huijuf_createAlert();huijuf_alertShown=true;huijuf_devToolAlert.classList.remove('huijuf_exit');setTimeout(()=>{huijuf_devToolAlert.classList.add('huijuf_show')},10);setTimeout(()=>{huijuf_hideAlert()},2500)}function huijuf_hideAlert(){if(huijuf_hideTimeout){clearTimeout(huijuf_hideTimeout);huijuf_hideTimeout=null}const huijuf_devToolAlert=document.getElementById('huijuf_dev-tool-alert');if(!huijuf_devToolAlert)return;huijuf_devToolAlert.classList.add('huijuf_exit');huijuf_hideTimeout=setTimeout(()=>{huijuf_devToolAlert.classList.remove('huijuf_show');huijuf_devToolAlert.classList.remove('huijuf_exit');huijuf_alertShown=false;huijuf_devToolAlert.remove()},300)}document.addEventListener('keydown',function(huijuf_event){if(huijuf_event.keyCode===123){huijuf_showAlert();return false}}); [/hidecontent]
19天前
欢迎光临~
热评