打开/关闭搜索
搜索
打开/关闭菜单
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() { mw.loader.using('jquery', function() { $(function() { if (document.querySelector('.magnetic-pointer-original')) return; // 光标 DOM const pointer = document.createElement('div'); pointer.className = 'magnetic-pointer-original'; pointer.innerHTML = '<div></div><div></div><div></div><div></div>'; document.body.appendChild(pointer); // 样式:纯空心四角角标 const style = document.createElement('style'); style.textContent = ` .magnetic-pointer-original { --width: 48px; --height: 48px; position: fixed; top: 0; left: 0; width: var(--width); height: var(--height); transform-origin: center center; transition: transform 0.22s ease, width 0.22s ease, height 0.22s ease; pointer-events: none !important; z-index: 999999 !important; will-change: transform, width, height; } .magnetic-pointer-original div { position: absolute; width: 12px; height: 12px; border-color: #17f700; background: transparent !important; box-sizing: border-box; } .magnetic-pointer-original div:nth-child(1) { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; } .magnetic-pointer-original div:nth-child(2) { top: 0; right: 0; border-top: 2px solid; border-right: 2px solid; } .magnetic-pointer-original div:nth-child(3) { bottom: 0; left: 0; border-bottom: 2px solid; border-left: 2px solid; } .magnetic-pointer-original div:nth-child(4) { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; } `; document.head.appendChild(style); let target = null; let mouseX = 0, mouseY = 0; let cursorX = 0, cursorY = 0; // 鼠标位置实时更新 window.addEventListener('mousemove', (e) => { mouseX = e.clientX; mouseY = e.clientY; }); // 平滑跟随循环 function update() { if (target) { const rect = target.getBoundingClientRect(); const cx = rect.left + rect.width / 2; const cy = rect.top + rect.height / 2; cursorX += (cx - cursorX) * 0.2; cursorY += (cy - cursorY) * 0.2; pointer.style.width = rect.width + 12 + 'px'; pointer.style.height = rect.height + 12 + 'px'; } else { cursorX += (mouseX - cursorX) * 0.25; cursorY += (mouseY - cursorY) * 0.25; pointer.style.width = '48px'; pointer.style.height = '48px'; } pointer.style.transform = `translate(${cursorX - pointer.offsetWidth/2}px, ${cursorY - pointer.offsetHeight/2}px)`; requestAnimationFrame(update); } update(); // 👇 这是 Citizen 皮肤真正的按钮选择器(全覆盖) const citizenSelectors = [ ".citizen-button", ".citizen-ui-btn", ".citizen-nav__item a", ".citizen-menu__item a", "#citizen-header a", "#citizen-sidebar a", "a.citizen-button", "button.citizen-button", ".mw-editsection a", ".mw-ui-button", ".citizen-btn" ].join(","); function bind() { document.querySelectorAll(citizenSelectors).forEach(el => { if (el._magnet) return; el._magnet = 1; el.addEventListener("mouseenter", () => { target = el; }); el.addEventListener("mouseleave", () => { target = null; }); }); } bind(); new MutationObserver(bind).observe(document.body, { childList: true, subtree: true }); }); }); })();
返回
MediaWiki:Citizen.js
。
查看“︁MediaWiki:Citizen.js”︁的源代码
MediaWiki界面页面