// ==UserScript== // @name 秒过2025年智慧中小学寒假教师研修学习助手 // @namespace http://tampermonkey.net/ // @version 1.10 // @description 智慧中小学自动学习工具 // @author Your name // @match https://auth.smartedu.cn/* // @match https://www.smartedu.cn/* // @match https://basic.smartedu.cn/* // @grant GM_xmlhttpRequest // @copyright // @license CUSTOM // @connect zhihuizhongxiaoxue.a1.luyouxia.net // ==/UserScript== (function() { 'use strict'; // 等待DOM加载完成 function initHelper() { if (document.readyState !== 'complete') { window.addEventListener('load', createHelper); } else { createHelper(); } } // 将原有的DOM创建和样式添加逻辑封装到函数中 function createHelper() { // 检查是否已经存在助手界面 if (document.querySelector('.study-helper') || document.querySelector('.show-helper-button')) { return; } // 创建样式 const style = document.createElement('style'); style.textContent = ` .study-helper { position: fixed; top: 20px; right: 20px; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 300px; z-index: 10000; } .helper-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; } .helper-header h2 { margin: 0; color: #333; font-size: 18px; } .hide-button { background: none; border: none; color: #666; font-size: 20px; cursor: pointer; padding: 0 5px; width: auto !important; } .hide-button:hover { color: #333; } .show-helper-button { position: fixed; top: 20px; right: 20px; background: #4CAF50; color: white; border: none; border-radius: 4px; padding: 8px 15px; cursor: pointer; z-index: 10000; font-size: 14px; transition: background-color 0.3s; } .show-helper-button:hover { background: #45a049; } .study-helper .notice { font-size: 14px; color: #666; margin-bottom: 15px; line-height: 1.4; } .study-helper .input-group { margin-bottom: 10px; } .study-helper label { display: block; margin-bottom: 5px; color: #333; font-size: 14px; } .study-helper input { width: 100%; padding: 8px; margin-bottom: 0; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; } .study-helper button { width: 100%; padding: 10px; background: #4CAF50; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; transition: background-color 0.3s; } .study-helper button:hover:not(:disabled) { background: #45a049; } .study-helper button:disabled { background: #cccccc; cursor: not-allowed; } .study-helper .result { margin-top: 10px; padding: 10px; border-radius: 4px; font-size: 14px; } .study-helper .success { background: #e8f5e9; color: #2e7d32; } .study-helper .error { background: #ffebee; color: #c62828; } .study-helper .loading { background: #fff3e0; color: #ef6c00; } @keyframes spin { 0% { content: "?"; } 33% { content: "?"; } 66% { content: "?"; } 100% { content: "?"; } } .study-helper .loading::after { content: "?"; display: inline-block; margin-left: 5px; animation: spin 1s infinite steps(4); } `; document.head.appendChild(style); // 创建HTML结构 const div = document.createElement('div'); div.className = 'study-helper'; div.innerHTML = `