Mathspace Enhancement

Enhances Mathspace with helpful features.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Mathspace Enhancement
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Enhances Mathspace with helpful features.
// @author       You
// @match        https://mathspace.co/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Add a button to reveal hints more easily (if available)
    function addHintButton() {
        const hintButton = document.querySelector('button[aria-label*="Hint"]');
        if (hintButton) {
            hintButton.style.backgroundColor = 'lightgreen'; // Make it more visible
            hintButton.style.color = 'black';
            hintButton.style.fontWeight = 'bold';
            hintButton.addEventListener('click', function() {
                console.log("Hint button clicked!"); // Optional: Log to console
            });
        }
    }

    // Make important elements more visible (e.g., question area)
    function enhanceVisibility() {
        const questionArea = document.querySelector('.question-container'); // Adjust selector as needed
        if (questionArea) {
            questionArea.style.border = '2px solid blue'; // Highlight the question area
        }
    }

    // Add a quick link to the Mathspace help center
    function addHelpLink() {
        const helpLink = document.createElement('a');
        helpLink.href = 'https://help.mathspace.co/'; // Replace with the correct help URL
        helpLink.textContent = 'Mathspace Help';
        helpLink.target = '_blank'; // Open in a new tab
        helpLink.style.display = 'block';
        helpLink.style.marginTop = '10px';
        document.body.appendChild(helpLink); // Or append to a more appropriate container
    }

    // Observe changes in the DOM to dynamically add features as Mathspace loads content.
    const observer = new MutationObserver(function(mutations) {
        addHintButton();
        enhanceVisibility();
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

    // Initial run
    addHintButton();
    enhanceVisibility();
    addHelpLink();

})();