From cc2317c2e42da9484d26c81fd74033cfe8bd5338 Mon Sep 17 00:00:00 2001
From: "1152958806@qq.com" <17683872107czx>
Date: Thu, 19 Oct 2023 11:17:04 +0800
Subject: [PATCH 01/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=AF=BC=E8=88=AA=E6=9D=A1=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E5=86=85=E5=AE=B9=E9=80=89=E6=8B=A9=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
settings.yaml | 3 +++
templates/assets/zhheo/zhheoblog.css | 17 ++++++++++-------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/settings.yaml b/settings.yaml
index a1b3117e..f5d91012 100644
--- a/settings.yaml
+++ b/settings.yaml
@@ -446,6 +446,7 @@ spec:
- $formkit: repeater
if: $get(nav).value === 'custom-category'
name: navCustomCategory
+ key: navCustomCategory
label: 自定义分类
value: [ ]
children:
@@ -455,6 +456,7 @@ spec:
- $formkit: repeater
if: $get(nav).value === 'custom-tag'
name: navCustomTag
+ key: navCustomTag
label: 自定义标签
value: [ ]
children:
@@ -464,6 +466,7 @@ spec:
- $formkit: repeater
if: $get(nav).value === 'custom-url'
name: navCustomUrl
+ key: navCustomUrl
label: 自定义路径
value: [ ]
children:
diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css
index a8f72422..7f8c145b 100644
--- a/templates/assets/zhheo/zhheoblog.css
+++ b/templates/assets/zhheo/zhheoblog.css
@@ -3107,7 +3107,7 @@ ul {
#pagination .page-number.current {
background: rgb(0, 121, 255);
- color: var(--white);
+ color: var(--heo-card-bg);
cursor: default;
border-radius: 5px;
}
@@ -8023,8 +8023,8 @@ div#banners {
height: 100%;
top: 0;
left: 0;
- background: var(--heo-theme);
- color: var(--heo-white);
+ background: var(--heo-lighttext);
+ color: var(--heo-card-bg);
padding-left: 0.5rem;
display: flex;
flex-direction: column;
@@ -8047,7 +8047,7 @@ div#banners {
#banners:hover #banner-hover {
opacity: 1;
padding-left: 2rem;
- background: #4259efc9;
+ background: var(--heo-theme-op-deep);
backdrop-filter: blur(15px);
-webkit-backdrop-filter: blur(15px);
-webkit-backface-visibility: hidden;
@@ -8148,8 +8148,8 @@ div#banners {
}
.topGroup .banner-button:hover {
- background: var(--heo-theme);
- color: var(--heo-white);
+ background: var(--heo-lighttext);
+ color: var(--heo-card-bg);
}
.topGroup .banner-button i {
@@ -8361,7 +8361,7 @@ a.categoryButton:hover {
/* 首页分类条展示 */
#category-bar {
- padding: 0.4rem 1rem 0.4rem 0.5rem;
+ padding: 0.4rem 1rem 0.4rem 0.7rem;
background: var(--heo-card-bg);
border-radius: 12px;
display: flex;
@@ -8372,6 +8372,9 @@ a.categoryButton:hover {
transition: 0.3s;
width: 100%;
justify-content: space-between;
+ -webkit-user-select: none;
+ display: flex;
+ align-items: center
}
@media screen and (min-width: 1300px) {
From 41614091a7132966c87739d8b870f00898ebdd87 Mon Sep 17 00:00:00 2001
From: "1152958806@qq.com" <17683872107czx>
Date: Thu, 19 Oct 2023 14:26:59 +0800
Subject: [PATCH 02/15] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E5=88=87=E6=8D=A2=E9=A1=B5=E9=9D=A2=E5=AF=BC=E8=87=B4=E8=AF=84?=
=?UTF-8?q?=E8=AE=BA=E8=B7=AF=E7=94=B1=E4=B8=8D=E5=AF=B9=EF=BC=8C=E6=B2=A1?=
=?UTF-8?q?=E6=9C=89=E8=AF=84=E8=AE=BA=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
templates/assets/js/comment/artalk.js | 2 +-
templates/assets/js/comment/twikoo.js | 1 +
templates/assets/js/comment/waline.js | 2 +-
templates/assets/zhheo/commentBarrage.js | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/templates/assets/js/comment/artalk.js b/templates/assets/js/comment/artalk.js
index b1306148..88eaf6cb 100644
--- a/templates/assets/js/comment/artalk.js
+++ b/templates/assets/js/comment/artalk.js
@@ -6,7 +6,7 @@
el: '#artalk-wrap',
server: GLOBAL_CONFIG.source.artalk.artalkUrl,
site: GLOBAL_CONFIG.source.artalk.siteName,
- pageKey: location.pathname,
+ pageKey: location.pathname.replace(/\/page\/\d$/, ""),
darkMode: false,
countEl: '#ArtalkCount'
}, null))
diff --git a/templates/assets/js/comment/twikoo.js b/templates/assets/js/comment/twikoo.js
index 9ee2a9ff..21d958b7 100644
--- a/templates/assets/js/comment/twikoo.js
+++ b/templates/assets/js/comment/twikoo.js
@@ -5,6 +5,7 @@
el: '#twikoo-wrap',
envId: GLOBAL_CONFIG.source.twikoo.twikooUrl,
region: '',
+ path: location.pathname.replace(/\/page\/\d$/, ""),
onCommentLoaded: function () {
btf.loadLightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
typeof hljs === 'object' && hljs.highlightAll()
diff --git a/templates/assets/js/comment/waline.js b/templates/assets/js/comment/waline.js
index c7a9717e..94cc7b40 100644
--- a/templates/assets/js/comment/waline.js
+++ b/templates/assets/js/comment/waline.js
@@ -6,7 +6,7 @@
serverURL: GLOBAL_CONFIG.source.waline.serverURL,
pageview: false,
dark: 'html[data-theme="dark"]',
- path: window.location.pathname,
+ path: window.location.pathname.replace(/\/page\/\d$/, ""),
comment: false,
locale:GLOBAL_CONFIG.source.waline.locale
}, null))
diff --git a/templates/assets/zhheo/commentBarrage.js b/templates/assets/zhheo/commentBarrage.js
index f011d00a..21fb74be 100644
--- a/templates/assets/zhheo/commentBarrage.js
+++ b/templates/assets/zhheo/commentBarrage.js
@@ -12,7 +12,7 @@ if(GLOBAL_CONFIG.htmlType!='comments' && document.querySelector('#post-comment')
//token获取见上方
accessToken: GLOBAL_CONFIG.source.twikoo.accessToken,
mailMd5: GLOBAL_CONFIG.source.comments.mailMd5,
- pageUrl: window.location.pathname,
+ pageUrl: window.location.pathname.replace(/\/page\/\d$/, ""),
barrageTimer: [],
barrageList: [],
siteName: GLOBAL_CONFIG.source.artalk.siteName,
From c2e5b7fe0e88025496c7752f4fe62a0cce48e804 Mon Sep 17 00:00:00 2001
From: "1152958806@qq.com" <1152958806@qq.com>
Date: Thu, 19 Oct 2023 18:52:42 +0800
Subject: [PATCH 03/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9F=B3=E4=B9=90?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2logo=E6=B7=B1=E8=89=B2=E6=A8=A1=E5=BC=8F?=
=?UTF-8?q?=E4=B8=8B=E7=9A=84=E9=A2=9C=E8=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
templates/assets/libs/aplayer/music.css | 6 +++++-
templates/assets/zhheo/zhheoblog.css | 4 ++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/templates/assets/libs/aplayer/music.css b/templates/assets/libs/aplayer/music.css
index a185247b..c47e96c2 100644
--- a/templates/assets/libs/aplayer/music.css
+++ b/templates/assets/libs/aplayer/music.css
@@ -60,9 +60,11 @@ body[data-type=music] #page {
#page-header.not-top-img #nav .back-home-button,
#page-header.not-top-img #nav a {
color:#F7F7FA;
-
}
+#page-header.not-top-img #nav .back-home-button:hover{
+ color: var(--heo-card-bg);
+}
body[data-type=music] #footer,
body[data-type=music] #nav-music {
@@ -588,4 +590,6 @@ body[data-type=music] #nav-music {
left: 0;
top: 0;
}
+
+
}
\ No newline at end of file
diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css
index a8f72422..c6ffbe67 100644
--- a/templates/assets/zhheo/zhheoblog.css
+++ b/templates/assets/zhheo/zhheoblog.css
@@ -6581,6 +6581,10 @@ a.console_switchbutton {
color: var(--heo-fontcolor)
}
+body[data-type=music] .page #nav #site-name span{
+ color: var(--heo-white);
+}
+
.page #nav #site-name:hover {
color: var(--heo-card-bg)
}
From f5e982fa41bca42c2df631ba0335da150de86c98 Mon Sep 17 00:00:00 2001
From: "1152958806@qq.com" <1152958806@qq.com>
Date: Thu, 19 Oct 2023 19:51:02 +0800
Subject: [PATCH 04/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?=
=?UTF-8?q?=E7=AB=AFlogo=E7=9A=84=E9=A2=9C=E8=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
templates/assets/zhheo/zhheoblog.css | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css
index 66010119..dc3b4a2e 100644
--- a/templates/assets/zhheo/zhheoblog.css
+++ b/templates/assets/zhheo/zhheoblog.css
@@ -6584,9 +6584,10 @@ a.console_switchbutton {
body[data-type=music] .page #nav #site-name span{
color: var(--heo-white);
}
-
-.page #nav #site-name:hover {
- color: var(--heo-card-bg)
+@media screen and (max-width: 768px) {
+ .page #nav #site-name span:hover {
+ color: var(--heo-card-bg);
+ }
}
/* 搜索 */
From cbcdff23017ee51e85c6e4ab3bee27bc064a0beb Mon Sep 17 00:00:00 2001
From: "1152958806@qq.com" <17683872107czx>
Date: Fri, 20 Oct 2023 15:47:18 +0800
Subject: [PATCH 05/15] =?UTF-8?q?=E6=96=87=E7=AB=A0=E7=9B=AE=E5=BD=95?=
=?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
templates/assets/js/main.js | 115 +++++++++++++++++++++---
templates/assets/zhheo/zhheoblog.css | 56 ++++++------
templates/modules/common/rightside.html | 2 +-
templates/modules/footer.html | 2 +-
4 files changed, 133 insertions(+), 42 deletions(-)
diff --git a/templates/assets/js/main.js b/templates/assets/js/main.js
index 29c6cf3b..07ee1b3f 100644
--- a/templates/assets/js/main.js
+++ b/templates/assets/js/main.js
@@ -159,7 +159,7 @@ document.addEventListener('DOMContentLoaded', function () {
const cardToc = document.getElementById("card-toc");
cardToc?.remove();
const $mobileTocButton = document.getElementById("mobile-toc-button")
- if($mobileTocButton){
+ if ($mobileTocButton) {
$('#mobile-toc-button').attr('style', 'display: none');
}
} else {
@@ -167,13 +167,102 @@ document.addEventListener('DOMContentLoaded', function () {
tocSelector: '.toc-content',
contentSelector: '.post-content',
headingSelector: 'h1,h2,h3,h4,h5,h6',
+ listItemClass: 'toc-item',
collapseDepth: 6,
headingsOffset: 70,
scrollSmooth: true,
scrollSmoothOffset: -70,
- tocScrollOffset: 50
+ tocScrollOffset: 35,
+
});
+ const $cardTocLayout = document.getElementById('card-toc')
+ const $cardToc = $cardTocLayout.getElementsByClassName('toc-content')[0]
+ const $tocLink = $cardToc.querySelectorAll('.toc-link')
+ const $article = document.getElementById('article-container')
+
+ window.tocScrollFn = function () {
+ return btf.throttle(function () {
+ const currentTop = window.scrollY || document.documentElement.scrollTop
+ scrollPercent(currentTop)
+ findHeadPosition(currentTop)
+ }, 100)()
+ }
+ window.addEventListener('scroll', tocScrollFn)
+
+ const scrollPercent = function (currentTop) {
+ const docHeight = $article.clientHeight
+ const winHeight = document.documentElement.clientHeight
+ const headerHeight = $article.offsetTop
+ const contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : (document.documentElement.scrollHeight - winHeight)
+ const scrollPercent = (currentTop - headerHeight) / (contentMath)
+ const scrollPercentRounded = Math.round(scrollPercent * 100)
+ const percentage = (scrollPercentRounded > 100) ? 100 : (scrollPercentRounded <= 0) ? 0 : scrollPercentRounded
+ $cardToc.setAttribute('progress-percentage', percentage)
+ }
+
+ // toc元素點擊
+ $cardToc.addEventListener('click', (ele) => {
+ if (window.innerWidth < 900) {
+ $cardTocLayout.classList.remove("open");
+ }
+ })
+
+ const autoScrollToc = function (item) {
+ const activePosition = item.getBoundingClientRect().top
+ const sidebarScrollTop = $cardToc.scrollTop
+ if (activePosition > (document.documentElement.clientHeight - 100)) {
+ $cardToc.scrollTop = sidebarScrollTop + 150
+ }
+ if (activePosition < 100) {
+ $cardToc.scrollTop = sidebarScrollTop - 150
+ }
+ }
+
+ // find head position & add active class
+ const list = $article.querySelectorAll('h1,h2,h3,h4,h5,h6')
+ let detectItem = ''
+ const findHeadPosition = function (top) {
+ if ($tocLink.length === 0 || top === 0) {
+ return false
+ }
+
+ let currentId = ''
+ let currentIndex = ''
+
+ list.forEach(function (ele, index) {
+ if (top > btf.getEleTop(ele) - 80) {
+ currentId = '#' + encodeURI(ele.getAttribute('id'))
+ currentIndex = index
+ }
+ })
+
+ if (detectItem === currentIndex) return
+
+
+ if (currentId === '') {
+ $cardToc.querySelectorAll('.active').forEach(i => { i.classList.remove('active') })
+ detectItem = currentIndex
+ return
+ }
+
+ detectItem = currentIndex
+
+ $cardToc.querySelectorAll('.active').forEach(item => { item.classList.remove('active') })
+ const currentActive = $tocLink[currentIndex]
+ currentActive.classList.add('active')
+
+ setTimeout(() => {
+ autoScrollToc(currentActive)
+ }, 0)
+
+ let parent = currentActive.parentNode
+
+ for (; !parent.matches('.toc-list'); parent = parent.parentNode) {
+ if (parent.matches('li')) parent.classList.add('active')
+ }
+ }
+
}
}
@@ -210,13 +299,19 @@ document.addEventListener('DOMContentLoaded', function () {
: saveToLocal.set('aside-status', 'hide', 2)
$htmlDom.toggle('hide-aside')
},
- runMobileToc: () => {
- const $cardToc = document.getElementById("card-toc")
- if ($cardToc.classList.contains("open")) {
- $cardToc.classList.remove("open");
- } else {
- $cardToc.classList.add("open");
- }
+ runMobileToc: item => {
+ const tocEle = document.getElementById("card-toc");
+ tocEle.style.transformOrigin = `right ${item.getBoundingClientRect().top + 17}px`;
+ tocEle.style.transition = "transform 0.3s ease-in-out";
+ tocEle.classList.toggle("open");
+ tocEle.addEventListener(
+ "transitionend",
+ () => {
+ tocEle.style.transition = "";
+ tocEle.style.transformOrigin = "";
+ },
+ { once: true }
+ );
},
}
@@ -230,7 +325,7 @@ document.addEventListener('DOMContentLoaded', function () {
rightSideFn.showOrHideBtn()
break
case "mobile-toc-button":
- rightSideFn.runMobileToc();
+ rightSideFn.runMobileToc(this);
break;
case 'readmode':
rightSideFn.switchReadMode()
diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css
index dc3b4a2e..a98f24de 100644
--- a/templates/assets/zhheo/zhheoblog.css
+++ b/templates/assets/zhheo/zhheoblog.css
@@ -2246,7 +2246,7 @@ blockquote footer cite::before {
#aside-content #card-toc .toc-content {
overflow-y: auto;
- max-height: calc(100vh - 120px);
+ max-height: calc(100vh - 300px);
}
@media screen and (max-width: 900px) {
@@ -2301,10 +2301,10 @@ blockquote footer cite::before {
position: absolute;
top: 0.6rem;
right: 1.2rem;
- color: rgb(169, 169, 169);
+ color: #a9a9a9;
content: attr(progress-percentage);
font-style: italic;
- font-size: 1.2rem;
+ font-size: 1.2rem
}
#aside-content :only-child > .card-widget {
@@ -2763,9 +2763,13 @@ blockquote footer cite::before {
#page-header.nav-fixed #nav #site-name,
#page-header.nav-fixed #nav #toggle-menu,
#page-header.nav-fixed #nav a {
- color: var(--heo-fontcolor);
text-shadow: none;
}
+@media screen and (min-width: 900px) {
+ #page-header.nav-fixed #nav #site-name:hover {
+ color: var(--heo-white);
+ }
+}
#page-header.nav-visible #nav {
transition: all 0.5s ease 0s;
@@ -4856,7 +4860,7 @@ html {
color: var(--heo-white);
}
-.nav-fixed #nav a {
+.nav-fixed #nav a{
color: var(--heo-fontcolor);
transition: 0.3s;
}
@@ -6125,6 +6129,7 @@ i.fab {
.nav-fixed #nav a:hover {
background: var(--heo-main);
+ color: var(--heo-white);
transition: 0.3s;
}
@@ -6559,6 +6564,10 @@ a.console_switchbutton {
transition: 0s;
}
+.nav-fixed #nav #site-name{
+ color: var(--heo-fontcolor);
+}
+
/* 导航栏名称样式 */
#nav #site-name {
color: var(--heo-fontcolor);
@@ -9595,10 +9604,6 @@ span.recent-post-top-text {
right: 0;
}
- #rightside {
- display: none
- }
-
/* 背景 */
#web_bg {
background: none !important;
@@ -9693,16 +9698,16 @@ span.recent-post-top-text {
/* 文章目录 */
#aside-content #card-toc .toc-content .toc-link.active {
- line-height: 1.2;
+ line-height: 24px;
border-radius: 12px;
border-left-color: var(--heo-hovertext);
background-color: var(--heo-card-bg);
color: var(--heo-lighttext);
- font-weight: bold;
- font-size: 20px;
+ font-weight: 700;
+ font-size: 20px
}
-[data-theme=dark].toc .toc-item.active .toc-link .toc-text {
+[data-theme=dark].toc-list .toc-item.active .toc-link{
color: var(--heo-white);
}
@@ -9712,27 +9717,30 @@ span.recent-post-top-text {
}
#aside-content #card-toc .toc-content .toc-link {
- line-height: 1.2;
+ line-height: 24px;
padding: 8px;
- border-left: 0px solid transparent;
+ border-left: 0 solid transparent;
border-radius: 12px;
color: var(--heo-secondtext);
cursor: default;
+ min-height: 40px;
+ display: flex;
+ align-items: center
}
-#aside-content #card-toc .toc-content .toc-link:not(.active) span {
+#aside-content #card-toc .toc-content a.toc-link:not(.active) {
opacity: 0.6;
cursor: pointer;
filter: blur(1px);
transition: 0.3s;
}
-#aside-content #card-toc:hover .toc-content .toc-link:not(.active) span {
+#aside-content #card-toc:hover .toc-content a.toc-link:not(.active) {
filter: blur(0px);
opacity: 1;
}
-#aside-content #card-toc .toc-content .toc-link:not(.active) span:hover {
+#aside-content #card-toc .toc-content a:hover.toc-link:not(.active) {
color: var(--heo-lighttext);
}
@@ -17438,18 +17446,6 @@ a#toPageButton.haveValue:hover {
}
}
-
-/* 文章目录样式 */
-a.toc-link {
- color: currentColor;
- height:0%;
-}
-/* 文章目录样式 */
-#aside-content #card-toc .toc-content .is-active-link {
- font-weight: 700;
- font-size: 20px;
- color: var(--heo-lighttext);
-}
/* code样式 */
code:not([class]) {
color: var(--heo-white);
diff --git a/templates/modules/common/rightside.html b/templates/modules/common/rightside.html
index 012793ae..778d34c0 100644
--- a/templates/modules/common/rightside.html
+++ b/templates/modules/common/rightside.html
@@ -11,7 +11,7 @@
-
+