hexo-theme-solitude 1.1.3 → 1.2.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.
Files changed (254) hide show
  1. package/LICENSE +674 -19
  2. package/_config.yml +243 -193
  3. package/languages/en-US.yml +1 -0
  4. package/languages/zh-CN.yml +8 -8
  5. package/layout/404.pug +24 -0
  6. package/layout/archive.pug +11 -0
  7. package/layout/category.pug +16 -0
  8. package/layout/includes/console.pug +42 -0
  9. package/layout/includes/footer.pug +71 -0
  10. package/layout/includes/head/config.pug +79 -0
  11. package/layout/includes/head/pwa.pug +59 -0
  12. package/layout/includes/head.pug +29 -0
  13. package/layout/includes/header.pug +4 -0
  14. package/layout/includes/inject/body.pug +68 -0
  15. package/layout/{partial/compoment/inject/head.ejs → includes/inject/head.pug} +59 -35
  16. package/layout/includes/layout.pug +35 -0
  17. package/layout/{partial/loading.ejs → includes/loading.pug} +19 -17
  18. package/layout/includes/mixins/articleSort.pug +14 -0
  19. package/layout/includes/mixins/pagination.pug +8 -0
  20. package/layout/includes/nav.pug +22 -0
  21. package/layout/includes/page/about.pug +10 -0
  22. package/layout/includes/page/categories.pug +8 -0
  23. package/layout/includes/page/default.pug +2 -0
  24. package/layout/includes/page/echarts.pug +7 -0
  25. package/layout/includes/page/equipment.pug +3 -0
  26. package/layout/includes/page/links.pug +35 -0
  27. package/layout/includes/page/moments.pug +5 -0
  28. package/layout/includes/page/rss.pug +22 -0
  29. package/layout/includes/page/says.pug +20 -0
  30. package/layout/includes/page/tags.pug +8 -0
  31. package/layout/includes/page/tlink.pug +9 -0
  32. package/layout/includes/recent-posts.pug +9 -0
  33. package/layout/includes/sidebar.pug +17 -0
  34. package/layout/includes/widgets/aside/aside.pug +18 -0
  35. package/layout/includes/widgets/aside/asideAllInfo.pug +8 -0
  36. package/layout/includes/widgets/aside/asideArchive.pug +9 -0
  37. package/layout/includes/widgets/aside/asideFlipCard.pug +5 -0
  38. package/layout/includes/widgets/aside/asideHistory.pug +8 -0
  39. package/layout/includes/widgets/aside/asideInfoCard.pug +22 -0
  40. package/layout/includes/widgets/aside/asideNewestPost.pug +16 -0
  41. package/layout/includes/widgets/aside/asidePower.pug +19 -0
  42. package/layout/includes/widgets/aside/asideSwitch.pug +26 -0
  43. package/layout/includes/widgets/aside/asideTag.pug +11 -0
  44. package/layout/includes/widgets/aside/asideToc.pug +5 -0
  45. package/layout/includes/widgets/aside/asideWebInfo.pug +40 -0
  46. package/layout/includes/widgets/aside/asideWelcome.pug +12 -0
  47. package/layout/includes/widgets/home/banner.pug +16 -0
  48. package/layout/includes/widgets/home/bbTimeList.pug +8 -0
  49. package/layout/includes/widgets/home/categoryBar.pug +10 -0
  50. package/layout/includes/widgets/home/categoryGroup.pug +9 -0
  51. package/layout/includes/widgets/home/hometop.pug +9 -0
  52. package/layout/includes/widgets/home/postList.pug +26 -0
  53. package/layout/includes/widgets/home/rencentPost.pug +26 -0
  54. package/layout/includes/widgets/home/topGroup.pug +27 -0
  55. package/layout/includes/widgets/nav/left.pug +10 -0
  56. package/layout/includes/widgets/nav/menu.pug +16 -0
  57. package/layout/includes/widgets/nav/right.pug +23 -0
  58. package/layout/includes/widgets/page/about/authorinfo.pug +12 -0
  59. package/layout/includes/widgets/page/about/award.pug +34 -0
  60. package/layout/includes/widgets/page/about/contentinfo.pug +38 -0
  61. package/layout/includes/widgets/page/about/hobbies.pug +33 -0
  62. package/layout/includes/widgets/page/about/motto.pug +19 -0
  63. package/layout/includes/widgets/page/about/other.pug +61 -0
  64. package/layout/includes/widgets/page/about/personalities.pug +16 -0
  65. package/layout/includes/widgets/page/about/skillsinfo.pug +41 -0
  66. package/layout/includes/widgets/page/banner.pug +14 -0
  67. package/layout/includes/widgets/page/equipment/content.pug +23 -0
  68. package/layout/includes/widgets/page/links/banner.pug +30 -0
  69. package/layout/includes/widgets/page/links/linksCard.pug +18 -0
  70. package/layout/includes/widgets/page/links/linksItem.pug +14 -0
  71. package/layout/includes/widgets/page/moments/angle.pug +24 -0
  72. package/layout/includes/widgets/page/moments/index.pug +18 -0
  73. package/layout/includes/widgets/page/says/saysBottom.pug +11 -0
  74. package/layout/includes/widgets/page/says/saysContent.pug +6 -0
  75. package/layout/includes/widgets/page/says/saysFunction.pug +10 -0
  76. package/layout/includes/widgets/page/says/saysMeta.pug +7 -0
  77. package/layout/includes/widgets/post/award.pug +48 -0
  78. package/layout/includes/widgets/post/copyright.pug +27 -0
  79. package/layout/includes/widgets/post/postMeta.pug +55 -0
  80. package/layout/includes/widgets/post/postNav.pug +25 -0
  81. package/layout/includes/widgets/post/wave.pug +9 -0
  82. package/layout/includes/widgets/randomlink.pug +32 -0
  83. package/layout/includes/widgets/rightside/index.pug +74 -0
  84. package/layout/includes/widgets/third-party/comments/comment.pug +14 -0
  85. package/layout/includes/widgets/third-party/comments/gitalk.pug +0 -0
  86. package/layout/{partial/compoment/third-party/comments/twikoo.ejs → includes/widgets/third-party/comments/twikoo.pug} +8 -9
  87. package/layout/includes/widgets/third-party/comments/valine.pug +0 -0
  88. package/layout/includes/widgets/third-party/music.pug +3 -0
  89. package/layout/includes/widgets/third-party/pjax.pug +30 -0
  90. package/layout/includes/widgets/third-party/search/algolia-search.pug +16 -0
  91. package/layout/includes/widgets/third-party/search/index.pug +7 -0
  92. package/layout/includes/widgets/third-party/search/local-search.pug +15 -0
  93. package/layout/index.pug +20 -0
  94. package/layout/page.pug +32 -0
  95. package/layout/post.pug +43 -0
  96. package/layout/tag.pug +19 -0
  97. package/package.json +4 -4
  98. package/scripts/event/page.js +20 -2
  99. package/scripts/filter/checkThemeConfig.js +0 -1
  100. package/scripts/filter/randomPosts.js +0 -1
  101. package/scripts/helper/{charts.js → echarts.js} +27 -28
  102. package/scripts/helper/stylus.js +23 -0
  103. package/scripts/tags/bvideo.js +1 -36
  104. package/source/css/_comment/index.styl +121 -0
  105. package/source/css/_comment/twikoo.styl +515 -0
  106. package/source/css/_extra/console.styl +354 -0
  107. package/source/css/_extra/rightmenu.styl +83 -0
  108. package/source/css/_global/animation.css +756 -0
  109. package/source/css/_global/function.styl +83 -0
  110. package/source/css/_global/index.styl +120 -0
  111. package/source/css/_global/var.styl +1 -0
  112. package/source/css/_layout/articleSort.styl +199 -0
  113. package/source/css/_layout/base.styl +392 -0
  114. package/source/css/_layout/footer.styl +359 -0
  115. package/source/css/_layout/header.styl +1331 -0
  116. package/source/css/_layout/index.styl +293 -0
  117. package/source/css/_layout/sidebar.styl +226 -0
  118. package/source/css/_mode/index.styl +52 -0
  119. package/source/css/_page/about.styl +944 -0
  120. package/source/css/_page/category.styl +141 -0
  121. package/source/css/_page/equipment.styl +108 -0
  122. package/source/css/_page/error.styl +161 -0
  123. package/source/css/_page/home.styl +58 -0
  124. package/source/css/_page/homeTop.styl +1035 -0
  125. package/source/css/_page/index.styl +22 -0
  126. package/source/css/_page/link.styl +433 -0
  127. package/source/css/_page/moment.styl +186 -0
  128. package/source/css/_page/rss.styl +87 -0
  129. package/source/css/_page/says.styl +353 -0
  130. package/source/css/_page/tag.styl +56 -0
  131. package/source/css/_post/commentBarrage.styl +149 -0
  132. package/source/css/_post/externalTags.styl +694 -0
  133. package/source/css/_post/highlight.styl +96 -0
  134. package/source/css/_post/index.styl +935 -0
  135. package/source/css/_post/pagination.styl +467 -0
  136. package/source/css/_post/postContent.styl +957 -0
  137. package/source/css/_post/relatedPost.styl +160 -0
  138. package/source/css/_post/reward.styl +217 -0
  139. package/source/css/_search/algolia-search.styl +206 -0
  140. package/source/css/_search/local-search.styl +112 -0
  141. package/source/css/_widgets/aside/allinfo.styl +134 -0
  142. package/source/css/_widgets/aside/flip.styl +68 -0
  143. package/source/css/_widgets/aside/history.styl +35 -0
  144. package/source/css/_widgets/aside/index.styl +156 -0
  145. package/source/css/_widgets/aside/info.styl +263 -0
  146. package/source/css/_widgets/aside/newPost.styl +55 -0
  147. package/source/css/_widgets/aside/power.styl +90 -0
  148. package/source/css/_widgets/aside/toc.styl +85 -0
  149. package/source/css/_widgets/aside/welcome.styl +14 -0
  150. package/source/css/_widgets/index.styl +3 -0
  151. package/source/css/index.styl +40 -0
  152. package/source/js/commentBarrage.js +8 -5
  153. package/source/js/extend/console/comment.js +60 -63
  154. package/source/js/extend/covercolor/local.js +1 -1
  155. package/source/js/extend/search/algolia-search.js +104 -111
  156. package/source/js/extend/search/local-search.js +7 -7
  157. package/source/js/main.js +655 -505
  158. package/source/js/utils.js +131 -137
  159. package/layout/404.ejs +0 -34
  160. package/layout/archive.ejs +0 -10
  161. package/layout/category.ejs +0 -18
  162. package/layout/index.ejs +0 -20
  163. package/layout/layout.ejs +0 -30
  164. package/layout/page/about.ejs +0 -15
  165. package/layout/page/categories.ejs +0 -12
  166. package/layout/page/circle.ejs +0 -5
  167. package/layout/page/echarts.ejs +0 -1
  168. package/layout/page/equipment.ejs +0 -2
  169. package/layout/page/links.ejs +0 -46
  170. package/layout/page/page.ejs +0 -3
  171. package/layout/page/rss.ejs +0 -39
  172. package/layout/page/says.ejs +0 -17
  173. package/layout/page/tags.ejs +0 -12
  174. package/layout/page/tlink.ejs +0 -11
  175. package/layout/page.ejs +0 -45
  176. package/layout/partial/body.ejs +0 -7
  177. package/layout/partial/compoment/about/authorinfo.ejs +0 -18
  178. package/layout/partial/compoment/about/award.ejs +0 -59
  179. package/layout/partial/compoment/about/contentinfo.ejs +0 -33
  180. package/layout/partial/compoment/about/hobbies.ejs +0 -53
  181. package/layout/partial/compoment/about/motto.ejs +0 -17
  182. package/layout/partial/compoment/about/other.ejs +0 -76
  183. package/layout/partial/compoment/about/personalities.ejs +0 -11
  184. package/layout/partial/compoment/about/skillsinfo.ejs +0 -62
  185. package/layout/partial/compoment/aside/aside.ejs +0 -28
  186. package/layout/partial/compoment/aside/asideAllInfo.ejs +0 -6
  187. package/layout/partial/compoment/aside/asideArchive.ejs +0 -11
  188. package/layout/partial/compoment/aside/asideFlipCard.ejs +0 -72
  189. package/layout/partial/compoment/aside/asideHistory.ejs +0 -49
  190. package/layout/partial/compoment/aside/asideInfoCard.ejs +0 -39
  191. package/layout/partial/compoment/aside/asideNewestPost.ejs +0 -31
  192. package/layout/partial/compoment/aside/asidePower.ejs +0 -31
  193. package/layout/partial/compoment/aside/asideSwitch.ejs +0 -41
  194. package/layout/partial/compoment/aside/asideTag.ejs +0 -5
  195. package/layout/partial/compoment/aside/asideToc.ejs +0 -11
  196. package/layout/partial/compoment/aside/asideWebInfo.ejs +0 -60
  197. package/layout/partial/compoment/aside/asideWelcome.ejs +0 -33
  198. package/layout/partial/compoment/circle/angle.ejs +0 -26
  199. package/layout/partial/compoment/circle/banner.ejs +0 -11
  200. package/layout/partial/compoment/circle/content.ejs +0 -19
  201. package/layout/partial/compoment/dorakika/rightmenu.ejs +0 -100
  202. package/layout/partial/compoment/equipment/list.ejs +0 -37
  203. package/layout/partial/compoment/home/homeCategoryBar.ejs +0 -11
  204. package/layout/partial/compoment/home/postList.ejs +0 -37
  205. package/layout/partial/compoment/hometop/bbTimeList.ejs +0 -15
  206. package/layout/partial/compoment/hometop/categoryGroup.ejs +0 -19
  207. package/layout/partial/compoment/hometop/groupTag.ejs +0 -30
  208. package/layout/partial/compoment/hometop/topGroup.ejs +0 -41
  209. package/layout/partial/compoment/inject/body.ejs +0 -70
  210. package/layout/partial/compoment/links/angle.ejs +0 -26
  211. package/layout/partial/compoment/links/banner.ejs +0 -42
  212. package/layout/partial/compoment/links/linksCard.ejs +0 -27
  213. package/layout/partial/compoment/links/linksItem.ejs +0 -21
  214. package/layout/partial/compoment/mixins/articleSort.ejs +0 -26
  215. package/layout/partial/compoment/mixins/pagination.ejs +0 -11
  216. package/layout/partial/compoment/nav/left.ejs +0 -22
  217. package/layout/partial/compoment/nav/menu.ejs +0 -25
  218. package/layout/partial/compoment/nav/right.ejs +0 -42
  219. package/layout/partial/compoment/post/award.ejs +0 -60
  220. package/layout/partial/compoment/post/copyright.ejs +0 -39
  221. package/layout/partial/compoment/post/postMeta.ejs +0 -85
  222. package/layout/partial/compoment/post/postNav.ejs +0 -41
  223. package/layout/partial/compoment/post/wave.ejs +0 -14
  224. package/layout/partial/compoment/says/banner.ejs +0 -10
  225. package/layout/partial/compoment/says/saysBottom.ejs +0 -18
  226. package/layout/partial/compoment/says/saysContent.ejs +0 -10
  227. package/layout/partial/compoment/says/saysFunction.ejs +0 -15
  228. package/layout/partial/compoment/third-party/comments/comment.ejs +0 -12
  229. package/layout/partial/compoment/third-party/comments/twikoo_k.ejs +0 -29
  230. package/layout/partial/compoment/third-party/music.ejs +0 -5
  231. package/layout/partial/compoment/third-party/pjax.ejs +0 -31
  232. package/layout/partial/compoment/third-party/search/algolia-search.ejs +0 -20
  233. package/layout/partial/compoment/third-party/search/index.ejs +0 -10
  234. package/layout/partial/compoment/third-party/search/local-search.ejs +0 -22
  235. package/layout/partial/compoment/tlink/banner.ejs +0 -10
  236. package/layout/partial/console.ejs +0 -68
  237. package/layout/partial/footer.ejs +0 -109
  238. package/layout/partial/head.ejs +0 -37
  239. package/layout/partial/header.ejs +0 -6
  240. package/layout/partial/hometop.ejs +0 -15
  241. package/layout/partial/nav.ejs +0 -34
  242. package/layout/partial/pwa.ejs +0 -40
  243. package/layout/partial/sidebar.ejs +0 -31
  244. package/layout/post.ejs +0 -52
  245. package/layout/tag.ejs +0 -19
  246. package/scripts/helper/randomLinks.js +0 -16
  247. package/scripts/helper/themeJsExport.js +0 -79
  248. package/source/css/commentBarrage.css +0 -174
  249. package/source/css/custom.css +0 -901
  250. package/source/css/main.css +0 -16285
  251. package/source/css/search/algolia-search.css +0 -141
  252. package/source/css/search/local-search.css +0 -138
  253. package/source/css/var.css +0 -189
  254. /package/source/js/{rightmenu.js → rightside.js} +0 -0
@@ -1,153 +1,147 @@
1
1
  const utils = {
2
- debounce: function (func, wait, immediate) {
3
- let timeout
4
- return function () {
5
- const context = this
6
- const args = arguments
7
- const later = function () {
8
- timeout = null
9
- if (!immediate) func.apply(context, args)
10
- }
11
- const callNow = immediate && !timeout
12
- clearTimeout(timeout)
13
- timeout = setTimeout(later, wait)
14
- if (callNow) func.apply(context, args)
15
- }
16
- },
17
-
18
- throttle: function (func, wait, options) {
19
- let timeout, context, args
20
- let previous = 0
21
- if (!options) options = {}
2
+ debounce: function (func, wait, immediate) {
3
+ let timeout
4
+ return function () {
5
+ const context = this
6
+ const args = arguments
7
+ const later = function () {
8
+ timeout = null
9
+ if (!immediate) func.apply(context, args)
10
+ }
11
+ const callNow = immediate && !timeout
12
+ clearTimeout(timeout)
13
+ timeout = setTimeout(later, wait)
14
+ if (callNow) func.apply(context, args)
15
+ }
16
+ },
22
17
 
23
- const later = function () {
24
- previous = options.leading === false ? 0 : new Date().getTime()
25
- timeout = null
26
- func.apply(context, args)
27
- if (!timeout) context = args = null
28
- }
18
+ throttle: function (func, wait, options) {
19
+ let timeout, context, args
20
+ let previous = 0
21
+ if (!options) options = {}
29
22
 
30
- const throttled = function () {
31
- const now = new Date().getTime()
32
- if (!previous && options.leading === false) previous = now
33
- const remaining = wait - (now - previous)
34
- context = this
35
- args = arguments
36
- if (remaining <= 0 || remaining > wait) {
37
- if (timeout) {
38
- clearTimeout(timeout)
39
- timeout = null
23
+ const later = function () {
24
+ previous = options.leading === false ? 0 : new Date().getTime()
25
+ timeout = null
26
+ func.apply(context, args)
27
+ if (!timeout) context = args = null
40
28
  }
41
- previous = now
42
- func.apply(context, args)
43
- if (!timeout) context = args = null
44
- } else if (!timeout && options.trailing !== false) {
45
- timeout = setTimeout(later, remaining)
46
- }
47
- }
48
29
 
49
- return throttled
50
- },
30
+ const throttled = function () {
31
+ const now = new Date().getTime()
32
+ if (!previous && options.leading === false) previous = now
33
+ const remaining = wait - (now - previous)
34
+ context = this
35
+ args = arguments
36
+ if (remaining <= 0 || remaining > wait) {
37
+ if (timeout) {
38
+ clearTimeout(timeout)
39
+ timeout = null
40
+ }
41
+ previous = now
42
+ func.apply(context, args)
43
+ if (!timeout) context = args = null
44
+ } else if (!timeout && options.trailing !== false) {
45
+ timeout = setTimeout(later, remaining)
46
+ }
47
+ }
51
48
 
52
- fadeIn: (ele, time) => {
53
- ele.style.cssText = `display:block;animation: to_show ${time}s`
54
- },
49
+ return throttled
50
+ },
55
51
 
56
- fadeOut: (ele, time) => {
57
- ele.addEventListener('animationend', function f() {
58
- ele.style.cssText = "display: none; animation: '' "
59
- ele.removeEventListener('animationend', f)
60
- })
61
- ele.style.animation = `to_hide ${time}s`
62
- },
52
+ fadeIn: (ele, time) => {
53
+ ele.style.cssText = `display:block;animation: to_show ${time}s`
54
+ },
63
55
 
64
- sidebarPaddingR: () => {
65
- const innerWidth = window.innerWidth
66
- const clientWidth = document.body.clientWidth
67
- const paddingRight = innerWidth - clientWidth
68
- if (innerWidth !== clientWidth) {
69
- document.body.style.paddingRight = paddingRight + 'px'
70
- }
71
- },
56
+ fadeOut: (ele, time) => {
57
+ ele.addEventListener('animationend', function f() {
58
+ ele.style.cssText = "display: none; animation: '' "
59
+ ele.removeEventListener('animationend', f)
60
+ })
61
+ ele.style.animation = `to_hide ${time}s`
62
+ },
72
63
 
73
- snackbarShow: (text, showAction, duration) => {
74
- const sa = (typeof showAction !== 'undefined') ? showAction : false
75
- const dur = (typeof duration !== 'undefined') ? duration : 5000
76
- document.styleSheets[0].addRule(':root', '--sco-snackbar-time:' + dur + 'ms!important')
77
- Snackbar.show({
78
- text: text,
79
- showAction: sa,
80
- duration: dur,
81
- pos: 'top-center'
82
- })
83
- },
64
+ sidebarPaddingR: () => {
65
+ const innerWidth = window.innerWidth
66
+ const clientWidth = document.body.clientWidth
67
+ const paddingRight = innerWidth - clientWidth
68
+ if (innerWidth !== clientWidth) {
69
+ document.body.style.paddingRight = paddingRight + 'px'
70
+ }
71
+ },
84
72
 
85
- copy: async (text) => {
86
- try {
87
- await navigator.clipboard.writeText(text)
88
- utils.snackbarShow(GLOBALCONFIG.lang.copy.success, false, 2000)
89
- } catch (err) {
90
- utils.snackbarShow(GLOBALCONFIG.lang.copy.error, false, 2000)
91
- }
92
- },
73
+ snackbarShow: (text, showAction, duration) => {
74
+ const sa = (typeof showAction !== 'undefined') ? showAction : false
75
+ const dur = (typeof duration !== 'undefined') ? duration : 5000
76
+ document.styleSheets[0].addRule(':root', '--sco-snackbar-time:' + dur + 'ms!important')
77
+ Snackbar.show({
78
+ text: text,
79
+ showAction: sa,
80
+ duration: dur,
81
+ pos: 'top-center'
82
+ })
83
+ },
93
84
 
94
- getEleTop: ele => {
95
- let actualTop = ele.offsetTop
96
- let current = ele.offsetParent
85
+ copy: async (text) => {
86
+ try {
87
+ await navigator.clipboard.writeText(text)
88
+ utils.snackbarShow(GLOBAL_CONFIG.lang.copy.success, false, 2000)
89
+ } catch (err) {
90
+ utils.snackbarShow(GLOBAL_CONFIG.lang.copy.error, false, 2000)
91
+ }
92
+ },
97
93
 
98
- while (current !== null) {
99
- actualTop += current.offsetTop
100
- current = current.offsetParent
101
- }
94
+ getEleTop: ele => {
95
+ let actualTop = 0
96
+ while (ele) {
97
+ actualTop += ele.offsetTop
98
+ ele = ele.offsetParent
99
+ }
100
+ return actualTop
101
+ },
102
102
 
103
- return actualTop
104
- },
103
+ randomNum: (length) => {
104
+ return Math.floor(Math.random() * length)
105
+ },
105
106
 
106
- randomNum: (length) => {
107
- return Math.floor(Math.random() * length)
108
- },
107
+ timeDiff: (timeObj, today) => {
108
+ var timeDiff = today.getTime() - timeObj.getTime();
109
+ return Math.floor(timeDiff / (1000 * 3600 * 24));
110
+ },
109
111
 
110
- timeDiff: (timeObj, today) => {
111
- var timeDiff = today.getTime() - timeObj.getTime();
112
- return Math.floor(timeDiff / (1000 * 3600 * 24));
113
- },
112
+ scrollToDest: (pos, time = 500) => {
113
+ const currentPos = window.pageYOffset
114
+ const isNavFixed = document.getElementById('page-header').classList.contains('nav-fixed')
115
+ if (currentPos > pos || isNavFixed) pos = pos - 70
116
+ if ('scrollBehavior' in document.documentElement.style) {
117
+ window.scrollTo({
118
+ top: pos,
119
+ behavior: 'smooth'
120
+ })
121
+ return
122
+ }
123
+ let start = null
124
+ const distance = pos - currentPos
125
+ window.requestAnimationFrame(function step(currentTime) {
126
+ start = !start ? currentTime : start
127
+ const progress = currentTime - start
128
+ if (progress < time) {
129
+ window.scrollTo(0, currentPos + distance * progress / time)
130
+ window.requestAnimationFrame(step)
131
+ } else {
132
+ window.scrollTo(0, pos)
133
+ }
134
+ })
135
+ },
114
136
 
115
- scrollToDest: (pos, time = 500) => {
116
- const currentPos = window.pageYOffset
117
- const isNavFixed = document.getElementById('page-header').classList.contains('nav-fixed')
118
- if (currentPos > pos || isNavFixed) pos = pos - 70
119
- if ('scrollBehavior' in document.documentElement.style) {
120
- window.scrollTo({
121
- top: pos,
122
- behavior: 'smooth'
123
- })
124
- return
125
- }
126
- let start = null
127
- pos = + pos
128
- window.requestAnimationFrame(function step(currentTime) {
129
- start = !start ? currentTime : start
130
- const progress = currentTime - start
131
- if (currentPos < pos) {
132
- window.scrollTo(0, ((pos - currentPos) * progress / time) + currentPos)
133
- } else {
134
- window.scrollTo(0, currentPos - ((currentPos - pos) * progress / time))
135
- }
136
- if (progress < time) {
137
- window.requestAnimationFrame(step)
138
- } else {
139
- window.scrollTo(0, pos)
140
- }
141
- })
142
- },
143
-
144
- siblings: (ele, selector) => {
145
- return [...ele.parentNode.children].filter((child) => {
146
- if (selector) {
147
- return child !== ele && child.matches(selector)
148
- }
149
- return child !== ele
150
- })
151
- },
152
- isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
153
- }
137
+ siblings: (ele, selector) => {
138
+ return [...ele.parentNode.children].filter((child) => {
139
+ if (selector) {
140
+ return child !== ele && child.matches(selector)
141
+ }
142
+ return child !== ele
143
+ })
144
+ },
145
+ isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
146
+ isHidden: e => 0 === e.offsetHeight && 0 === e.offsetWidth
147
+ }
package/layout/404.ejs DELETED
@@ -1,34 +0,0 @@
1
- <div id="error-wrap">
2
- <div class="error-content">
3
- <div class="error-img" style="background-image: url('<%= theme.errorpage.img %>')"></div>
4
- <div class="error-info">
5
- <h1 class="error_title">404</h1>
6
- <div class="error_subtitle">
7
- <%= theme.errorpage.text %>
8
- </div>
9
- <a class="button--animated" href="/">
10
- <i class="scoicon sco-external-link"></i>
11
- 回到主页
12
- </a>
13
- </div>
14
- </div>
15
- </div>
16
- <% if(theme.errorpage.recommendList){ %>
17
- <div class="aside-list">
18
- <div class="aside-list-group">
19
- <% for (const [index, post] of site.posts.sort('-date').data.entries()){ %>
20
- <% if(index >= 5)break; %>
21
- <div class="aside-list-item">
22
- <a class="thumbnail" href="<%= url_for(post.path) %>" title="<%= post.title %>">
23
- <img src="<%= post.cover %>" alt="<%= post.title %>">
24
- </a>
25
- <div class="content">
26
- <a class="title" href="<%= url_for(post.path) %>" title="<%= post.title %>">
27
- <%= post.title %>
28
- </a>
29
- </div>
30
- </div>
31
- <% } %>
32
- </div>
33
- </div>
34
- <% } %>
@@ -1,10 +0,0 @@
1
- <main class="layout" id="content-inner">
2
- <div id="archive">
3
- <div class="article-sort-title"><%= __('page.archives') %><sup><%= page.posts.length %></sup></div>
4
- <div class="article-sort">
5
- <%- partial('partial/compoment/mixins/articleSort') %>
6
- </div>
7
- <%- partial('partial/compoment/mixins/pagination') %>
8
- </div>
9
- <%- partial('partial/compoment/aside/aside') %>
10
- </main>
@@ -1,18 +0,0 @@
1
- <main class="layout" id="content-inner">
2
- <div id="category">
3
- <div class="category-in-bar">
4
- <div class="category-in-bar-tips">分类</div>
5
- <div id="category-bar">
6
- <div class="category-bar-items" id="category-bar-items">
7
- <%- partial('partial/compoment/home/homeCategoryBar', {select:page.category}) %>
8
- </div>
9
- </div>
10
- </div>
11
- <div class="article-sort-title"><%= page.category %></div>
12
- <div class="article-sort">
13
- <%- partial('partial/compoment/mixins/articleSort') %>
14
- </div>
15
- <%- partial('partial/compoment/mixins/pagination') %>
16
- </div>
17
- <%- partial('partial/compoment/aside/aside') %>
18
- </main>
package/layout/index.ejs DELETED
@@ -1,20 +0,0 @@
1
- <div id="home_top">
2
- <% if(theme.hometop.bbtime){ %>
3
- <%- partial('partial/compoment/hometop/bbTimeList') %>
4
- <% } %>
5
- <% if(theme.hometop.banner.enable){ %>
6
- <%- partial('partial/hometop') %>
7
- <% } %>
8
- </div>
9
- <main class="layout" id="content-inner">
10
- <div class="recent-posts" id="recent-posts">
11
- <div id="category-bar">
12
- <%- partial('partial/compoment/home/homeCategoryBar', {select:false}) %>
13
- </div>
14
- <% for (const item of page.posts.sort('-date').data){ %>
15
- <%- partial('partial/compoment/home/postList', {post: item}) %>
16
- <% } %>
17
- <%- partial('partial/compoment/mixins/pagination') %>
18
- </div>
19
- <%- partial('partial/compoment/aside/aside') %>
20
- </main>
package/layout/layout.ejs DELETED
@@ -1,30 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="<%= config.language %>" data-theme="light">
3
- <head>
4
- <%- partial('partial/head', {cache: true}) %>
5
- </head>
6
- <body id="body">
7
- <% if(theme.loading.fullpage){ %>
8
- <%- partial('partial/loading', {cache: true}) %>
9
- <% } %>
10
- <%- partial('partial/console', {cache: true}) %>
11
- <%- partial('partial/sidebar', {cache: true}) %>
12
-
13
- <% if(page.type !== '404'){ %>
14
- <div class="<%= is_post() ? 'post' : 'page' %>" id="body-wrap">
15
- <%- partial('partial/header') %>
16
- <%- body %>
17
- <footer id="footer">
18
- <%- partial('partial/footer', {cache: true}) %>
19
- </footer>
20
- </div>
21
- <% }else{ %>
22
- <div class="error" id="body-wrap">
23
- <%- body %>
24
- </div>
25
- <% } %>
26
- <%- partial('partial/body', {cache: true}) %>
27
- <%- partial('partial/compoment/third-party/search/index', {cache: true}) %>
28
- <%- partial('partial/compoment/third-party/music', {cache: true}) %>
29
- </body>
30
- </html>
@@ -1,15 +0,0 @@
1
- <% if (theme.about) { %>
2
- <div id="about-page">
3
- <%- partial('partial/compoment/about/authorinfo' ) %>
4
- <%- partial('partial/compoment/about/contentinfo' ) %>
5
- <%- partial('partial/compoment/about/skillsinfo' ) %>
6
- <%- partial('partial/compoment/about/personalities' ) %>
7
- <%- partial('partial/compoment/about/motto' ) %>
8
- <%- partial('partial/compoment/about/hobbies' ) %>
9
- <%- partial('partial/compoment/about/other' ) %>
10
- <%- partial('partial/compoment/about/award' ) %>
11
- </div>
12
- <% if(theme.thirdparty.echarts.enable){%>
13
- <%- js(theme.thirdparty.echarts.js) %>
14
- <%} %>
15
- <% } %>
@@ -1,12 +0,0 @@
1
- <h1 class="page-title"><%= __('page.category') %></h1>
2
- <div class="category-lists">
3
- <div class="tag-cloud-list is-center">
4
- <% site.categories.data.forEach(data => { %>
5
- <a href="<%= url_for(data.path.toLowerCase()) %>">
6
- <span class="tags-punctuation"></span>
7
- <%= data.name %>
8
- <span class="tagsPageCount"><%= data.length %></span>
9
- </a>
10
- <% }) %>
11
- </div>
12
- </div>
@@ -1,5 +0,0 @@
1
- <%- partial('partial/compoment/circle/banner') %>
2
- <% if(theme.thirdparty.circle.angle.enable){ %>
3
- <%- partial('partial/compoment/circle/angle') %>
4
- <% } %>
5
- <%- partial('partial/compoment/circle/content') %>
@@ -1 +0,0 @@
1
- <%- page.content %>
@@ -1,2 +0,0 @@
1
- <%- partial('partial/compoment/says/banner') %>
2
- <%- partial('partial/compoment/equipment/list') %>
@@ -1,46 +0,0 @@
1
- <div class="flink" id="banners">
2
- <%- partial('partial/compoment/links/banner') %>
3
- </div>
4
- <% if(theme.thirdparty.circle.angle.enable){ %>
5
- <%- partial('partial/compoment/links/angle') %>
6
- <% } %>
7
- <div class="flink" id="article-container">
8
- <% site.data.links.links.forEach(data => { %>
9
- <h2><%= data.class_name %></h2>
10
- <div class="flink-desc"><%= data.descr %></div>
11
- <% switch (data.type) {
12
- case 'card': %>
13
- <%- partial('partial/compoment/links/linksCard', {data: data.link_list}) %>
14
- <% break;
15
- case 'item': %>
16
- <%- partial('partial/compoment/links/linksItem', {data: data.link_list}) %>
17
- <% break;
18
- default: %>
19
- <% break; } %>
20
- <% }); %>
21
- </div>
22
- <h3 align="end">——本站友链排序不分先后,所有站点都值得一看。</h3>
23
- <% if(theme.comment.enable){ %>
24
- <h2 id="友情链接申请">友情链接申请</h2>
25
- <div id="article-container">
26
- <%- page.content %>
27
- </div>
28
- <p>请<b>勾选</b>你符合的条件:</p>
29
- <div id="friendlink_checkboxs">
30
- <p>
31
- <label><input type="checkbox" id="checkbox1" onclick="checkForm()"> 我已添加 <b><%= config.title %></b>
32
- 博客的友情链接</label>
33
- </p>
34
- <p>
35
- <label><input type="checkbox" id="checkbox2" onclick="checkForm()"> 我的链接主体为
36
- <b>个人</b>,网站类型为<b>博客</b></label>
37
- </p>
38
- <p>
39
- <label><input type="checkbox" id="checkbox3" onclick="checkForm()">
40
- 我的网站现在可以在中国大陆区域正常访问</label>
41
- </p>
42
- <p>
43
- <label><input type="checkbox" id="checkbox4" onclick="checkForm()"> 网站内容符合中国大陆法律法规</label>
44
- </p>
45
- </div>
46
- <% } %>
@@ -1,3 +0,0 @@
1
- <div id="article-container">
2
- <%- page.content %>
3
- </div>
@@ -1,39 +0,0 @@
1
- <main class="layout hide-aside" id="content-inner">
2
- <div id="page">
3
- <div class="rss-plan-list">
4
- <a class="rss-plan-item rss-plan-wechat" href="<%- theme.footer.rss.wechatOA %>" title="公众号"
5
- target="_blank">
6
- <div class="rss-plan-description">推送精选文章<br>推送全文</div>
7
- <div class="rss-plan-info-group">
8
- <div class="rss-plan-title">公众号订阅</div>
9
- <div class="rss-plan-info">推荐的订阅方式</div>
10
- <img class="rss-plan-icon" src="https://bu.dusays.com/2023/11/01/6541d14a4de78.png" alt="wechat">
11
- </div>
12
- </a>
13
- <a class="rss-plan-item rss-plan-mail" href="<%- theme.footer.rss.emailOA %>" rel="external nofollow"
14
- title="email" target="_blank">
15
- <div class="rss-plan-description">推送全部文章<br>推送封面与简介</div>
16
- <div class="rss-plan-info-group">
17
- <div class="rss-plan-title">邮件订阅</div>
18
- <div class="rss-plan-info">推荐的订阅方式</div>
19
- <img class="rss-plan-icon" src="https://bu.dusays.com/2023/11/01/6541d16c3ea22.png" alt="email">
20
- </div>
21
- </a><a class="rss-plan-item rss-plan-rss" href="<%- theme.footer.rss.rssOA %>" title="rss" target="_blank">
22
- <div class="rss-plan-description">推送全部文章<br>推送简介</div>
23
- <div class="rss-plan-info-group">
24
- <div class="rss-plan-title">RSS</div>
25
- <div class="rss-plan-info">备用订阅方式</div>
26
- <img class="rss-plan-icon" src="https://bu.dusays.com/2023/11/01/6541d184e2a09.png" alt="rss">
27
- </div>
28
- </a></div>
29
- <%- page.content %>
30
-
31
- <% if(page.comment){ %>
32
- <%- partial('partial/compoment/third-party/comments/comment') %>
33
- <% } %>
34
- </div>
35
-
36
- <% if(page.aside){ %>
37
- <%- partial('partial/compoment/aside/aside') %>
38
- <% } %>
39
- </main>
@@ -1,17 +0,0 @@
1
- <%- partial('partial/compoment/says/banner') %>
2
- <div id="bber">
3
- <section class="timeline page-1">
4
- <ul class="list" id="waterfall">
5
- <% for(let i in site.data.essay.essay_list){ %>
6
- <% const item = site.data.essay.essay_list[i];if(i >= 30)break; %>
7
- <li class="item">
8
- <%- partial('partial/compoment/says/saysContent', {item:item}) %>
9
- <%- partial('partial/compoment/says/saysFunction', {item:item}) %>
10
- <hr>
11
- <%- partial('partial/compoment/says/saysBottom', {item:item}) %>
12
- </li>
13
- <% }; %>
14
- </ul>
15
- </section>
16
- </div>
17
- <div id="bber-tips" style="color: var(--sco-secondtext);">- 只展示最近30条短文 -</div>
@@ -1,12 +0,0 @@
1
- <h1 class="page-title"><%= __('page.tag') %></h1>
2
- <div class="category-lists">
3
- <div class="tag-cloud-list is-center">
4
- <% site.tags.data.forEach(data => { %>
5
- <a href="<%= url_for(data.path) %>">
6
- <span class="tags-punctuation"></span>
7
- <%= data.name %>
8
- <span class="tagsPageCount"><%= data.length %></span>
9
- </a>
10
- <% }) %>
11
- </div>
12
- </div>
@@ -1,11 +0,0 @@
1
- <%- partial('partial/compoment/tlink/banner') %>
2
- <div class="flink" id="article-container">
3
- <% site.data.tlink.links.forEach(data => { %>
4
- <h2><%= data.class_name %></h2>
5
- <div class="flink-desc"><%= data.descr %></div>
6
- <%- partial('partial/compoment/links/linksItem', {data: data.link_list}) %>
7
- <% }); %>
8
- </div>
9
- <div id="article-container">
10
- <%- page.content %>
11
- </div>
package/layout/page.ejs DELETED
@@ -1,45 +0,0 @@
1
- <main class="layout <%= page.aside ? '' : 'hide-aside' %>" id="content-inner">
2
- <div id="page">
3
- <% switch (page.type) {
4
- case 'categories': %>
5
- <%- partial('page/categories') %>
6
- <% break;
7
- case 'tags': %>
8
- <%- partial('page/tags') %>
9
- <% break;
10
- case 'links': %>
11
- <%- partial('page/links') %>
12
- <% break;
13
- case 'tlink': %>
14
- <%- partial('page/tlink') %>
15
- <% break;
16
- case 'about': %>
17
- <%- partial('page/about') %>
18
- <% break;
19
- case 'says': %>
20
- <%- partial('page/says') %>
21
- <% break;
22
- case 'equipment': %>
23
- <%- partial('page/equipment') %>
24
- <% break;
25
- case 'circle': %>
26
- <%- partial('page/circle') %>
27
- <% break;
28
- case 'echarts': %>
29
- <%- partial('page/echarts') %>
30
- <% break;
31
- case 'rss': %>
32
- <%- partial('page/rss') %>
33
- <% break;
34
- default: %>
35
- <%- partial('page/page') %>
36
- <% break;
37
- } %>
38
- <% if(page.comment){ %>
39
- <%- partial('partial/compoment/third-party/comments/comment') %>
40
- <% } %>
41
- </div>
42
- <% if(page.aside){ %>
43
- <%- partial('partial/compoment/aside/aside') %>
44
- <% } %>
45
- </main>
@@ -1,7 +0,0 @@
1
- <div>
2
- <%- partial('partial/compoment/inject/body', {cache: true}) %>
3
- <%- partial('partial/compoment/third-party/pjax', {cache: true}) %>
4
- <% if (theme.extends.body) for (const i of theme.extends.body){ %>
5
- <%- i %>
6
- <% } %>
7
- </div>