// ==UserScript== // @name 【微信文件传输登陆保存】— 登录助手 (WeUI 优化版) // @namespace https://greasyfork.org/zh-CN/users/927947-witchery // @version 2.0.1 // @description 界面全面重构:采用微信原生 WeUI 风格,仅保留登录保存与恢复功能,仅在 szfilehelper 生效。 // @author witcher (Modified by AI) // @match https://szfilehelper.weixin.qq.com/* // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle // @require https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js // ==/UserScript== (function () { // 严格限制运行域名 if (!location.href.startsWith("https://szfilehelper.weixin.qq.com/")) { return; } const ver = '2.0.0-weui'; const WECHAT_GREEN = '#07C160'; const WECHAT_RED = '#FA5151'; const WECHAT_BLUE = '#10AEFF'; const BG_COLOR = '#F7F7F7'; // 注入样式 const style = document.createElement('style'); style.textContent = ` @import url('https://fonts.googleapis.com/css2?family=PingFang+SC:wght@400;500;600&display=swap'); :root { --wx-green: ${WECHAT_GREEN}; --wx-red: ${WECHAT_RED}; --wx-blue: ${WECHAT_BLUE}; --wx-bg: ${BG_COLOR}; } /* 侧边面板 */ .login-tool-panel { background: #ffffff; width: 0px; height: 70%; position: fixed; z-index: 99999; top: 15%; left: 0; overflow: hidden; transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 4px 0px 20px rgba(0,0,0,0.08); border-radius: 0 12px 12px 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif; display: flex; flex-direction: column; } /* 面板头部 */ .panel-header { padding: 20px 25px; border-bottom: 1px solid #f0f0f0; background: #fff; min-width: 280px; } .panel-title { font-size: 18px; font-weight: 600; color: #333; margin: 0; display: flex; align-items: center; gap: 8px; } .panel-title i { color: var(--wx-green); } .panel-subtitle { font-size: 12px; color: #999; margin-top: 5px; } /* 内容区域 */ .panel-body { padding: 20px 25px; flex: 1; overflow-y: auto; min-width: 280px; background: #fafafa; } /* 按钮组 */ .action-group { display: flex; flex-direction: column; gap: 15px; } .tool-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 0; border: none; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; position: relative; overflow: hidden; color: white; box-shadow: 0 2px 6px rgba(0,0,0,0.1); } .tool-btn:active { transform: scale(0.98); } .tool-btn:hover { opacity: 0.9; box-shadow: 0 4px 12px rgba(0,0,0,0.15); } .btn-save { background: linear-gradient(135deg, #07C160 0%, #06AD56 100%); } .btn-restore { background: linear-gradient(135deg, #10AEFF 0%, #0099E0 100%); } .btn-clear { background: linear-gradient(135deg, #FA5151 0%, #E04545 100%); } /* 悬浮开关 */ .tool-toggle-btn { position: fixed; left: 0; top: 75%; z-index: 99998; background: var(--wx-green); color: white; padding: 10px 14px; border-radius: 0 8px 8px 0; cursor: pointer; box-shadow: 2px 2px 10px rgba(0,0,0,0.15); font-size: 13px; font-weight: 600; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); display: flex; align-items: center; gap: 6px; user-select: none; } .tool-toggle-btn:hover { background: #06AD56; } /* Toast 提示 */ .toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: rgba(0,0,0,0.75); color: white; padding: 10px 20px; border-radius: 50px; font-size: 14px; z-index: 100000; transition: transform 0.3s ease; backdrop-filter: blur(4px); display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); } .toast-show { transform: translateX(-50%) translateY(0); } /* 版本信息 */ .version-info { text-align: center; font-size: 11px; color: #ccc; margin-top: auto; padding-bottom: 10px; min-width: 280px; } `; document.head.appendChild(style); // 构建 HTML const panelHTML = `