Typecho悬浮按钮插件

预览

1000064076

用惯了WordPress,之前使用的主题移动端基本都带底部导航,看习惯了,换成Typecho搭配oneblog主题之后,移动端底部没有导航栏,不太习惯,自己瞎捣鼓了一个,感介又不太好看,索性加了一个悬浮球装饰。
功能比较简单,支持左右两个位置自定义选择,目前是加了3个子悬浮球,太多了也不美观,个人感觉3个刚刚好,可以自定义开启。
图标建议使用阿里图标库,直接下载PNG透明图标使用即可。
图标链接直接填写URL或者你需要的JS事件。

推荐js使用

javascript:window.location.href='mqqwpa://im/chat?chat_type=wpa&uin=你的QQ&version=1&src_type=web&web_src=oicqzone.com';

图片弹出

javascript:(()=>{const existing=document.getElementById('popupContainer');if(existing)existing.remove();else{const container=document.createElement('div');container.id='popupContainer';container.style.position='fixed';container.style.top='0';container.style.left='0';container.style.width='100%';container.style.height='100%';container.style.zIndex='9998';container.onclick=()=>container.remove();const img=document.createElement('img');img.src='你的图片地址';img.style.position='fixed';img.style.top='50%';img.style.left='50%';img.style.transform='translate(-50%, -50%)';img.style.zIndex='9999';img.style.boxShadow='0 0 20px rgba(0,0,0,0.3)';img.style.maxWidth='90%';img.style.maxHeight='90vh';img.onclick=e=>e.stopPropagation();container.appendChild(img);document.body.appendChild(container);}})();

插件设置

1000064074

请登录后发表评论

    没有回复内容