Greasy Fork

Greasy Fork is available in English.

小说阅读器

美化小说网站界面

当前为 2021-04-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         小说阅读器
// @version      0.3
// @description  美化小说网站界面
// @author       Zee Kim
// @match        https://www.abcxs.com/book/*/*.html
// @match        https://www.abcxs.net/book/*/*.html
// @match        http://www.biquge.info/*/*.html*
// @match        http://www.zmccx.com/*/*.html
// @match        http://www.tycqxs.com/*/*.html
// @grant        none
// @namespace http://greasyfork.icu/users/756252
// ==/UserScript==

(function() {
    'use strict';
    var title=document.querySelector("title").innerHTML;
    var content=document.querySelector("#content").innerHTML;
    title=title.split('_');
    var name=title[1];
    title=title[0];

    document.title=title;

    content=content.split('https://www.abcxs.com');
    content=content[0].replace(/ /g,"");
    content=content.replace(/杨开/g,"<b>杨开</b>");
    document.body.innerHTML=`
<style>
.title{
display:flex;
align-items:center;
}
.name{
display:inline-block;
padding:10px 0px;
font-weight:bold;
font-family:SourceHanSerifCN-Bold,Microsoft JhengHei,STFangsong;
font-size:3.2rem;
line-height:1;
color:#4F321C;
}
.section{
margin-left:20px;
position:relative;
display:inline-block;
padding:10px 20px;
font-family:SourceHanSerifCN-Bold,Microsoft JhengHei,STFangsong;
font-size:1.6rem;
line-height:1;
background:#4F321C;
color:#fff;
border-radius:50px;
}
.section::after{
content:"";
position:absolute;
left:-14px;
top:12px;
border:10px solid transparent;
border-right-color:#4F321C;
}
</style>
<div class="title">
<span class="name">${name}</span>
<span class="section">${title}</span>
</div>
<br>
${content}`;
    document.body.style.cssText='font-family: "幼圆";font-size: 2rem;padding: 6rem;background: #F8F1E3;color: #4F321C;line-height: 1.5;';
})();