// ==UserScript== // @name 全能网页悬浮助手 (满血终极稳定版) // @namespace https://scriptcat.org/ // @version 5.0 // @description 完美修复拖拽与面板定位,全屏丝滑拖拽,智能翻转面板防出界 // @author You // @match *://*/* // @grant GM_setValue // @grant GM_getValue // @grant GM_xmlhttpRequest // @connect text.pollinations.ai // @connect * // @run-at document-idle // ==/UserScript== (function () { 'use strict'; if (window.top !== window.self) return; if (document.getElementById('cyber-assistant-host')) return; // ==================== 创建 Shadow DOM ==================== const host = document.createElement('div'); host.id = 'cyber-assistant-host'; host.style.cssText = 'position:fixed; top:0; left:0; width:0; height:0; z-index: 2147483647;'; document.documentElement.appendChild(host); const shadow = host.attachShadow({ mode: 'open' }); // ==================== 注入 CSS ==================== const style = document.createElement('style'); style.textContent = ` :host { all: initial; } * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; user-select: none; -webkit-tap-highlight-color: transparent; } .hidden { opacity: 0 !important; pointer-events: none !important; } #ball-wrapper { position: fixed; bottom: 50px; right: 30px; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 10000; cursor: grab; touch-action: none; /* 阻止手机端滚动 */ -webkit-touch-callout: none; /* 阻止长按弹菜单 */ } #ball-wrapper:active { cursor: grabbing; } #ball-time { font-size: 12px; font-weight: bold; color: #00d2ff; font-family: monospace; background: rgba(16, 23, 38, 0.85); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(0, 210, 255, 0.3); pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,0.3); } #float-ball { width: 50px; height: 50px; background: rgba(16, 23, 38, 0.85); backdrop-filter: blur(10px); border: 1px solid rgba(0, 210, 255, 0.4); border-radius: 50%; color: #00d2ff; font-size: 24px; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.5); transition: transform 0.2s; pointer-events: none; } #ball-wrapper:hover #float-ball { transform: scale(1.05); box-shadow: 0 0 15px rgba(0, 210, 255, 0.6); } #panel { position: fixed; width: 340px; height: 560px; background: rgba(7, 11, 20, 0.95); backdrop-filter: blur(12px); border: 1px solid rgba(0, 210, 255, 0.3); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.7); display: none; flex-direction: column; overflow: hidden; z-index: 9999; color: #e0e6ed; transition: opacity 0.2s; } #panel.open { display: flex; } /* ---- 手机端专属自适应布局 ---- */ @media (max-width: 600px) { #panel { width: 92vw !important; height: 75vh !important; left: 4vw !important; top: 12vh !important; right: auto !important; bottom: auto !important; transform: none !important; transition: top 0.3s ease; } .btn-arrow { padding: 8px 18px !important; font-size: 16px !important; } .time-num { width: 60px !important; font-size: 26px !important; } .nav-item { padding: 12px 0 !important; font-size: 14px !important; } input, button { font-size: 14px !important; } } .nav-tabs { display: flex; border-bottom: 1px solid rgba(0, 210, 255, 0.15); background: rgba(16, 23, 38, 0.5); } .nav-item { flex: 1; padding: 10px 0; text-align: center; font-size: 12px; cursor: pointer; color: #8a9bb8; transition: all 0.2s; } .nav-item.active { color: #00d2ff; border-bottom: 2px solid #00d2ff; background: rgba(0, 210, 255, 0.05); } .content-area { flex: 1; padding: 15px; overflow-y: auto; position: relative; -webkit-overflow-scrolling: touch; } .tab-pane { display: none; height: 100%; flex-direction: column; } .tab-pane.active { display: flex; } input, select { width: 100%; background: rgba(16, 23, 38, 0.8); border: 1px solid rgba(0, 210, 255, 0.2); color: #e0e6ed; border-radius: 8px; padding: 8px 12px; outline: none; font-size: 13px; transition: border 0.2s; user-select: text; } input:focus, select:focus { border-color: #00d2ff; box-shadow: 0 0 8px rgba(0, 210, 255, 0.3); } select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300d2ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); back// ==UserScript== // @name 全能网页悬浮助手 (满血终极稳定版) // @namespace https://scriptcat.org/ // @version 5.0 // @description 完美修复拖拽与面板定位,全屏丝滑拖拽,智能翻转面板防出界 // @author You // @match *://*/* // @grant GM_setValue // @grant GM_getValue // @grant GM_xmlhttpRequest // @connect text.pollinations.ai // @connect * // @run-at document-idle // ==/UserScript== (function () { 'use strict'; if (window.top !== window.self) return; if (document.getElementById('cyber-assistant-host')) return; // ==================== 创建 Shadow DOM ==================== const host = document.createElement('div'); host.id = 'cyber-assistant-host'; host.style.cssText = 'position:fixed; top:0; left:0; width:0; height:0; z-index: 2147483647;'; document.documentElement.appendChild(host); const shadow = host.attachShadow({ mode: 'open' }); // ==================== 注入 CSS ==================== const style = document.createElement('style'); style.textContent = ` :host { all: initial; } * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; user-select: none; -webkit-tap-highlight-color: transparent; } .hidden { opacity: 0 !important; pointer-events: none !important; } #ball-wrapper { position: fixed; bottom: 50px; right: 30px; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 10000; cursor: grab; touch-action: none; /* 阻止手机端滚动 */ -webkit-touch-callout: none; /* 阻止长按弹菜单 */ } #ball-wrapper:active { cursor: grabbing; } #ball-time { font-size: 12px; font-weight: bold; color: #00d2ff; font-family: monospace; background: rgba(16, 23, 38, 0.85); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(0, 210, 255, 0.3); pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,0.3); } #float-ball { width: 50px; height: 50px; background: rgba(16, 23, 38, 0.85); backdrop-filter: blur(10px); border: 1px solid rgba(0, 210, 255, 0.4); border-radius: 50%; color: #00d2ff; font-size: 24px; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.5); transition: transform 0.2s; pointer-events: none; } #ball-wrapper:hover #float-ball { transform: scale(1.05); box-shadow: 0 0 15px rgba(0, 210, 255, 0.6); } #panel { position: fixed; width: 340px; height: 560px; background: rgba(7, 11, 20, 0.95); backdrop-filter: blur(12px); border: 1px solid rgba(0, 210, 255, 0.3); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.7); display: none; flex-direction: column; overflow: hidden; z-index: 9999; color: #e0e6ed; transition: opacity 0.2s; } #panel.open { display: flex; } /* ---- 手机端专属自适应布局 ---- */ @media (max-width: 600px) { #panel { width: 92vw !important; height: 75vh !important; left: 4vw !important; top: 12vh !important; right: auto !important; bottom: auto !important; transform: none !important; transition: top 0.3s ease; } .btn-arrow { padding: 8px 18px !important; font-size: 16px !important; } .time-num { width: 60px !important; font-size: 26px !important; } .nav-item { padding: 12px 0 !important; font-size: 14px !important; } input, button { font-size: 14px !important; } } .nav-tabs { display: flex; border-bottom: 1px solid rgba(0, 210, 255, 0.15); background: rgba(16, 23, 38, 0.5); } .nav-item { flex: 1; padding: 10px 0; text-align: center; font-size: 12px; cursor: pointer; color: #8a9bb8; transition: all 0.2s; } .nav-item.active { color: #00d2ff; border-bottom: 2px solid #00d2ff; background: rgba(0, 210, 255, 0.05); } .content-area { flex: 1; padding: 15px; overflow-y: auto; position: relative; -webkit-overflow-scrolling: touch; } .tab-pane { display: none; height: 100%; flex-direction: column; } .tab-pane.active { display: flex; } input, select { width: 100%; background: rgba(16, 23, 38, 0.8); border: 1px solid rgba(0, 210, 255, 0.2); color: #e0e6ed; border-radius: 8px; padding: 8px 12px; outline: none; font-size: 13px; transition: border 0.2s; user-select: text; } input:focus, select:focus { border-color: #00d2ff; box-shadow: 0 0 8px rgba(0, 210, 255, 0.3); } select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300d2ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); back