打开/关闭搜索
搜索
打开/关闭菜单
1
40
1
326
末世录
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
上传文件
末世录
角色
国家
教派
我想嗦牛子
嗦塞尔达牛子
嗦萨图恩牛子
嗦奥利奥头牛子
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁MediaWiki:Citizen.js”︁的源代码
MediaWiki界面页面
查看
阅读
查看源代码
查看历史
associated-pages
系统消息
讨论
更多操作
←
MediaWiki:Citizen.js
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
此页面为本wiki上的软件提供界面文本,并受到保护以防止滥用。 如欲修改所有wiki的翻译,请访问
translatewiki.net
上的MediaWiki本地化项目。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您可以查看和复制此页面的源代码。
/* 这里所有JavaScript都会加载给Citizen皮肤的用户 */ (function() { if( window.magneticCursorInit ) return; window.magneticCursorInit = true; mw.loader.using( [], function() { // 创建四角光标 const ptr = document.createElement('div'); ptr.className = 'magnetic-true-corner'; ptr.innerHTML = `<i></i><i></i><i></i><i></i>`; document.body.appendChild(ptr); // 强制覆盖样式:纯四角镂空,永不方块 const css = document.createElement('style'); css.textContent = ` .magnetic-true-corner{ position:fixed;left:0;top:0; width:0;height:0; pointer-events:none;z-index:999999!important; transition:none;will-change:left,top; } .magnetic-true-corner i{ position:absolute;width:14px;height:14px; border:2px solid #17f700;border-radius:2px; background:transparent!important;box-shadow:none!important; } .magnetic-true-corner i:nth-child(1){top:-2px;left:-2px;border-right:none;border-bottom:none;} .magnetic-true-corner i:nth-child(2){top:-2px;right:-2px;border-left:none;border-bottom:none;} .magnetic-true-corner i:nth-child(3){bottom:-2px;left:-2px;border-right:none;border-top:none;} .magnetic-true-corner i:nth-child(4){bottom:-2px;right:-2px;border-left:none;border-top:none;} `; document.head.appendChild(css); let hoverEl = null; let mx=0,my=0; // 鼠标实时位置 document.addEventListener('mousemove',e=>{mx=e.clientX;my=e.clientY;}); // 帧更新:精准贴元素四角 function loop(){ if(hoverEl){ const r = hoverEl.getBoundingClientRect(); ptr.style.left = r.left + 'px'; ptr.style.top = r.top + 'px'; ptr.style.width = r.width + 'px'; ptr.style.height = r.height + 'px'; }else{ // 跟随鼠标缩小光标 ptr.style.left = (mx - 20) + 'px'; ptr.style.top = (my - 20) + 'px'; ptr.style.width = '40px'; ptr.style.height = '40px'; } requestAnimationFrame(loop); } loop(); // ✅ Citizen 皮肤【官方原生真实选择器】一个不漏 const sel = [ '.citizen-nav a', '.citizen-menu a', '.citizen-button', '.citizen-action-button', '.cdx-button', '.mw-editsection a', '#citizen-header__nav a', '.citizen-sidebar a' ].join(','); // 绑定+防重复 function bind(){ document.querySelectorAll(sel).forEach(el=>{ if(el._magBind)return; el._magBind=1; el.onmouseenter=()=>hoverEl=el; el.onmouseleave=()=>hoverEl=null; }); } bind(); new MutationObserver(bind).observe(document.body,{childList:true,subtree:true}); }); })();
返回
MediaWiki:Citizen.js
。
查看“︁MediaWiki:Citizen.js”︁的源代码
MediaWiki界面页面