猴游脚本 优快云阅读模式

本文介绍了一个用户脚本,它在优快云博客底部工具栏添加了一个名为'阅读模式'的按钮,点击后可以调整内容区域的宽度,提供更好的阅读体验。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

0.2 更新 按钮放在底部工具栏中

在这里插入图片描述

// ==UserScript==
// @name         优快云 Reading mode togger
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  用于csdn博客阅读时内容区域扩大
// @author       宏斌
// @match        https://blog.youkuaiyun.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const okBtn = document.createElement('button');
    okBtn.id = 'ReadingMode';
    okBtn.setAttribute('class','option-box');
    okBtn.innerText = 'R'
//    $(".blog-content-box").append(okBtn);
//    $(".more-toolbox").append(okBtn);
    $('.left-toolbox').append(okBtn);
    $("#ReadingMode").css({ width: '50px',height:'50px','border-radius':'2px','background-color':'#fff','font-size':'25px','color':'#fff'});
    $('#ReadingMode').css({"background": 'linear-gradient(145deg, #bcbcbc, #e0e0e0)','box-shadow':  '5px 5px 34px #969696, -5px -5px 34px #ffffff'});
    const mystyles = document.createElement('style');
    mystyles.type = 'text/css';
    $("head").append(mystyles);
    $("#mainBox").css("transition","width 0.3s linear");
    $("#rightAside").css("transition","width 0.3s linear");
    mystyles.innerHTML = `.fillWidth{width: 100% !important} .zeroWidth{width: 0 !important}`;
    $("#ReadingMode").on('click',() => {
    $("#mainBox").toggleClass('fillWidth');
    $('main').toggleClass('fillWidth');
    $("#rightAside").toggleClass("zeroWidth");
})
})();

屏幕录制2021-04-14 下午5.gif

安装: link

// ==UserScript==
// @name         优快云 Reading mode togger
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  用于csdn博客阅读时内容区域扩大
// @author       宏斌
// @match        https://blog.youkuaiyun.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const okBtn = document.createElement('button');
    okBtn.id = 'ReadingMode';
    okBtn.setAttribute('class','option-box');
    okBtn.innerText = 'R'
//    $(".blog-content-box").append(okBtn);
    $('.csdn-side-toolbar').append(okBtn);
    $("#ReadingMode").css({ width: '44px',height:'44px','border-radius':'22px','background-color':'#fff','font-size':'25px','color':'#ccc','box-shadow': '0 2px 4px 0 rgb(0 0 0 / 5%)','margin-top':'8px' });
    const mystyles = document.createElement('style');
    mystyles.type = 'text/css';
    $("head").append(mystyles);
    $("#mainBox").css("transition","width 0.3s linear");
    $("#rightAside").css("transition","width 0.3s linear");
    mystyles.innerHTML = `.fillWidth{width: 100% !important} .zeroWidth{width: 0 !important}`;
    $("#ReadingMode").on('click',() => {
    $("#mainBox").toggleClass('fillWidth');
    $('main').toggleClass('fillWidth');
    $("#rightAside").toggleClass("zeroWidth");



})
})();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值