sspnote javaer

刷题网页调整

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         sspnote javaer
// @namespace    http://tampermonkey.net/
// @version      2024年8月14日22点45分
// @description  刷题网页调整
// @author       onionycs
// @license MIT
// @match        https://www.sspnote.com/oj/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=sspnote.com
// @grant        none
// @require      http://code.jquery.com/jquery-3.x-git.min.js
// ==/UserScript==

(function() {
    'use strict';

    /* globals jQuery, $, waitForKeyElements */
    console.log('sspnote javaer start');
    var fbutton= $('#semiTabdetail');
    $('<button class="open-answer">打开题解</button>').insertBefore(fbutton);

    $('.open-answer').click(function() {
        $('#semiTabanswer')[0].click();
        $('.answer-note').find('a')[3].click();
        setTimeout(function(){
            fbutton[0].click();
        },1000);
    });
    setTimeout(function() {
            console.log('延迟1000ms...');
        adjust();
    }, 1000);



    function adjust() {

        console.log("start");
        $('div[role="combobox"]')[0].click();
        var id=$('div[role="combobox"]')[0].id+'-option-2';
        setTimeout(function() {
            // 这里写你希望延迟执行的代码
            console.log('执行了延迟300ms的代码');
            $('#'+id)[0].click();
        }, 500);
        document.getElementsByClassName("left-content")[0].style.width = "40%";
        document.getElementsByClassName("right-content")[0].style.width = "60%";
        console.log("end");
        $('img[alt="image"]')[0].style.maxWidth="30%";

    }

    
})();