// ==UserScript== // @name 動漫網站自動跳轉 用AI寫的 // @namespace http://tampermonkey.net/ // @version 3.2 // @license MIT // @description 重點強化文字顏色自定義,支援分:秒顯示與拖動開關 // @match *://www.ntdm8.com/play/* // @match *://www.agedm.io/play/* // @match *://www.857fans.com/play/* // @match *://*.ntdm8.com/* // @match *://*.agefans.*/* // @match *://*.agemys.*/* // @match *://*.agedm.*/* // @match *://*.agefans.tv/* // @match *://*.sp-flv.com/* // @match *://*.ejtsyc.com/* // @match *://*.yhdmjx.com/* // @grant GM_setValue // @grant GM_getValue // @grant GM_registerMenuCommand // @run-at document-end // @allFrames true // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 核心數據讀取 const getTargetSeconds = () => Math.round(GM_getValue('skip_seconds', 90)); const isEnabled = () => GM_getValue('auto_skip_enabled', true); const getTextColor = () => GM_getValue('text_color', '#000000'); // 預設文字為黑色 const formatTime = (seconds) => { const m = Math.floor(seconds / 60); const s = seconds % 60; return `${m}:${s < 10 ? '0' : ''}${s}`; }; // 註冊選單命令 GM_registerMenuCommand("🎨 更改文字顏色", setTextColor); GM_registerMenuCommand("⚙️ 設定跳轉時間", setSkipTime); function setTextColor() { const currentCol = getTextColor(); const newCol = prompt(`請輸入文字顏色 (名稱或代碼)\n例如: blue, red, #00ff00, orange`, currentCol); if (newCol) { GM_setValue('text_color', newCol); location.reload(); } } function setSkipTime() { const currentSec = getTargetSeconds(); const input = prompt(`請輸入要跳過的總秒數:`, currentSec); if (input !== null && !isNaN(input)) updateSkipTime(parseInt(input)); } function updateSkipTime(newSeconds) { if (newSeconds < 0) newSeconds = 0; GM_setValue('skip_seconds', newSeconds); const textBtn = document.getElementById('skip-text-btn'); if (textBtn) textBtn.innerText = `跳轉: ${formatTime(newSeconds)}`; } // --- UI 繪製 --- const createUI = () => { if (window.self !== window.top) return; if (document.getElementById('skip-config-container')) return; const color = getTextColor(); const container = document.createElement('div'); container.id = 'skip-config-container'; const savedPos = GM_getValue('btn_pos', { right: '20px', bottom: '100px' }); const active = isEnabled(); container.style = ` position: fixed; right: ${savedPos.right}; bottom: ${savedPos.bottom}; left: ${savedPos.left}; top: ${savedPos.top}; z-index: 999999; background: rgba(255, 255, 255, 0.9); padding: 8px 15px; border-radius: 50px; cursor: move; box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-size: 15px; font-family: "Microsoft JhengHei", sans-serif; font-weight: 900; display: flex; align-items: center; border: 2px solid ${color}; gap: 12px; user-select: none; `; // 內部組件全部套用 color 變數 container.innerHTML = `