date:2022/07/23
title:编写油猴脚本更改tw作业样式
tag:脚本
编写油猴脚本更改tw作业样式
需求
如图1,作答后的作业颜色暗淡,不便复习
更改后如图2,变丑了但是显眼一些
原页面与更改后页面
原页面与更改后页面
图一
图二
代码
@grant处引入油猴脚本的
GM_addStyle用style变量中定义css字符串
并调用GM_addStyle(style)使样式生效
代码
// ==UserScript==
// @name tw_style
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://school.thoughtworks.cn/learn/program-center/basicQuiz/index.html
// @icon https://www.google.com/s2/favicons?sz=64&domain=thoughtworks.cn
// @grant GM_addStyle
// ==/UserScript==
(function () {'use strict';var style = `body{background:#665656;padding:80px;}/*更改选中的选项的的样式*//*外圆环*/.ant-radio-checked>.ant-radio-inner{background-color:#16c60c}/*圆环底色*/.ant-radio-inner::after{background-color:white !important}.mark-down-wrap {background:#665656;}/*更改单选和多选选项的字体颜色*/.ant-radio-disabled+span{color: white;cursor:auto;}.ant-checkbox-disabled+span{color: white;cursor:auto;}`GM_addStyle(style)//setTimeout(() => {//// }, 1000)//Your code here...
})();
本文由 mdnice 多平台发布














