From fe790ee672202bab37694972a22c1674a59dfd7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=B0=8F=E5=8F=AA=E6=89=98=E5=B0=BC?= Date: Tue, 1 Oct 2024 10:34:54 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=94=A5=20=E4=BF=AE=E5=A4=8D=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/head/config.pug | 14 ++++++++++---- source/js/tw_cn.js | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/layout/includes/head/config.pug b/layout/includes/head/config.pug index 2340abcb..681e6d70 100644 --- a/layout/includes/head/config.pug +++ b/layout/includes/head/config.pug @@ -115,15 +115,20 @@ } } if (theme.translate.enable) { - rightMenu.translate = { - translateDelay: theme.translate.translateDelay, - defaultEncoding: theme.translate.defaultEncoding - } + rightMenu.translate = theme.right_menu.translate } if (theme.right_menu.ctrlOriginalMenu) rightMenu.ctrlOriginalMenu = _p('right_menu.ctrl_original_menu') } + let translate = false + if (theme.translate.enable) { + translate = { + translateDelay: theme.translate.translateDelay, + defaultEncoding: theme.translate.defaultEncoding + } + } + let highlight = false if (theme.highlight.enable) { highlight = { @@ -187,6 +192,7 @@ script. lightbox: '!{ theme.mediumZoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null")}', post_ai: !{post_ai}, right_menu: !{rightMenu ? JSON.stringify(rightMenu) : false}, + translate: !{translate ? JSON.stringify(translate) : false}, lure: !{lure ? JSON.stringify(lure) : false}, expire: !{expire ? JSON.stringify(expire) : false}, }; \ No newline at end of file diff --git a/source/js/tw_cn.js b/source/js/tw_cn.js index c6ffcac7..097f7729 100644 --- a/source/js/tw_cn.js +++ b/source/js/tw_cn.js @@ -1,5 +1,5 @@ document.addEventListener('DOMContentLoaded', function () { - const { defaultEncoding, translateDelay } = GLOBAL_CONFIG.right_menu.translate; + const { defaultEncoding, translateDelay } = GLOBAL_CONFIG.translate; const targetEncodingCookie = 'translate-chn-cht'; let currentEncoding = defaultEncoding; From 51200959ebb8a70be2838056f2a2a93b5d4abd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=B0=8F=E5=8F=AA=E6=89=98=E5=B0=BC?= Date: Tue, 1 Oct 2024 10:36:54 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E2=9C=A8=20=E5=A2=9E=E5=8A=A0=E5=8F=B3?= =?UTF-8?q?=E4=B8=8B=E8=A7=92=E4=BE=A7=E8=BE=B9=E6=A0=8F=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E9=A1=B6=E9=83=A8=E6=95=B0=E5=AD=97=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当开启右下角侧边栏中的percent时,顶部导航栏不会显示返回按钮 --- _config.yml | 1 + layout/includes/widgets/nav/right.pug | 10 +++++----- layout/includes/widgets/rightside/show.pug | 3 ++- scripts/event/merge_config.js | 1 + source/css/_layout/rightside.styl | 14 ++++++++++++++ source/js/main.js | 8 +++++--- 6 files changed, 28 insertions(+), 9 deletions(-) diff --git a/_config.yml b/_config.yml index 15bee4e6..331440fe 100644 --- a/_config.yml +++ b/_config.yml @@ -963,6 +963,7 @@ translate: # 右下角悬停导航栏 rightside: enable: false + percent: false hide: enable: false translate: false diff --git a/layout/includes/widgets/nav/right.pug b/layout/includes/widgets/nav/right.pug index bd036ff5..45ea4044 100644 --- a/layout/includes/widgets/nav/right.pug +++ b/layout/includes/widgets/nav/right.pug @@ -18,11 +18,11 @@ if theme.console.enable i.left i.center i.right - -.nav-button#nav-totop(onclick="sco.toTop()") - a.totopbtn - i.solitude.fa-solid.fa-arrow-up - span#percent= "0" +if !theme.rightside.percent + .nav-button#nav-totop(onclick="sco.toTop()") + a.totopbtn + i.solitude.fa-solid.fa-arrow-up + span#percent= "0" #toggle-menu a.site-page i.solitude.fa-solid.fa-bars \ No newline at end of file diff --git a/layout/includes/widgets/rightside/show.pug b/layout/includes/widgets/rightside/show.pug index 74d83f5d..0900a2fb 100644 --- a/layout/includes/widgets/rightside/show.pug +++ b/layout/includes/widgets/rightside/show.pug @@ -9,4 +9,5 @@ button.comment(type='button' title=_p('rightside.show.comment') onclick="sco.scrollTo('post-comment')") i.fas.fa-comment button.top(type='button' title=_p('rightside.show.top') onclick='sco.toTop()') - i.fas.fa-arrow-up \ No newline at end of file + i.fas.fa-arrow-up + span#percent= "0" \ No newline at end of file diff --git a/scripts/event/merge_config.js b/scripts/event/merge_config.js index ab2cb429..da52ed01 100644 --- a/scripts/event/merge_config.js +++ b/scripts/event/merge_config.js @@ -412,6 +412,7 @@ hexo.extend.filter.register('before_generate', () => { }, rightside: { enable: false, + percent: false, hide: { enable: false, translate: false, diff --git a/source/css/_layout/rightside.styl b/source/css/_layout/rightside.styl index 13e57ef0..1474b380 100644 --- a/source/css/_layout/rightside.styl +++ b/source/css/_layout/rightside.styl @@ -23,6 +23,20 @@ if hexo-config('rightside.enable') +maxWidth900() display: block + + &.top + &:hover + #percent + display: none + i + display: block + transition: all .3s + transform: scale(1.3) + i + transition: all .3s + display: none + &.show + display: block .rs_hide transform: translate(45px, 0) diff --git a/source/js/main.js b/source/js/main.js index a2da3492..85e26887 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -68,11 +68,13 @@ const percent = () => { const scrollPos = window.pageYOffset || docEl.scrollTop; const totalScrollableHeight = Math.max(body.scrollHeight, docEl.scrollHeight, body.offsetHeight, docEl.offsetHeight, body.clientHeight, docEl.clientHeight) - docEl.clientHeight; const scrolledPercent = Math.round((scrollPos / totalScrollableHeight) * 100); - const navToTop = document.querySelector("#nav-totop"); + const navToTop = document.querySelector("#nav-totop") || null; + const rsToTop = document.querySelector(".rs_show .top i") || null; const percentDisplay = document.querySelector("#percent"); const isNearEnd = (window.scrollY + docEl.clientHeight) >= (document.getElementById("post-comment") || document.getElementById("footer")).offsetTop; - navToTop.classList.toggle("long", isNearEnd || scrolledPercent > 90); - percentDisplay.textContent = isNearEnd || scrolledPercent > 90 ? GLOBAL_CONFIG.lang.backtop : scrolledPercent; + navToTop && navToTop.classList.toggle("long", isNearEnd || scrolledPercent > 90); + rsToTop && rsToTop.classList.toggle("show", isNearEnd || scrolledPercent > 90); + percentDisplay.textContent = isNearEnd || scrolledPercent > 90 ? navToTop ? GLOBAL_CONFIG.lang.backtop : '' : scrolledPercent; document.querySelectorAll(".needEndHide").forEach(item => item.classList.toggle("hide", totalScrollableHeight - scrollPos < 100)); } const showTodayCard = () => { From 0e324e410ba8cde0e4ad64d52ac07f71e5dccacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=B0=8F=E5=8F=AA=E6=89=98=E5=B0=BC?= Date: Tue, 1 Oct 2024 10:45:41 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E2=9C=A8=20=E5=A2=9E=E5=8A=A0=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E6=A0=8F=E5=88=87=E6=8D=A2=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 1 + languages/default.yml | 3 ++- languages/en.yml | 3 ++- languages/zh-CN.yml | 3 ++- languages/zh-TW.yml | 3 ++- layout/includes/widgets/rightside/hide.pug | 5 ++++- source/css/_layout/rightside.styl | 5 +++++ 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/_config.yml b/_config.yml index 331440fe..72fee518 100644 --- a/_config.yml +++ b/_config.yml @@ -968,6 +968,7 @@ rightside: enable: false translate: false mode: false + aside: false # --------------------------- start --------------------------- # --------------------------- start --------------------------- diff --git a/languages/default.yml b/languages/default.yml index cae7e9ca..fabf8213 100644 --- a/languages/default.yml +++ b/languages/default.yml @@ -242,4 +242,5 @@ rightside: top: Top hide: translate: 简繁转换 - mode: Mode \ No newline at end of file + mode: Mode + aside: Sidebar \ No newline at end of file diff --git a/languages/en.yml b/languages/en.yml index d92442c6..772bddc5 100755 --- a/languages/en.yml +++ b/languages/en.yml @@ -243,4 +243,5 @@ rightside: top: Top hide: translate: 简繁转换 - mode: Mode \ No newline at end of file + mode: Mode + aside: Sidebar \ No newline at end of file diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index b27d572f..1d768451 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -242,4 +242,5 @@ rightside: top: 返回顶部 hide: translate: 简繁转换 - mode: 显示模式切换 \ No newline at end of file + mode: 显示模式切换 + aside: 侧边栏 \ No newline at end of file diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 63bf7a1e..36af9b93 100755 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -241,4 +241,5 @@ rightside: top: 返回頂部 hide: translate: 簡繁轉換 - mode: 顯示模式切換 \ No newline at end of file + mode: 顯示模式切換 + aside: 側邊欄 \ No newline at end of file diff --git a/layout/includes/widgets/rightside/hide.pug b/layout/includes/widgets/rightside/hide.pug index b18505d2..462d5101 100644 --- a/layout/includes/widgets/rightside/hide.pug +++ b/layout/includes/widgets/rightside/hide.pug @@ -3,4 +3,7 @@ button.translate(type='button' title=_p('rightside.hide.translate'))= '简' if theme.rightside.hide.mode button.mode(type='button' title=_p('rightside.hide.mode') onclick='sco.switchDarkMode()') - i.fas.fa-circle-half-stroke \ No newline at end of file + i.fas.fa-circle-half-stroke + if theme.rightside.hide.aside + button.aside.pc(type='button' title=_p('rightside.hide.aside') onclick='sco.switchHideAside()') + i.fas.fa-arrows-alt-h \ No newline at end of file diff --git a/source/css/_layout/rightside.styl b/source/css/_layout/rightside.styl index 1474b380..616065cd 100644 --- a/source/css/_layout/rightside.styl +++ b/source/css/_layout/rightside.styl @@ -18,6 +18,11 @@ if hexo-config('rightside.enable') text-align: center font-size: 16px + &.pc + display: blok + +maxWidth900() + display: none + &.mobile display: none From ba54bc34ed57ccb3b1287308102141edc0e463dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=B0=8F=E5=8F=AA=E6=89=98=E5=B0=BC?= Date: Tue, 1 Oct 2024 11:01:46 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E2=9C=A8=20=E6=96=87=E7=AB=A0=E7=89=88?= =?UTF-8?q?=E6=9D=83=E6=8C=89=E9=92=AE=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/css/_layout/capsule.styl | 5 +++++ source/css/_post/tools.styl | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source/css/_layout/capsule.styl b/source/css/_layout/capsule.styl index 1a05ce78..097378aa 100644 --- a/source/css/_layout/capsule.styl +++ b/source/css/_layout/capsule.styl @@ -57,6 +57,11 @@ if hexo-config('capsule.enable') .aplayer-played animation-play-state running + height: 100%; + opacity: .1; + background-color: var(--efu-white) !important; + animation: lightBar 5s ease infinite; + animation-play-state: paused; #nav-music-hoverTips opacity 0 diff --git a/source/css/_post/tools.styl b/source/css/_post/tools.styl index d9ea069a..49891cf1 100644 --- a/source/css/_post/tools.styl +++ b/source/css/_post/tools.styl @@ -59,7 +59,8 @@ border-radius: 8px line-height: 39px box-shadow: var(--efu-shadow-red) - display: inline-block + display: flex + align-items: center cursor: pointer transition: all .4s ease 0s @@ -181,6 +182,8 @@ height: 40px line-height: 39px box-shadow: var(--efu-shadow-green) + display: flex + align-items: center border-radius: 8px cursor: pointer text-align: center From 3e659e24aefcc8033a4fc15194de385528fe7503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=B0=8F=E5=8F=AA=E6=89=98=E5=B0=BC?= Date: Tue, 1 Oct 2024 11:08:27 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E4=BF=A1=E6=81=AF=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/widgets/post/postInfo.pug | 2 +- source/css/_post/meta.styl | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/layout/includes/widgets/post/postInfo.pug b/layout/includes/widgets/post/postInfo.pug index 55ac55d8..630c9203 100644 --- a/layout/includes/widgets/post/postInfo.pug +++ b/layout/includes/widgets/post/postInfo.pug @@ -18,7 +18,7 @@ .meta-secondline if theme.post.meta.date span.post-meta-date(title=_p('post.posted') + ' ' + full_date(page.date)) - i.post-meta-icon.solitude.fa-solid.fa-clock + i.post-meta-icon.solitude.fas.fa-calendar-days time(datetime=date_xml(page.date))= date_xml(page.date) if theme.post.meta.updated span.post-meta-date(title=_p('post.updated') + ' ' + full_date(page.updated)) diff --git a/source/css/_post/meta.styl b/source/css/_post/meta.styl index fc882200..cb890bcf 100644 --- a/source/css/_post/meta.styl +++ b/source/css/_post/meta.styl @@ -206,7 +206,7 @@ transition all .3s ease-out 0s i - font-size 13px + font-size 14px margin-right 4px > div @@ -241,7 +241,6 @@ margin 0 1rem 0 0 .post-meta-pv - margin-right 8px padding 0 8px display flex align-items center @@ -264,7 +263,6 @@ cursor pointer transition .3s border-radius 12px - padding 8px &:hover opacity 1 From f3c50f3e6b6706324986c1d911ef80f80c7005cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=B0=8F=E5=8F=AA=E6=89=98=E5=B0=BC?= Date: Tue, 1 Oct 2024 11:11:03 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E2=9C=A8=20v2.1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 82a29964..efea5044 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-solitude", - "version": "2.1.0", + "version": "2.1.1", "description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.", "main": "package.json", "scripts": {