您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
祝大家一战功成~
// ==UserScript== // @name 芝士架构题干固定脚本 // @namespace https://www.cheko.cc/ // @version 2025-03-04 // @description 祝大家一战功成~ // @author 在细雨中呼喊 // @match https://www.cheko.cc/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const STORAGE_KEY = "fixedQuestionMode"; // 存储用户模式的键名 let toggleButton; // 按钮元素 function createToggleButton() { toggleButton = document.createElement("button"); toggleButton.style.position = "fixed"; toggleButton.style.top = "10px"; toggleButton.style.right = "10px"; toggleButton.style.zIndex = "2000"; toggleButton.style.padding = "8px 12px"; toggleButton.style.background = "#007bff"; toggleButton.style.color = "white"; toggleButton.style.border = "none"; toggleButton.style.borderRadius = "5px"; toggleButton.style.cursor = "pointer"; toggleButton.style.fontSize = "14px"; toggleButton.style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.2)"; toggleButton.addEventListener("click", toggleQuestionMode); document.body.appendChild(toggleButton); } function updateButtonText(fixed) { if (toggleButton) { toggleButton.innerText = fixed ? "恢复默认" : "固定题干"; } } function fixQuestionHeader(fixed) { let questionHeader = document.querySelector('.leading-10'); // 题干选择器 if (questionHeader) { if (fixed) { questionHeader.style.position = 'fixed'; questionHeader.style.top = '0'; questionHeader.style.left = '0'; questionHeader.style.width = '300px'; // 固定在左侧 questionHeader.style.height = '100vh'; questionHeader.style.overflowY = 'auto'; questionHeader.style.background = 'white'; questionHeader.style.zIndex = '1000'; questionHeader.style.padding = '10px'; questionHeader.style.boxShadow = '2px 0 8px rgba(0, 0, 0, 0.1)'; } else { questionHeader.style.position = ''; questionHeader.style.top = ''; questionHeader.style.left = ''; questionHeader.style.width = ''; questionHeader.style.height = ''; questionHeader.style.overflowY = ''; questionHeader.style.background = ''; questionHeader.style.zIndex = ''; questionHeader.style.padding = ''; questionHeader.style.boxShadow = ''; } } updateButtonText(fixed); // 切换按钮文本 } function toggleQuestionMode() { let currentMode = localStorage.getItem(STORAGE_KEY) === "true"; // 读取当前模式 let newMode = !currentMode; // 反转模式 localStorage.setItem(STORAGE_KEY, newMode); // 存储新模式 fixQuestionHeader(newMode); // 应用新模式 } // 初始化 window.onload = function() { createToggleButton(); let fixed = localStorage.getItem(STORAGE_KEY) === "true"; // 获取存储的模式 fixQuestionHeader(fixed); // 应用模式 }; })();