hexo-theme-solitude 1.7.11 → 1.7.12

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
@@ -64,6 +64,7 @@ nav:
64
64
  right:
65
65
  random: false # 随机文章跳转 / random post button
66
66
  console: false #控制台 / console
67
+ top: false # 进度球 / Progress Ball
67
68
  # 自定义按钮
68
69
  # custom button
69
70
  # 左至右
@@ -111,7 +111,7 @@ script.
111
111
  )(window)
112
112
 
113
113
  console.log(
114
- "%c Program: Hexo %c Theme: Solitude %c Version: v1.7.11",
114
+ "%c Program: Hexo %c Theme: Solitude %c Version: v1.7.12",
115
115
  "border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
116
116
  "padding: 5px 10px;color:white;background:#3e9f50;",
117
117
  "border-radius:0 5px 5px 0;padding: 5px 10px;background:#0084ff;color:white;"
@@ -15,10 +15,47 @@ if theme.nav.right.console
15
15
  .nav-button#nav-console
16
16
  a.console_switchbutton(onclick="sco.showConsole()", title=_p('nav.console'), href="javascript:void(0);")
17
17
  i.solitude.st-dashboard-fill
18
- .nav-button#nav-totop(onclick="sco.toTop()")
19
- a.totopbtn
20
- i.solitude.st-arrow-up-line
21
- span#percent= "0"
18
+ if theme.nav.right.top
19
+ .nav-button#nav-totop(onclick="sco.toTop()")
20
+ a.totopbtn
21
+ i.solitude.st-arrow-up-line
22
+ span#percent= "0"
23
+
24
+ script.
25
+ document.addEventListener('DOMContentLoaded', () => {
26
+ const percent = () => {
27
+ let scrollTop = document.documentElement.scrollTop || window.pageYOffset
28
+ let totalHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - document.documentElement.clientHeight
29
+ let scrollPercent = Math.round(scrollTop / totalHeight * 100)
30
+ let percentElement = document.querySelector("#percent")
31
+ let viewportBottom = window.scrollY + document.documentElement.clientHeight
32
+ let remainingScroll = totalHeight - scrollTop
33
+
34
+ if ((document.getElementById("post-comment") || document.getElementById("footer")).offsetTop < viewportBottom || scrollPercent > 90) {
35
+ document.querySelector("#nav-totop").classList.add("long")
36
+ percentElement.innerHTML = GLOBAL_CONFIG.lang.backtop
37
+ } else {
38
+ document.querySelector("#nav-totop").classList.remove("long")
39
+ if (scrollPercent >= 0) {
40
+ percentElement.innerHTML = scrollPercent + ""
41
+ }
42
+ }
43
+
44
+ let elementsToHide = document.querySelectorAll(".needEndHide")
45
+ if (remainingScroll < 100) {
46
+ elementsToHide.forEach(function (element) {
47
+ element.classList.add("hide")
48
+ })
49
+ } else {
50
+ elementsToHide.forEach(function (element) {
51
+ element.classList.remove("hide")
52
+ })
53
+ }
54
+
55
+ window.onscroll = percent
56
+ }
57
+ percent()
58
+ })
22
59
  #toggle-menu
23
60
  a.site-page
24
61
  i.solitude.st-menu-line
@@ -12,7 +12,7 @@
12
12
  #search-results
13
13
  #algolia-hits
14
14
  each tag in theme.search.tags || []
15
- a.tag-list(href="javascript:void(0);" onclick="pjax.loadUrl('/tags/" + tag + "/')")=tag
15
+ a.tag-list(href='javascript:void(0);' onclick="pjax.loadUrl('" + url_for('/tags/' + tag) + "/')")=tag
16
16
 
17
17
  #algolia-tips
18
18
  #algolia-pagination
@@ -10,7 +10,7 @@
10
10
  div#search-results
11
11
  #search-hits
12
12
  each tag in theme.search.tags || []
13
- a.tag-list(href='javascript:void(0);' onclick="pjax.loadUrl('/tags/" + tag + "/')")=tag
13
+ a.tag-list(href='javascript:void(0);' onclick="pjax.loadUrl('" + url_for('/tags/' + tag) + "/')")=tag
14
14
  div#search-pagination
15
15
  div#search-tips
16
16
  div#search-mask
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "1.7.11",
3
+ "version": "1.7.12",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by the efu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
package/plugins.yml CHANGED
@@ -1,11 +1,11 @@
1
1
  algolia_search:
2
2
  name: algoliasearch
3
3
  file: dist/algoliasearch-lite.umd.js
4
- version: 4.22.0
4
+ version: 4.23.2
5
5
  instantsearch:
6
6
  name: instantsearch.js
7
7
  file: dist/instantsearch.production.min.js
8
- version: 4.63.0
8
+ version: 4.66.1
9
9
  pjax:
10
10
  name: pjax
11
11
  file: pjax.min.js
@@ -13,7 +13,7 @@ pjax:
13
13
  twikoo:
14
14
  name: twikoo
15
15
  file: dist/twikoo.all.min.js
16
- version: 1.6.31
16
+ version: 1.6.32
17
17
  waline_js:
18
18
  name: 'waline'
19
19
  file: dist/waline.js
@@ -27,14 +27,10 @@ valine:
27
27
  name: valine
28
28
  file: dist/Valine.min.js
29
29
  version: 1.5.1
30
- sharejs:
31
- name: butterfly-extsrc
32
- file: sharejs/dist/js/social-share.min.js
33
- version: 1.1.3
34
- sharejs_css:
35
- name: butterfly-extsrc
36
- file: sharejs/dist/css/share.min.css
37
- version: 1.1.3
30
+ discuss:
31
+ name: discuss
32
+ file: dist/discuss.js
33
+ version: 1.2.7
38
34
  katex:
39
35
  name: katex
40
36
  file: dist/katex.min.css
@@ -48,7 +44,7 @@ katex_copytex:
48
44
  lazyload:
49
45
  name: vanilla-lazyload
50
46
  file: dist/lazyload.iife.min.js
51
- version: 17.8.5
47
+ version: 19.1.3
52
48
  aplayer_css:
53
49
  name: aplayer
54
50
  file: dist/APlayer.min.css
@@ -67,13 +63,15 @@ pace_js:
67
63
  file: pace.min.js
68
64
  version: 1.2.4
69
65
  swiper_css:
70
- name: Swiper
66
+ name: swiper
71
67
  file: swiper-bundle.min.css
72
68
  version: 11.0.5
69
+ other_name: Swiper
73
70
  swiper_js:
74
- name: Swiper
71
+ name: swiper
75
72
  file: swiper-bundle.min.js
76
73
  version: 11.0.5
74
+ other_name: Swiper
77
75
  busuanzi_js:
78
76
  name: busuanzi
79
77
  file: bsz.pure.mini.js
@@ -91,13 +89,15 @@ medium_zoom:
91
89
  file: dist/medium-zoom.min.js
92
90
  version: 1.1.0
93
91
  fancyapps_ui:
94
- name: fancyapps-ui
92
+ name: '@fancyapps/ui'
95
93
  file: dist/fancybox/fancybox.umd.js
96
- version: 5.0.33
94
+ version: 5.0.35
95
+ other_name: fancyapps-ui
97
96
  fancyapps_css:
98
- name: fancyapps-ui
99
- file: dist/fancybox/fancybox.min.css
100
- version: 5.0.33
97
+ name: '@fancyapps/ui'
98
+ file: dist/fancybox/fancybox.css
99
+ version: 5.0.35
100
+ other_name: fancyapps-ui
101
101
  mermaid_js:
102
102
  name: mermaid
103
103
  file: dist/mermaid.min.js
@@ -267,17 +267,17 @@
267
267
 
268
268
  &.no-top-img
269
269
  margin-bottom 0
270
+ if hexo-config('nav.right.top')
271
+ &:not(.nav-fixed)
272
+ #percent
273
+ transition .3s
270
274
 
271
- &:not(.nav-fixed)
272
- #percent
273
- transition .3s
274
-
275
- #nav-right #nav-totop
276
- width 0
277
- transform scale(0)
278
- margin-left 0
279
- overflow hidden
280
- transition .3s ease-in
275
+ #nav-right #nav-totop
276
+ width 0
277
+ transform scale(0)
278
+ margin-left 0
279
+ overflow hidden
280
+ transition .3s ease-in
281
281
 
282
282
  #page-header #scroll-down .scroll-down-effects,
283
283
  #page-header #site-subtitle, #page-header #site-title
@@ -606,40 +606,51 @@
606
606
  #site-logo
607
607
  width 121px
608
608
 
609
- #nav-totop
610
- position relative
611
- width 35px
612
- height 35px
613
- display flex
614
- border-radius 40px
615
- transition all .3s ease-in-out
616
- align-items center
617
-
618
- &.long
619
- width 80px
620
-
621
- .totopbtn
622
- padding-top 0
609
+ if hexo-config('nav.right.top')
610
+ #nav-totop
611
+ position relative
612
+ width 35px
613
+ height 35px
614
+ display flex
615
+ border-radius 40px
616
+ transition all .3s ease-in-out
617
+ align-items center
623
618
 
624
- i
625
- position absolute
626
- display flex
627
- font-size 22px
628
- opacity 0
629
- line-height 1
619
+ &.long
620
+ width 80px
630
621
 
631
- &:hover
632
622
  .totopbtn
623
+ padding-top 0
624
+
633
625
  i
634
- opacity 1
635
- color var(--efu-card-bg)
636
- transition .3s
626
+ position absolute
627
+ display flex
628
+ font-size 22px
629
+ opacity 0
630
+ line-height 1
631
+
632
+ &:hover
633
+ .totopbtn
634
+ i
635
+ opacity 1
636
+ color var(--efu-card-bg)
637
+ transition .3s
638
+
639
+ #percent
640
+ opacity 0
641
+ font-weight 700
637
642
 
638
643
  #percent
639
- opacity 0
640
- font-weight 700
644
+ font-size 12px
645
+ border-radius 35px
646
+ display flex
647
+ justify-content center
648
+ align-items center
649
+ transition .3s
650
+ white-space nowrap
641
651
 
642
- #percent
652
+ .nav-fixed #nav-totop #percent,
653
+ .page #nav-totop #percent
643
654
  font-size 12px
644
655
  border-radius 35px
645
656
  display flex
@@ -648,16 +659,6 @@
648
659
  transition .3s
649
660
  white-space nowrap
650
661
 
651
- .nav-fixed #nav-totop #percent,
652
- .page #nav-totop #percent
653
- font-size 12px
654
- border-radius 35px
655
- display flex
656
- justify-content center
657
- align-items center
658
- transition .3s
659
- white-space nowrap
660
-
661
662
  if hexo-config('nav.group')
662
663
  .back-home-button
663
664
  display flex
package/source/js/main.js CHANGED
@@ -54,8 +54,6 @@ const scrollFn = function () {
54
54
  } else {
55
55
  $header.classList.remove('nav-fixed', 'nav-visible');
56
56
  }
57
-
58
- percent();
59
57
  }, 200));
60
58
 
61
59
  function scrollDirection(currentTop) {
@@ -65,38 +63,6 @@ const scrollFn = function () {
65
63
  }
66
64
  }
67
65
 
68
- const percent = () => {
69
- let scrollTop = document.documentElement.scrollTop || window.pageYOffset
70
- let totalHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - document.documentElement.clientHeight
71
- let scrollPercent = Math.round(scrollTop / totalHeight * 100)
72
- let percentElement = document.querySelector("#percent")
73
- let viewportBottom = window.scrollY + document.documentElement.clientHeight
74
- let remainingScroll = totalHeight - scrollTop
75
-
76
- if ((document.getElementById("post-comment") || document.getElementById("footer")).offsetTop < viewportBottom || scrollPercent > 90) {
77
- document.querySelector("#nav-totop").classList.add("long")
78
- percentElement.innerHTML = GLOBAL_CONFIG.lang.backtop
79
- } else {
80
- document.querySelector("#nav-totop").classList.remove("long")
81
- if (scrollPercent >= 0) {
82
- percentElement.innerHTML = scrollPercent + ""
83
- }
84
- }
85
-
86
- let elementsToHide = document.querySelectorAll(".needEndHide")
87
- if (remainingScroll < 100) {
88
- elementsToHide.forEach(function (element) {
89
- element.classList.add("hide")
90
- })
91
- } else {
92
- elementsToHide.forEach(function (element) {
93
- element.classList.remove("hide")
94
- })
95
- }
96
-
97
- window.onscroll = percent
98
- }
99
-
100
66
 
101
67
  const showTodayCard = () => {
102
68
  const el = document.getElementById('todayCard')
@@ -222,7 +222,6 @@ window.oncontextmenu = (ele) => {
222
222
  rm.menuItems.paste.addEventListener('click', () => rm.pasteText() && rm.hideRightMenu())
223
223
  rm.menuItems.comment.addEventListener('click', () => rm.hideRightMenu() || sco.toTalk(selectTextNow))
224
224
  rm.menuItems.new.addEventListener('click', () => window.open(rm.domhref) && rm.hideRightMenu())
225
- rm.menuItems.search.addEventListener('click', () => rm.hideRightMenu())
226
225
  rm.menuItems.downloadImg.addEventListener('click', () => rm.downloadImage() && rm.hideRightMenu())
227
226
  rm.menuItems.copyImg.addEventListener('click', () => rm.copyImage() && rm.hideRightMenu())
228
227
  }()
@@ -28,6 +28,15 @@ window.onload = () => {
28
28
  window.removeEventListener("resize", fixSafariHeight);
29
29
  };
30
30
 
31
+ const addEventTagList = () => {
32
+ const list = document.querySelectorAll("#local-search .tag-list");
33
+ if(list.length > 0){
34
+ list.forEach(el => el.addEventListener("click", (e) => closeSearch()))
35
+ }
36
+ }
37
+
38
+ addEventTagList()
39
+
31
40
  const searchFnOnce = () => {
32
41
  $searchMask.addEventListener("click", closeSearch);
33
42
  utils.addEventListenerPjax(document.querySelector("#local-search .search-close-button"), "click", closeSearch);