您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Free mathematics learning companion for Mathspace
当前为
// ==UserScript== // @name TutorMe By U.K - Mathspace Helper // @namespace http://tampermonkey.net/ // @version 1.0 // @description Free mathematics learning companion for Mathspace // @author U.K // @match https://*.mathspace.co/* // @grant none // ==/UserScript== (function() { 'use strict'; // Styles for our UI const styles = ` .tutorme-panel { position: fixed; right: 20px; top: 20px; background: white; padding: 15px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); z-index: 10000; width: 300px; font-family: Inter, system-ui, sans-serif; } .tutorme-button { background: #34D399; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; width: 100%; margin-top: 10px; font-weight: 500; } .tutorme-button:hover { background: #2EBE8A; } .tutorme-solution { margin-top: 15px; padding: 10px; background: #f8f9fa; border-radius: 4px; white-space: pre-wrap; } `; // Add styles to document const styleSheet = document.createElement("style"); styleSheet.textContent = styles; document.head.appendChild(styleSheet); // Create UI panel const panel = document.createElement('div'); panel.className = 'tutorme-panel'; panel.innerHTML = ` <h3 style="margin: 0 0 10px 0; font-weight: 600;">TutorMe By U.K</h3> <div id="current-question" style="min-height: 50px; background: #f8f9fa; padding: 8px; border-radius: 4px; margin-bottom: 10px;"> Waiting for question... </div> <button id="analyze-btn" class="tutorme-button">Analyze Question</button> <div id="solution" class="tutorme-solution" style="display: none;"></div> `; document.body.appendChild(panel); // Make panel draggable let isDragging = false; let currentX; let currentY; let initialX; let initialY; let xOffset = 0; let yOffset = 0; panel.addEventListener("mousedown", dragStart); document.addEventListener("mousemove", drag); document.addEventListener("mouseup", dragEnd); function dragStart(e) { initialX = e.clientX - xOffset; initialY = e.clientY - yOffset; if (e.target === panel) { isDragging = true; } } function drag(e) { if (isDragging) { e.preventDefault(); currentX = e.clientX - initialX; currentY = e.clientY - initialY; xOffset = currentX; yOffset = currentY; setTranslate(currentX, currentY, panel); } } function setTranslate(xPos, yPos, el) { el.style.transform = `translate3d(${xPos}px, ${yPos}px, 0)`; } function dragEnd(e) { initialX = currentX; initialY = currentY; isDragging = false; } // Question detection and analysis logic const analyzeBtn = document.getElementById('analyze-btn'); const questionDiv = document.getElementById('current-question'); const solutionDiv = document.getElementById('solution'); // Monitor for question changes const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === 'childList') { const questionElements = document.querySelectorAll('.question-text, .problem-text'); if (questionElements.length > 0) { const question = questionElements[0].textContent; questionDiv.textContent = question; } } }); }); observer.observe(document.body, { childList: true, subtree: true }); analyzeBtn.addEventListener('click', async () => { const question = questionDiv.textContent; if (question === 'Waiting for question...') return; analyzeBtn.textContent = 'Analyzing...'; analyzeBtn.disabled = true; try { // Simulate analysis (replace with actual implementation) await new Promise(resolve => setTimeout(resolve, 1500)); solutionDiv.style.display = 'block'; solutionDiv.textContent = `Step 1: Read and understand the problem Step 2: Identify key information Step 3: Choose appropriate method Step 4: Solve step by step Step 5: Verify the answer`; } catch (error) { solutionDiv.textContent = "Error analyzing question. Please try again."; } finally { analyzeBtn.textContent = 'Analyze Question'; analyzeBtn.disabled = false; } }); })();