CSDN Blog Super Simplification

move comment area to left side & remove login requirement, move body area to right side & auto trigger read more button, remove author panel,recommendation panel etc..., change the background to default style, hide login pop up panel

目前為 2020-11-10 提交的版本,檢視 最新版本

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         CSDN Blog Super Simplification
// @name:zh-CN   CSDN Blog 极致简化
// @namespace    csdn_blog_super_simplification
// @version      1.6.1
// @description  move comment area to left side & remove login requirement, move body area to right side & auto trigger read more button, remove author panel,recommendation panel etc..., change the background to default style, hide login pop up panel
// @description:zh-CN  move comment area to left side & remove login requirement, move body area to right side & auto trigger read more button, remove author panel,recommendation panel etc..., change the background to default style, hide login pop up panel
// @author       Xavier Wong
// @run-at       document-start
// @include      https://blog.csdn.net/*
// @exclude      https://www.csdn.net/*
// @grant        GM_addStyle
// ==/UserScript==

GM_addStyle(
    // Background & Color
    'body{background-color:#f5f6f7 !important;background-image:none !important}' +
    // Layout Rearrangement
    '#rightAside,#btnMoreComment,#tip_comment,#quickComment,.hide-article-box,.csdn-side-toolbar,.recommend-box,.template-box,.footer-box,.blog-footer-bottom,aside,.toolbar-advert{display:none !important}' +
    '.main_father{height: unset}' +
    '#mainBox,#article_content{width:100% !important;height:100% !important}' +
    'main{width:100% !important;height:100% !important;margin-bottom: unset !important}'+
    '.blog-content-box{width:70% !important;float:right;z-index:1;padding-bottom:48px !important}' +
    // Toolbox
    '.more-toolbox,.left-toolbox{width:100% !important;float:right;left:unset !important}' +
    // Comment Area
    '.comment-box{position:fixed;float:left;top:52px;width:28%}' +
    '.comment-list-box{overflow:scroll !important;max-height:calc(70vh) !important;margin-bottom:10px !important}' +
    '#commentPage{margin-bottom:25px !important;display:block !important}' +
    // Login Box
    '.login-box,.login-mark{visibility:hidden !important}'
);

function commentArea(toolbar, comment){
    if(toolbar.style.position !== comment.style.position){
        comment.style.position = toolbar.style.position;
    }
    if(comment.style.position === "fixed"){
        console.log(document.getElementsByTagName("main")[0].offsetWidth)
        if(document.getElementsByTagName("main")[0].offsetWidth*0.28 !== comment.offsetWidth){
            comment.style.width = document.getElementsByTagName("main")[0].offsetWidth*0.28 + "px";
        }
    }else{
        comment.style.width = "28%";
    }
}
(
    function() {
        window.onload = function(){
            'use strict';
            var toolbar = document.getElementById("csdn-toolbar");
            var main = document.getElementsByClassName("blog-content-box")[0];
            var comment = document.getElementsByClassName("comment-box")[0];
            main.parentNode.insertBefore(comment,main.nextSibling);
            comment.style.width = document.getElementsByTagName("main")[0].offsetWidth*0.28 + "px";
            window.onscroll = function(){
                commentArea(toolbar, comment)
            }
            window.onresize = function(){
                commentArea(toolbar, comment)
            }
        }
    }
)();