hexo-theme-solitude 1.7.10 → 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.
@@ -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.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
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.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
  }