hexo-theme-solitude 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/_config.yml CHANGED
@@ -963,10 +963,12 @@ translate:
963
963
  # 右下角悬停导航栏
964
964
  rightside:
965
965
  enable: false
966
+ percent: false
966
967
  hide:
967
968
  enable: false
968
969
  translate: false
969
970
  mode: false
971
+ aside: false
970
972
  # --------------------------- start ---------------------------
971
973
 
972
974
  # --------------------------- start ---------------------------
@@ -242,4 +242,5 @@ rightside:
242
242
  top: Top
243
243
  hide:
244
244
  translate: 简繁转换
245
- mode: Mode
245
+ mode: Mode
246
+ aside: Sidebar
package/languages/en.yml CHANGED
@@ -243,4 +243,5 @@ rightside:
243
243
  top: Top
244
244
  hide:
245
245
  translate: 简繁转换
246
- mode: Mode
246
+ mode: Mode
247
+ aside: Sidebar
@@ -242,4 +242,5 @@ rightside:
242
242
  top: 返回顶部
243
243
  hide:
244
244
  translate: 简繁转换
245
- mode: 显示模式切换
245
+ mode: 显示模式切换
246
+ aside: 侧边栏
@@ -241,4 +241,5 @@ rightside:
241
241
  top: 返回頂部
242
242
  hide:
243
243
  translate: 簡繁轉換
244
- mode: 顯示模式切換
244
+ mode: 顯示模式切換
245
+ aside: 側邊欄
@@ -115,15 +115,20 @@
115
115
  }
116
116
  }
117
117
  if (theme.translate.enable) {
118
- rightMenu.translate = {
119
- translateDelay: theme.translate.translateDelay,
120
- defaultEncoding: theme.translate.defaultEncoding
121
- }
118
+ rightMenu.translate = theme.right_menu.translate
122
119
  }
123
120
  if (theme.right_menu.ctrlOriginalMenu)
124
121
  rightMenu.ctrlOriginalMenu = _p('right_menu.ctrl_original_menu')
125
122
  }
126
123
 
124
+ let translate = false
125
+ if (theme.translate.enable) {
126
+ translate = {
127
+ translateDelay: theme.translate.translateDelay,
128
+ defaultEncoding: theme.translate.defaultEncoding
129
+ }
130
+ }
131
+
127
132
  let highlight = false
128
133
  if (theme.highlight.enable) {
129
134
  highlight = {
@@ -187,6 +192,7 @@ script.
187
192
  lightbox: '!{ theme.mediumZoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null")}',
188
193
  post_ai: !{post_ai},
189
194
  right_menu: !{rightMenu ? JSON.stringify(rightMenu) : false},
195
+ translate: !{translate ? JSON.stringify(translate) : false},
190
196
  lure: !{lure ? JSON.stringify(lure) : false},
191
197
  expire: !{expire ? JSON.stringify(expire) : false},
192
198
  };
@@ -18,11 +18,11 @@ if theme.console.enable
18
18
  i.left
19
19
  i.center
20
20
  i.right
21
-
22
- .nav-button#nav-totop(onclick="sco.toTop()")
23
- a.totopbtn
24
- i.solitude.fa-solid.fa-arrow-up
25
- span#percent= "0"
21
+ if !theme.rightside.percent
22
+ .nav-button#nav-totop(onclick="sco.toTop()")
23
+ a.totopbtn
24
+ i.solitude.fa-solid.fa-arrow-up
25
+ span#percent= "0"
26
26
  #toggle-menu
27
27
  a.site-page
28
28
  i.solitude.fa-solid.fa-bars
@@ -18,7 +18,7 @@
18
18
  .meta-secondline
19
19
  if theme.post.meta.date
20
20
  span.post-meta-date(title=_p('post.posted') + ' ' + full_date(page.date))
21
- i.post-meta-icon.solitude.fa-solid.fa-clock
21
+ i.post-meta-icon.solitude.fas.fa-calendar-days
22
22
  time(datetime=date_xml(page.date))= date_xml(page.date)
23
23
  if theme.post.meta.updated
24
24
  span.post-meta-date(title=_p('post.updated') + ' ' + full_date(page.updated))
@@ -3,4 +3,7 @@
3
3
  button.translate(type='button' title=_p('rightside.hide.translate'))= '简'
4
4
  if theme.rightside.hide.mode
5
5
  button.mode(type='button' title=_p('rightside.hide.mode') onclick='sco.switchDarkMode()')
6
- i.fas.fa-circle-half-stroke
6
+ i.fas.fa-circle-half-stroke
7
+ if theme.rightside.hide.aside
8
+ button.aside.pc(type='button' title=_p('rightside.hide.aside') onclick='sco.switchHideAside()')
9
+ i.fas.fa-arrows-alt-h
@@ -9,4 +9,5 @@
9
9
  button.comment(type='button' title=_p('rightside.show.comment') onclick="sco.scrollTo('post-comment')")
10
10
  i.fas.fa-comment
11
11
  button.top(type='button' title=_p('rightside.show.top') onclick='sco.toTop()')
12
- i.fas.fa-arrow-up
12
+ i.fas.fa-arrow-up
13
+ span#percent= "0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -412,6 +412,7 @@ hexo.extend.filter.register('before_generate', () => {
412
412
  },
413
413
  rightside: {
414
414
  enable: false,
415
+ percent: false,
415
416
  hide: {
416
417
  enable: false,
417
418
  translate: false,
@@ -57,6 +57,11 @@ if hexo-config('capsule.enable')
57
57
 
58
58
  .aplayer-played
59
59
  animation-play-state running
60
+ height: 100%;
61
+ opacity: .1;
62
+ background-color: var(--efu-white) !important;
63
+ animation: lightBar 5s ease infinite;
64
+ animation-play-state: paused;
60
65
 
61
66
  #nav-music-hoverTips
62
67
  opacity 0
@@ -18,11 +18,30 @@ if hexo-config('rightside.enable')
18
18
  text-align: center
19
19
  font-size: 16px
20
20
 
21
+ &.pc
22
+ display: blok
23
+ +maxWidth900()
24
+ display: none
25
+
21
26
  &.mobile
22
27
  display: none
23
28
 
24
29
  +maxWidth900()
25
30
  display: block
31
+
32
+ &.top
33
+ &:hover
34
+ #percent
35
+ display: none
36
+ i
37
+ display: block
38
+ transition: all .3s
39
+ transform: scale(1.3)
40
+ i
41
+ transition: all .3s
42
+ display: none
43
+ &.show
44
+ display: block
26
45
 
27
46
  .rs_hide
28
47
  transform: translate(45px, 0)
@@ -206,7 +206,7 @@
206
206
  transition all .3s ease-out 0s
207
207
 
208
208
  i
209
- font-size 13px
209
+ font-size 14px
210
210
  margin-right 4px
211
211
 
212
212
  > div
@@ -241,7 +241,6 @@
241
241
  margin 0 1rem 0 0
242
242
 
243
243
  .post-meta-pv
244
- margin-right 8px
245
244
  padding 0 8px
246
245
  display flex
247
246
  align-items center
@@ -264,7 +263,6 @@
264
263
  cursor pointer
265
264
  transition .3s
266
265
  border-radius 12px
267
- padding 8px
268
266
 
269
267
  &:hover
270
268
  opacity 1
@@ -59,7 +59,8 @@
59
59
  border-radius: 8px
60
60
  line-height: 39px
61
61
  box-shadow: var(--efu-shadow-red)
62
- display: inline-block
62
+ display: flex
63
+ align-items: center
63
64
  cursor: pointer
64
65
  transition: all .4s ease 0s
65
66
 
@@ -181,6 +182,8 @@
181
182
  height: 40px
182
183
  line-height: 39px
183
184
  box-shadow: var(--efu-shadow-green)
185
+ display: flex
186
+ align-items: center
184
187
  border-radius: 8px
185
188
  cursor: pointer
186
189
  text-align: center
package/source/js/main.js CHANGED
@@ -68,11 +68,13 @@ const percent = () => {
68
68
  const scrollPos = window.pageYOffset || docEl.scrollTop;
69
69
  const totalScrollableHeight = Math.max(body.scrollHeight, docEl.scrollHeight, body.offsetHeight, docEl.offsetHeight, body.clientHeight, docEl.clientHeight) - docEl.clientHeight;
70
70
  const scrolledPercent = Math.round((scrollPos / totalScrollableHeight) * 100);
71
- const navToTop = document.querySelector("#nav-totop");
71
+ const navToTop = document.querySelector("#nav-totop") || null;
72
+ const rsToTop = document.querySelector(".rs_show .top i") || null;
72
73
  const percentDisplay = document.querySelector("#percent");
73
74
  const isNearEnd = (window.scrollY + docEl.clientHeight) >= (document.getElementById("post-comment") || document.getElementById("footer")).offsetTop;
74
- navToTop.classList.toggle("long", isNearEnd || scrolledPercent > 90);
75
- percentDisplay.textContent = isNearEnd || scrolledPercent > 90 ? GLOBAL_CONFIG.lang.backtop : scrolledPercent;
75
+ navToTop && navToTop.classList.toggle("long", isNearEnd || scrolledPercent > 90);
76
+ rsToTop && rsToTop.classList.toggle("show", isNearEnd || scrolledPercent > 90);
77
+ percentDisplay.textContent = isNearEnd || scrolledPercent > 90 ? navToTop ? GLOBAL_CONFIG.lang.backtop : '' : scrolledPercent;
76
78
  document.querySelectorAll(".needEndHide").forEach(item => item.classList.toggle("hide", totalScrollableHeight - scrollPos < 100));
77
79
  }
78
80
  const showTodayCard = () => {
@@ -1,5 +1,5 @@
1
1
  document.addEventListener('DOMContentLoaded', function () {
2
- const { defaultEncoding, translateDelay } = GLOBAL_CONFIG.right_menu.translate;
2
+ const { defaultEncoding, translateDelay } = GLOBAL_CONFIG.translate;
3
3
  const targetEncodingCookie = 'translate-chn-cht';
4
4
 
5
5
  let currentEncoding = defaultEncoding;