From 24adb23508498c96cf7da8ae2693a8c5a1674a60 Mon Sep 17 00:00:00 2001 From: gadore Date: Mon, 6 Mar 2023 16:33:41 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=A7=A3=E5=86=B3=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8=E6=91=98=E8=A6=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=8D=E6=98=BE=E7=A4=BA=EF=BC=9B2=E3=80=81?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=87=E7=AB=A0=E5=86=85=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=9D=97=E5=86=85=E5=AE=B9=E6=BA=A2=E5=87=BA=EF=BC=9B3?= =?UTF-8?q?=E3=80=81=E5=B1=8F=E8=94=BD=E4=B8=BB=E9=A1=B5=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=97=B6=E6=8E=A7=E5=88=B6=E5=8F=B0=E9=A2=91?= =?UTF-8?q?=E7=B9=81=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/js/main.js | 2 + templates/assets/zhheo/blogex.js | 2 +- templates/assets/zhheo/custom.css | 10 ++--- templates/assets/zhheo/zhheoblog.css | 60 +++++++++++++++++++++++++--- 4 files changed, 61 insertions(+), 13 deletions(-) diff --git a/templates/assets/js/main.js b/templates/assets/js/main.js index 66887db1..1a8d4d95 100644 --- a/templates/assets/js/main.js +++ b/templates/assets/js/main.js @@ -336,6 +336,8 @@ document.addEventListener('DOMContentLoaded', function () { */ const scrollFn = function () { const $rightside = document.getElementById('rightside') + // 解决浏览器滚动时无休止报错 + if ($rightside === null) { return } const innerHeight = window.innerHeight + 56 // 當滾動條小于 56 的時候 diff --git a/templates/assets/zhheo/blogex.js b/templates/assets/zhheo/blogex.js index 1f733306..eb7f7a55 100644 --- a/templates/assets/zhheo/blogex.js +++ b/templates/assets/zhheo/blogex.js @@ -166,7 +166,7 @@ function getContrastYIQ(hexcolor) { function navTitle() { var titlevalue = document.title; var postName = document.getElementsByClassName("post-title")[0]; - document.getElementById("page-name-text").innerHTML = postName.innerText; + document.getElementById("page-name-text").innerHTML = postName?.innerText; } window.onload = function () { diff --git a/templates/assets/zhheo/custom.css b/templates/assets/zhheo/custom.css index ec529be2..1fa15971 100644 --- a/templates/assets/zhheo/custom.css +++ b/templates/assets/zhheo/custom.css @@ -3,13 +3,8 @@ text-indent: 2em; } */ -/* 代码块阴影 Bug */ -#article-container pre > code { - background: transparent !important; -} - /* 代码块纯黑色背景 */ -code[class*="language-"], pre[class*="language-"]{ +code[class*=" language-"], pre[class*=" language-"]{ background: #18171d; } @@ -47,4 +42,7 @@ ul li { #article-container pre > code { background: transparent !important; + /* 解决文章界面代码超长时溢出问题 */ + display: block; + overflow: auto; } diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css index d68741d7..19783b7b 100644 --- a/templates/assets/zhheo/zhheoblog.css +++ b/templates/assets/zhheo/zhheoblog.css @@ -8955,7 +8955,7 @@ li { } .recent-post-item.post-card-large .recent-post-info .recent-post-info-top .content { - opacity: 0 !important; + opacity: 0.8 !important; -webkit-line-clamp: 2 !important; } @@ -8965,7 +8965,7 @@ li { } .recent-post-item .recent-post-info .recent-post-info-top .content { - opacity: 0; + opacity: 1; transition: 0.3s; display: -webkit-box; overflow: hidden; @@ -8978,13 +8978,13 @@ li { @media screen and (max-width: 1300px) { .recent-post-item:hover .recent-post-info .recent-post-info-top .content { - display: none; + display: flow-root; } } @media screen and (min-width: 1300px) { .recent-post-item:hover .recent-post-info .recent-post-info-top .content { - display: none; + display: flow-root; } } @@ -9008,7 +9008,7 @@ li { .recent-post-item .recent-post-info .recent-post-info-top .content { opacity: 1; -webkit-line-clamp: 3; - display: none; + display: flow-root; } #recent-posts .recent-post-item .recent-post-info .article-title { @@ -16635,4 +16635,52 @@ span.hexo-douban-pagenum { vertical-align: baseline; line-height: 1; height: 24px; -} \ No newline at end of file +} + +/* 首行缩进 */ +/* .post-content p { + text-indent: 2em; +} */ + +/* 代码块纯黑色背景 */ +code[class*=" language-"], pre[class*=" language-"]{ + background: #18171d; +} + +/* banner 字体图标大小及位置 */ +i.iconfont.icon-arrow-right.banner-righticon{ + font-size: 66px; +} + +span.bannerText{ + display: block; + margin-top: 35px; +} + +/* 自我介绍渐变色背景 */ +#aside-content > .card-widget.card-info::before { + background: linear-gradient(-25deg,#0084ff,#031764,#67044d); + background-size: 400%; + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + content: ''; + animation: gradient 15s ease infinite; +} + +/* 列表样式及缩进 */ +ul li { + font-size: 18px; +} + +#article-container ol li:not(.tab), #article-container ul li:not(.tab){ + margin-left: 2em; +} + +#article-container pre > code { + background: transparent !important; + display: block; + overflow: auto; +}