sspnote javaer

刷题网页调整

目前为 2024-08-14 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name sspnote javaer
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024年8月14日22点41分
  5. // @description 刷题网页调整
  6. // @author onionycs
  7. // @license MIT
  8. // @match https://www.sspnote.com/oj/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=sspnote.com
  10. // @grant none
  11. // @require http://code.jquery.com/jquery-3.x-git.min.js
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. /* globals jQuery, $, waitForKeyElements */
  18. console.log('sspnote javaer start');
  19. var fbutton= $('#semiTabdetail');
  20. $('<button class="open-answer">打开题解</button>').insertBefore(fbutton);
  21.  
  22. $('.open-answer').click(function() {
  23. $('#semiTabanswer')[0].click();
  24. $('.answer-note').find('a')[3].click();
  25. fbutton[0].click();
  26. });
  27. setTimeout(function() {
  28. console.log('延迟1000ms...');
  29. adjust();
  30. }, 1000);
  31.  
  32.  
  33.  
  34. function adjust() {
  35.  
  36. console.log("start");
  37. $('div[role="combobox"]')[0].click();
  38. var id=$('div[role="combobox"]')[0].id+'-option-2';
  39. setTimeout(function() {
  40. // 这里写你希望延迟执行的代码
  41. console.log('执行了延迟300ms的代码');
  42. $('#'+id)[0].click();
  43. }, 500);
  44. document.getElementsByClassName("left-content")[0].style.width = "40%";
  45. document.getElementsByClassName("right-content")[0].style.width = "60%";
  46. console.log("end");
  47. $('img[alt="image"]')[0].style.maxWidth="30%";
  48.  
  49. }
  50.  
  51. })();