汇聚访-汇聚访
汇聚访的头像-汇聚访
UID:1 已加入汇聚访321天 总消费: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]
2026-01-31
01-31
子比主题 - 给日夜切换按钮添加下拉菜单-汇聚访

实用子比主题 – 给日夜切换按钮添加下拉菜单

这是一款给子比主题的顶部导航栏日夜切换按钮添加的下拉多选菜单,部署完此功能后,每次选中日夜切换按钮时就会出现相关下拉选项,并且还有相关记忆模式,手机版也可用,有需要的朋友自行部署吧! 演示效果: 代码部署: [hidecontent type="payshow"] CSS代码JS代码 定位:子比主题设置–>>自定义代码–>>自定义 CSS 样式添加以下代码即可: .theme-toggle-dropdown{position:relative;display:inline-block}.theme-toggle-dropdown-btn{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .3s ease}.theme-toggle-dropdown-btn .theme-icon{display:inline-flex;align-items:center;font-size:16px;line-height:1}.theme-toggle-dropdown-btn:hover{opacity:.8}.theme-mode-menu{min-width:140px;padding:4px 0;margin-top:6px;background:var(--body-bg-color,#fff);border:1px solid var(--border-color,#e5e5e5);border-radius:6px;box-shadow:0 2px 8px rgba(0,0,0,.1);z-index:9999}.dark-theme .theme-mode-menu{background:var(--body-bg-color,#1a1a1a);border-color:var(--border-color,#333);box-shadow:0 2px 8px rgba(0,0,0,.3)}.theme-mode-option{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;transition:background-color .2s ease;position:relative;border-radius:4px}.theme-mode-option:hover{background:var(--main-bg-color,#f5f5f5)}.dark-theme .theme-mode-option:hover{background:var(--main-bg-color,#252525)}.theme-mode-option.active{background:var(--theme-color-light,rgba(33,150,243,.1))}.dark-theme .theme-mode-option.active{background:var(--theme-color-light,rgba(33,150,243,.2))}.theme-mode-option .mode-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;background:var(--main-bg-color,#f5f5f5);border-radius:4px;font-size:13px;flex-shrink:0;transition:all .2s ease}.dark-theme .theme-mode-option .mode-icon{background:var(--main-bg-color,#252525)}.theme-mode-option:hover .mode-icon{transform:scale(1.05)}.theme-mode-option[data-mode=white-theme] .mode-icon{color:orange}.theme-mode-option[data-mode=dark-theme]...
18天前
欢迎光临~
热评