hexo-theme-solitude 1.7.10 → 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.10",
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;"
@@ -2,7 +2,7 @@ include ../widgets/page/banner
2
2
  if theme.says.enable
3
3
  #bber
4
4
  section.timeline.page-1
5
- ul.list#waterfall
5
+ ul.list.waterfall
6
6
  each item in site.data.essay.essay_list.slice(0, theme.says.strip)
7
7
  li.item
8
8
  if theme.says.style === 2
@@ -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.10",
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
@@ -28,7 +28,7 @@ const gallery = (args, content) => {
28
28
  }
29
29
  html += `<div class="gallery-item"><img class="nolazyload" src=${m[2]} alt="${m[1]}" /></div>`
30
30
  }
31
- return `<div class="gallery-container" id="waterfall">
31
+ return `<div class="gallery-container waterfall">
32
32
  ${html}
33
33
  </div>`
34
34
  }
@@ -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
@@ -275,14 +275,7 @@ if hexo-config('says.enable')
275
275
  text-align justify
276
276
 
277
277
  .timeline
278
- #waterfall
279
- opacity 0
280
- transition .3s
281
-
282
- &.show
283
- opacity 1
284
-
285
- ul
278
+ ul
286
279
  li
287
280
  &.item
288
281
  position relative
@@ -104,4 +104,10 @@
104
104
  img
105
105
  max-width: 100%;
106
106
  border-radius: 0;
107
- margin 0
107
+ margin 0
108
+
109
+ .waterfall
110
+ opacity 0
111
+ transition .3s
112
+ &.show
113
+ opacity 1
package/source/js/main.js CHANGED
@@ -30,7 +30,7 @@ const sidebarFn = () => {
30
30
  if (utils.isHidden($toggleMenu)) {
31
31
  if ($mobileSidebarMenus.classList.contains('open')) closeMobileSidebar()
32
32
  }
33
- sco.reflashEssayWaterFall();
33
+ sco.refreshWaterFall();
34
34
  })
35
35
  }
36
36
 
@@ -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')
@@ -329,14 +295,11 @@ let sco = {
329
295
  const el = document.getElementById('console')
330
296
  el && el.classList.remove('show')
331
297
  },
332
- reflashEssayWaterFall: function () {
333
- const el = document.getElementById('waterfall')
334
- el && (() => {
335
- setTimeout(function () {
336
- waterfall('#waterfall');
337
- el.classList.add('show');
338
- }, 500);
339
- })();
298
+ refreshWaterFall: function () {
299
+ const els = document.querySelectorAll('.waterfall')
300
+ if (els.length !== 0) {
301
+ els.forEach(el => waterfall(el) || el.classList.add('show'))
302
+ }
340
303
  },
341
304
  addRuntime: function () {
342
305
  let el = document.getElementById('runtimeshow')
@@ -461,17 +424,13 @@ let sco = {
461
424
  categoryBarItems.forEach(item => {
462
425
  item.classList.remove("select");
463
426
  });
464
- }
465
- if (decodedPath === "/") {
466
- if (categoryBar) {
427
+ if (decodedPath === "/") {
467
428
  const homeItem = document.getElementById("category-bar-home");
468
429
  homeItem.classList.add("select");
469
- }
470
- } else {
471
- if (/\/categories\/.*?\//.test(decodedPath)) {
472
- let category = decodedPath.split("/").slice(-2, -1)[0];
473
- category = category.charAt(0).toUpperCase() + category.slice(1);
474
- if (categoryBar) {
430
+ } else {
431
+ if (/\/categories\/.*?\//.test(decodedPath)) {
432
+ let category = decodedPath.split("/").slice(-2, -1)[0];
433
+ category = category.charAt(0).toUpperCase() + category.slice(1);
475
434
  const categoryItem = document.getElementById(category);
476
435
  if (categoryItem) {
477
436
  categoryItem.classList.add("select");
@@ -831,18 +790,21 @@ class tabs {
831
790
  }
832
791
  }
833
792
 
793
+ sco.initAdjust()
794
+ initObserver()
795
+ addCopyright()
796
+ sco.initConsoleState()
797
+
834
798
  window.refreshFn = () => {
799
+ document.body.setAttribute('data-type', PAGE_CONFIG.page)
835
800
  if (PAGE_CONFIG.is_home || PAGE_CONFIG.is_page) {
836
801
  sco.changeTimeFormat(document.querySelectorAll('#recent-posts time, .webinfo-item time'))
837
802
  GLOBAL_CONFIG.runtime && sco.addRuntime()
838
803
  } else {
839
804
  sco.changeTimeFormat(document.querySelectorAll('#post-meta time'))
840
805
  }
841
-
842
- sco.initAdjust()
843
806
  scrollFn()
844
807
  sidebarFn()
845
- initObserver()
846
808
  sco.hideCookie()
847
809
  sco.addPhotoFigcaption()
848
810
  sco.setTimeState()
@@ -850,19 +812,16 @@ window.refreshFn = () => {
850
812
  sco.categoriesBarActive()
851
813
  sco.listenToPageInputPress()
852
814
  sco.addNavBackgroundInit()
853
- sco.reflashEssayWaterFall()
815
+ sco.refreshWaterFall()
854
816
  GLOBAL_CONFIG.lazyload.enable && utils.lazyloadImg()
855
817
  GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll("#article-container img:not(.flink-avatar,.gallery-group img)"))
856
818
  GLOBAL_CONFIG.randomlink && randomLinksList()
857
819
  PAGE_CONFIG.comment && initComment()
858
820
  PAGE_CONFIG.toc && toc.init();
859
821
  (PAGE_CONFIG.is_post || PAGE_CONFIG.is_page) && ((addHighlight()) || tabs.init())
860
- addCopyright()
861
822
  PAGE_CONFIG.is_home && showTodayCard()
862
823
  GLOBAL_CONFIG.covercolor.enable && coverColor()
863
- sco.initConsoleState()
864
824
  GLOBAL_CONFIG.comment.commentBarrage && PAGE_CONFIG.comment && initializeCommentBarrage()
865
- document.body.setAttribute('data-type', PAGE_CONFIG.page)
866
825
  PAGE_CONFIG.page === "music" && scoMusic.init()
867
826
  GLOBAL_CONFIG.post_ai && PAGE_CONFIG.page === "post" && efu_ai.init()
868
827
  }
@@ -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);