// ==UserScript== // @name 成学课堂3.0 // @namespace http://tampermonkey.net/ // @version 3.1 // @description 成学课堂自动化控制面板,支持全自动视频控制、自动答题、自动提交作业等功能 // @author YourName // @match *://*.cx-online.net/* // @grant none // @run-at document-end // ==/UserScript== (function() { 'use strict'; // 检查是否已经注入了控制面板 if (window.autoControlPanelInjected) { return; } window.autoControlPanelInjected = true; // 创建并注入CSS样式 const style = document.createElement('style'); style.textContent = ` .auto-control-panel { position: fixed; top: 20px; right: 20px; width: 380px; background: white; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); z-index: 10000; font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; overflow: hidden; border: 1px solid #e1e5e9; } .panel-header { background: linear-gradient(135deg, #1E4EE7, #3A7BFF); color: white; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; cursor: move; } .panel-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; } .panel-controls { display: flex; gap: 8px; } .panel-btn { background: rgba(255, 255, 255, 0.2); border: none; color: white; width: 24px; height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s; } .panel-btn:hover { background: rgba(255, 255, 255, 0.3); } .panel-body { padding: 16px; max-height: 500px; overflow-y: auto; } .status-section { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; } .section-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #333; display: flex; align-items: center; gap: 6px; } .status-item { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; } .status-label { color: #666; } .status-value { font-weight: 500; color: #333; } .status-value.active { color: #1E4EE7; } .status-value.completed { color: #00a854; } .status-value.error { color: #f5222d; } .controls-section { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; } .control-btn { flex: 1; min-width: 150px; padding: 8px 12px; background: #f5f7fa; border: 1px solid #e1e5e9; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; } .control-btn:hover { background: #ebf0f5; } .control-btn.primary { background: #1E4EE7; color: white; border-color: #1E4EE7; } .control-btn.primary:hover { background: #3A7BFF; } .control-btn.danger { background: #f5222d; color: white; border-color: #f5222d; } .control-btn.danger:hover { background: #ff4d4f; } .control-btn.success { background: #00a854; color: white; border-color: #00a854; } .control-btn.success:hover { background: #00c853; } .control-btn.warning { background: #fa8c16; color: white; border-color: #fa8c16; } .control-btn.warning:hover { background: #ffa940; } .control-btn.info { background: #1890ff; color: white; border-color: #1890ff; } .control-btn.info:hover { background: #40a9ff; } .progress-section { margin-top: 16px; } .progress-bar { height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; margin-bottom: 8px; } .progress-fill { height: 100%; background: linear-gradient(90deg, #1E4EE7, #3A7BFF); border-radius: 3px; transition: width 0.3s ease; } .progress-text { font-size: 12px; color: #666; text-align: center; } .log-section { margin-top: 16px; max-height: 120px; overflow-y: auto; border: 1px solid #f0f0f0; border-radius: 6px; padding: 8px; background: #fafafa; } .log-entry { font-size: 12px; margin-bottom: 4px; padding: 4px; border-radius: 3px; background: white; } .log-time { color: #999; margin-right: 6px; } .log-info { color: #1890ff; } .log-success { color: #00a854; } .log-warning { color: #fa8c16; } .log-error { color: #f5222d; } .minimized .panel-body { display: none; } .minimized { width: 200px; } .platform-indicator { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; } .platform-pc { background: #52c41a; } .platform-mobile { background: #1890ff; } .auto-mode-section { background: #f0f7ff; border-radius: 8px; padding: 12px; margin-bottom: 16px; border: 1px solid #d1e9ff; } @media (max-width: 768px) { .auto-control-panel { width: 340px; right: 10px; top: 10px; } } `; document.head.appendChild(style); // 创建控制面板HTML const panelHTML = `