hexo-theme-solitude 1.7.9 → 1.7.11

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
@@ -811,30 +811,35 @@ google_adsense:
811
811
  right_menu:
812
812
  enable: false
813
813
  commentBarrage: false # 是否显示热评开关 / Whether to display the hot comment switch.
814
- translate: # 翻译功能(仅支持简繁)/ Translation function (Simplified and Traditional Chinese only)
814
+ # 翻译功能(仅支持简繁)
815
+ # Translation function (Simplified and Traditional Chinese only)
816
+ translate:
815
817
  enable: false
816
818
  defaultEncoding: 2 # 1: 默认繁体 2: 默认简体
817
- translateDelay: 0 # 翻译迟疑时间
818
- # 自定义菜单项列表 / Customize the list of menu items.
819
+ translateDelay: 0 # 首次加载翻译迟疑时间
820
+ # 自定义菜单项列表
821
+ # Customize the list of menu items.
819
822
  custom_list:
820
823
  # - name: 随机短文
821
- # url:
822
824
  # click: toRandomPost()
823
825
  # id: menu-randomPost
824
826
  # class:
825
827
  # icon: st-signal-tower-fill
826
828
  # - name: 全部分类
827
- # url: /categories/
828
- # click:
829
+ # click: pjax.loadUrl('/categories/') # 外链用 window.open,pjax 无法请求跨域内容
829
830
  # id:
830
831
  # class:
831
832
  # icon: st-checkbox-multiple-blank-fill
832
833
  # - name: 全部标签
833
- # url: /tags/
834
- # click:
834
+ # click: pjax.loadUrl('/tags/')
835
835
  # id:
836
836
  # class:
837
837
  # icon: st-price-tag-fill
838
+ # - name: 赞助主题
839
+ # click: window.open('https://afdian.net/a/efu0u0/', '_blank')
840
+ # id:
841
+ # class:
842
+ # icon: st-afdian-line
838
843
 
839
844
  # CDN
840
845
  # Don't modify the following settings unless you know how they work
@@ -13,6 +13,8 @@ mixin katex
13
13
  div
14
14
  script(src=url_for(theme.cdn.main))
15
15
  script(src=url_for(theme.cdn.utils))
16
+ script(src=url_for(theme.cdn.waterfall))
17
+ script(src=url_for(theme.cdn.pjax))
16
18
 
17
19
  if theme.comment.enable && theme.comment.type === 'valine'
18
20
  // md5
@@ -35,7 +37,6 @@ div
35
37
  else if page.katex
36
38
  +katex
37
39
 
38
- script(src=url_for(theme.cdn.pjax))
39
40
  if theme.lazyload.enable
40
41
  script(src=url_for(theme.cdn.lazyload))
41
42
  script(src=url_for(theme.cdn.snackbar))
@@ -68,9 +69,6 @@ div
68
69
  }
69
70
  script(src=url_for(theme.cdn.cover_api))
70
71
 
71
- if theme.says.enable
72
- script(src=url_for(theme.cdn.waterfall))
73
-
74
72
  if theme.comment.enable
75
73
  case theme.comment.type
76
74
  when 'twikoo'
@@ -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.9",
114
+ "%c Program: Hexo %c Theme: Solitude %c Version: v1.7.11",
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
@@ -52,7 +52,7 @@ div#rightMenu
52
52
  span= _p('right_menu.music.copyMusicName')
53
53
  div.rightMenu-group.rightMenu-line.rightMenuOther
54
54
  each item,index in custom_list
55
- a.rightMenu-item(id=item.id class=item.class href=item.href onclick=item.click)
55
+ div.rightMenu-item(id=item.id class=item.class onclick=item.click+'||rm.hideRightMenu()')
56
56
  i.solitude(class=item.icon)
57
57
  span= item.name
58
58
  div.rightMenu-group.rightMenu-line.rightMenuOther
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "1.7.9",
3
+ "version": "1.7.11",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by the efu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -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
  }
@@ -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
 
@@ -329,14 +329,11 @@ let sco = {
329
329
  const el = document.getElementById('console')
330
330
  el && el.classList.remove('show')
331
331
  },
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
- })();
332
+ refreshWaterFall: function () {
333
+ const els = document.querySelectorAll('.waterfall')
334
+ if (els.length !== 0) {
335
+ els.forEach(el => waterfall(el) || el.classList.add('show'))
336
+ }
340
337
  },
341
338
  addRuntime: function () {
342
339
  let el = document.getElementById('runtimeshow')
@@ -461,17 +458,13 @@ let sco = {
461
458
  categoryBarItems.forEach(item => {
462
459
  item.classList.remove("select");
463
460
  });
464
- }
465
- if (decodedPath === "/") {
466
- if (categoryBar) {
461
+ if (decodedPath === "/") {
467
462
  const homeItem = document.getElementById("category-bar-home");
468
463
  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) {
464
+ } else {
465
+ if (/\/categories\/.*?\//.test(decodedPath)) {
466
+ let category = decodedPath.split("/").slice(-2, -1)[0];
467
+ category = category.charAt(0).toUpperCase() + category.slice(1);
475
468
  const categoryItem = document.getElementById(category);
476
469
  if (categoryItem) {
477
470
  categoryItem.classList.add("select");
@@ -831,18 +824,21 @@ class tabs {
831
824
  }
832
825
  }
833
826
 
827
+ sco.initAdjust()
828
+ initObserver()
829
+ addCopyright()
830
+ sco.initConsoleState()
831
+
834
832
  window.refreshFn = () => {
833
+ document.body.setAttribute('data-type', PAGE_CONFIG.page)
835
834
  if (PAGE_CONFIG.is_home || PAGE_CONFIG.is_page) {
836
835
  sco.changeTimeFormat(document.querySelectorAll('#recent-posts time, .webinfo-item time'))
837
836
  GLOBAL_CONFIG.runtime && sco.addRuntime()
838
837
  } else {
839
838
  sco.changeTimeFormat(document.querySelectorAll('#post-meta time'))
840
839
  }
841
-
842
- sco.initAdjust()
843
840
  scrollFn()
844
841
  sidebarFn()
845
- initObserver()
846
842
  sco.hideCookie()
847
843
  sco.addPhotoFigcaption()
848
844
  sco.setTimeState()
@@ -850,19 +846,16 @@ window.refreshFn = () => {
850
846
  sco.categoriesBarActive()
851
847
  sco.listenToPageInputPress()
852
848
  sco.addNavBackgroundInit()
853
- sco.reflashEssayWaterFall()
849
+ sco.refreshWaterFall()
854
850
  GLOBAL_CONFIG.lazyload.enable && utils.lazyloadImg()
855
851
  GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll("#article-container img:not(.flink-avatar,.gallery-group img)"))
856
852
  GLOBAL_CONFIG.randomlink && randomLinksList()
857
853
  PAGE_CONFIG.comment && initComment()
858
854
  PAGE_CONFIG.toc && toc.init();
859
855
  (PAGE_CONFIG.is_post || PAGE_CONFIG.is_page) && ((addHighlight()) || tabs.init())
860
- addCopyright()
861
856
  PAGE_CONFIG.is_home && showTodayCard()
862
857
  GLOBAL_CONFIG.covercolor.enable && coverColor()
863
- sco.initConsoleState()
864
858
  GLOBAL_CONFIG.comment.commentBarrage && PAGE_CONFIG.comment && initializeCommentBarrage()
865
- document.body.setAttribute('data-type', PAGE_CONFIG.page)
866
859
  PAGE_CONFIG.page === "music" && scoMusic.init()
867
860
  GLOBAL_CONFIG.post_ai && PAGE_CONFIG.page === "post" && efu_ai.init()
868
861
  }