hexo-theme-solitude 1.1.3 → 1.2.2
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/LICENSE +674 -19
- package/_config.yml +244 -193
- package/languages/en-US.yml +1 -0
- package/languages/zh-CN.yml +8 -8
- package/layout/404.pug +24 -0
- package/layout/archive.pug +11 -0
- package/layout/category.pug +16 -0
- package/layout/includes/console.pug +42 -0
- package/layout/includes/footer.pug +71 -0
- package/layout/includes/head/config.pug +79 -0
- package/layout/includes/head/pwa.pug +59 -0
- package/layout/includes/head.pug +29 -0
- package/layout/includes/header.pug +4 -0
- package/layout/includes/inject/body.pug +68 -0
- package/layout/{partial/compoment/inject/head.ejs → includes/inject/head.pug} +61 -35
- package/layout/includes/layout.pug +35 -0
- package/layout/{partial/loading.ejs → includes/loading.pug} +19 -17
- package/layout/includes/mixins/articleSort.pug +14 -0
- package/layout/includes/mixins/pagination.pug +8 -0
- package/layout/includes/nav.pug +22 -0
- package/layout/includes/page/about.pug +10 -0
- package/layout/includes/page/categories.pug +8 -0
- package/layout/includes/page/default.pug +2 -0
- package/layout/includes/page/echarts.pug +7 -0
- package/layout/includes/page/equipment.pug +3 -0
- package/layout/includes/page/links.pug +35 -0
- package/layout/includes/page/moments.pug +5 -0
- package/layout/includes/page/rss.pug +22 -0
- package/layout/includes/page/says.pug +20 -0
- package/layout/includes/page/tags.pug +8 -0
- package/layout/includes/page/tlink.pug +9 -0
- package/layout/includes/recent-posts.pug +9 -0
- package/layout/includes/sidebar.pug +17 -0
- package/layout/includes/widgets/aside/aside.pug +18 -0
- package/layout/includes/widgets/aside/asideAllInfo.pug +8 -0
- package/layout/includes/widgets/aside/asideArchive.pug +9 -0
- package/layout/includes/widgets/aside/asideFlipCard.pug +5 -0
- package/layout/includes/widgets/aside/asideHistory.pug +8 -0
- package/layout/includes/widgets/aside/asideInfoCard.pug +22 -0
- package/layout/includes/widgets/aside/asideNewestPost.pug +16 -0
- package/layout/includes/widgets/aside/asidePower.pug +19 -0
- package/layout/includes/widgets/aside/asideSwitch.pug +26 -0
- package/layout/includes/widgets/aside/asideTag.pug +11 -0
- package/layout/includes/widgets/aside/asideToc.pug +5 -0
- package/layout/includes/widgets/aside/asideWebInfo.pug +40 -0
- package/layout/includes/widgets/aside/asideWelcome.pug +12 -0
- package/layout/includes/widgets/home/banner.pug +16 -0
- package/layout/includes/widgets/home/bbTimeList.pug +8 -0
- package/layout/includes/widgets/home/categoryBar.pug +10 -0
- package/layout/includes/widgets/home/categoryGroup.pug +9 -0
- package/layout/includes/widgets/home/hometop.pug +9 -0
- package/layout/includes/widgets/home/postList.pug +26 -0
- package/layout/includes/widgets/home/rencentPost.pug +26 -0
- package/layout/includes/widgets/home/topGroup.pug +27 -0
- package/layout/includes/widgets/nav/left.pug +10 -0
- package/layout/includes/widgets/nav/menu.pug +16 -0
- package/layout/includes/widgets/nav/right.pug +23 -0
- package/layout/includes/widgets/page/about/authorinfo.pug +12 -0
- package/layout/includes/widgets/page/about/award.pug +34 -0
- package/layout/includes/widgets/page/about/contentinfo.pug +38 -0
- package/layout/includes/widgets/page/about/hobbies.pug +33 -0
- package/layout/includes/widgets/page/about/motto.pug +19 -0
- package/layout/includes/widgets/page/about/other.pug +61 -0
- package/layout/includes/widgets/page/about/personalities.pug +16 -0
- package/layout/includes/widgets/page/about/skillsinfo.pug +41 -0
- package/layout/includes/widgets/page/banner.pug +14 -0
- package/layout/includes/widgets/page/equipment/content.pug +23 -0
- package/layout/includes/widgets/page/links/banner.pug +30 -0
- package/layout/includes/widgets/page/links/linksCard.pug +18 -0
- package/layout/includes/widgets/page/links/linksItem.pug +14 -0
- package/layout/includes/widgets/page/moments/angle.pug +24 -0
- package/layout/includes/widgets/page/moments/index.pug +18 -0
- package/layout/includes/widgets/page/says/saysBottom.pug +11 -0
- package/layout/includes/widgets/page/says/saysContent.pug +6 -0
- package/layout/includes/widgets/page/says/saysFunction.pug +10 -0
- package/layout/includes/widgets/page/says/saysMeta.pug +7 -0
- package/layout/includes/widgets/post/award.pug +48 -0
- package/layout/includes/widgets/post/copyright.pug +27 -0
- package/layout/includes/widgets/post/postMeta.pug +55 -0
- package/layout/includes/widgets/post/postNav.pug +25 -0
- package/layout/includes/widgets/post/wave.pug +9 -0
- package/layout/includes/widgets/randomlink.pug +32 -0
- package/layout/includes/widgets/rightside/index.pug +74 -0
- package/layout/includes/widgets/third-party/comments/comment.pug +14 -0
- package/layout/includes/widgets/third-party/comments/gitalk.pug +0 -0
- package/layout/{partial/compoment/third-party/comments/twikoo.ejs → includes/widgets/third-party/comments/twikoo.pug} +8 -9
- package/layout/includes/widgets/third-party/comments/valine.pug +0 -0
- package/layout/includes/widgets/third-party/music.pug +3 -0
- package/layout/includes/widgets/third-party/pjax.pug +30 -0
- package/layout/includes/widgets/third-party/search/algolia-search.pug +14 -0
- package/layout/includes/widgets/third-party/search/index.pug +7 -0
- package/layout/includes/widgets/third-party/search/local-search.pug +13 -0
- package/layout/index.pug +20 -0
- package/layout/page.pug +32 -0
- package/layout/post.pug +43 -0
- package/layout/tag.pug +19 -0
- package/package.json +4 -4
- package/scripts/event/page.js +20 -2
- package/scripts/filter/checkThemeConfig.js +0 -1
- package/scripts/filter/randomPosts.js +0 -1
- package/scripts/helper/{charts.js → echarts.js} +27 -28
- package/scripts/helper/stylus.js +23 -0
- package/scripts/tags/bvideo.js +1 -36
- package/source/css/_comment/index.styl +121 -0
- package/source/css/_comment/twikoo.styl +515 -0
- package/source/css/_extra/console.styl +354 -0
- package/source/css/_extra/rightmenu.styl +83 -0
- package/source/css/_global/animation.css +756 -0
- package/source/css/_global/function.styl +83 -0
- package/source/css/_global/index.styl +120 -0
- package/source/css/_global/var.styl +1 -0
- package/source/css/_layout/articleSort.styl +199 -0
- package/source/css/_layout/base.styl +392 -0
- package/source/css/_layout/footer.styl +359 -0
- package/source/css/_layout/header.styl +1331 -0
- package/source/css/_layout/index.styl +293 -0
- package/source/css/_layout/sidebar.styl +226 -0
- package/source/css/_mode/index.styl +52 -0
- package/source/css/_page/about.styl +835 -0
- package/source/css/_page/category.styl +141 -0
- package/source/css/_page/equipment.styl +101 -0
- package/source/css/_page/error.styl +161 -0
- package/source/css/_page/home.styl +58 -0
- package/source/css/_page/homeTop.styl +1035 -0
- package/source/css/_page/index.styl +131 -0
- package/source/css/_page/link.styl +433 -0
- package/source/css/_page/moment.styl +179 -0
- package/source/css/_page/rss.styl +87 -0
- package/source/css/_page/says.styl +347 -0
- package/source/css/_page/tag.styl +56 -0
- package/source/css/_post/commentBarrage.styl +149 -0
- package/source/css/_post/externalTags.styl +694 -0
- package/source/css/_post/highlight.styl +96 -0
- package/source/css/_post/index.styl +935 -0
- package/source/css/_post/pagination.styl +467 -0
- package/source/css/_post/postContent.styl +957 -0
- package/source/css/_post/relatedPost.styl +160 -0
- package/source/css/_post/reward.styl +217 -0
- package/source/css/_search/algolia-search.styl +154 -0
- package/source/css/_search/local-search.styl +131 -0
- package/source/css/_widgets/aside/allinfo.styl +134 -0
- package/source/css/_widgets/aside/flip.styl +68 -0
- package/source/css/_widgets/aside/history.styl +35 -0
- package/source/css/_widgets/aside/index.styl +156 -0
- package/source/css/_widgets/aside/info.styl +263 -0
- package/source/css/_widgets/aside/newPost.styl +55 -0
- package/source/css/_widgets/aside/power.styl +90 -0
- package/source/css/_widgets/aside/toc.styl +85 -0
- package/source/css/_widgets/aside/welcome.styl +14 -0
- package/source/css/_widgets/index.styl +3 -0
- package/source/css/index.styl +40 -0
- package/source/js/commentBarrage.js +8 -5
- package/source/js/extend/console/comment.js +60 -63
- package/source/js/extend/covercolor/local.js +1 -1
- package/source/js/extend/search/algolia-search.js +151 -134
- package/source/js/extend/search/local-search.js +137 -162
- package/source/js/main.js +655 -505
- package/source/js/utils.js +168 -145
- package/layout/404.ejs +0 -34
- package/layout/archive.ejs +0 -10
- package/layout/category.ejs +0 -18
- package/layout/index.ejs +0 -20
- package/layout/layout.ejs +0 -30
- package/layout/page/about.ejs +0 -15
- package/layout/page/categories.ejs +0 -12
- package/layout/page/circle.ejs +0 -5
- package/layout/page/echarts.ejs +0 -1
- package/layout/page/equipment.ejs +0 -2
- package/layout/page/links.ejs +0 -46
- package/layout/page/page.ejs +0 -3
- package/layout/page/rss.ejs +0 -39
- package/layout/page/says.ejs +0 -17
- package/layout/page/tags.ejs +0 -12
- package/layout/page/tlink.ejs +0 -11
- package/layout/page.ejs +0 -45
- package/layout/partial/body.ejs +0 -7
- package/layout/partial/compoment/about/authorinfo.ejs +0 -18
- package/layout/partial/compoment/about/award.ejs +0 -59
- package/layout/partial/compoment/about/contentinfo.ejs +0 -33
- package/layout/partial/compoment/about/hobbies.ejs +0 -53
- package/layout/partial/compoment/about/motto.ejs +0 -17
- package/layout/partial/compoment/about/other.ejs +0 -76
- package/layout/partial/compoment/about/personalities.ejs +0 -11
- package/layout/partial/compoment/about/skillsinfo.ejs +0 -62
- package/layout/partial/compoment/aside/aside.ejs +0 -28
- package/layout/partial/compoment/aside/asideAllInfo.ejs +0 -6
- package/layout/partial/compoment/aside/asideArchive.ejs +0 -11
- package/layout/partial/compoment/aside/asideFlipCard.ejs +0 -72
- package/layout/partial/compoment/aside/asideHistory.ejs +0 -49
- package/layout/partial/compoment/aside/asideInfoCard.ejs +0 -39
- package/layout/partial/compoment/aside/asideNewestPost.ejs +0 -31
- package/layout/partial/compoment/aside/asidePower.ejs +0 -31
- package/layout/partial/compoment/aside/asideSwitch.ejs +0 -41
- package/layout/partial/compoment/aside/asideTag.ejs +0 -5
- package/layout/partial/compoment/aside/asideToc.ejs +0 -11
- package/layout/partial/compoment/aside/asideWebInfo.ejs +0 -60
- package/layout/partial/compoment/aside/asideWelcome.ejs +0 -33
- package/layout/partial/compoment/circle/angle.ejs +0 -26
- package/layout/partial/compoment/circle/banner.ejs +0 -11
- package/layout/partial/compoment/circle/content.ejs +0 -19
- package/layout/partial/compoment/dorakika/rightmenu.ejs +0 -100
- package/layout/partial/compoment/equipment/list.ejs +0 -37
- package/layout/partial/compoment/home/homeCategoryBar.ejs +0 -11
- package/layout/partial/compoment/home/postList.ejs +0 -37
- package/layout/partial/compoment/hometop/bbTimeList.ejs +0 -15
- package/layout/partial/compoment/hometop/categoryGroup.ejs +0 -19
- package/layout/partial/compoment/hometop/groupTag.ejs +0 -30
- package/layout/partial/compoment/hometop/topGroup.ejs +0 -41
- package/layout/partial/compoment/inject/body.ejs +0 -70
- package/layout/partial/compoment/links/angle.ejs +0 -26
- package/layout/partial/compoment/links/banner.ejs +0 -42
- package/layout/partial/compoment/links/linksCard.ejs +0 -27
- package/layout/partial/compoment/links/linksItem.ejs +0 -21
- package/layout/partial/compoment/mixins/articleSort.ejs +0 -26
- package/layout/partial/compoment/mixins/pagination.ejs +0 -11
- package/layout/partial/compoment/nav/left.ejs +0 -22
- package/layout/partial/compoment/nav/menu.ejs +0 -25
- package/layout/partial/compoment/nav/right.ejs +0 -42
- package/layout/partial/compoment/post/award.ejs +0 -60
- package/layout/partial/compoment/post/copyright.ejs +0 -39
- package/layout/partial/compoment/post/postMeta.ejs +0 -85
- package/layout/partial/compoment/post/postNav.ejs +0 -41
- package/layout/partial/compoment/post/wave.ejs +0 -14
- package/layout/partial/compoment/says/banner.ejs +0 -10
- package/layout/partial/compoment/says/saysBottom.ejs +0 -18
- package/layout/partial/compoment/says/saysContent.ejs +0 -10
- package/layout/partial/compoment/says/saysFunction.ejs +0 -15
- package/layout/partial/compoment/third-party/comments/comment.ejs +0 -12
- package/layout/partial/compoment/third-party/comments/twikoo_k.ejs +0 -29
- package/layout/partial/compoment/third-party/music.ejs +0 -5
- package/layout/partial/compoment/third-party/pjax.ejs +0 -31
- package/layout/partial/compoment/third-party/search/algolia-search.ejs +0 -20
- package/layout/partial/compoment/third-party/search/index.ejs +0 -10
- package/layout/partial/compoment/third-party/search/local-search.ejs +0 -22
- package/layout/partial/compoment/tlink/banner.ejs +0 -10
- package/layout/partial/console.ejs +0 -68
- package/layout/partial/footer.ejs +0 -109
- package/layout/partial/head.ejs +0 -37
- package/layout/partial/header.ejs +0 -6
- package/layout/partial/hometop.ejs +0 -15
- package/layout/partial/nav.ejs +0 -34
- package/layout/partial/pwa.ejs +0 -40
- package/layout/partial/sidebar.ejs +0 -31
- package/layout/post.ejs +0 -52
- package/layout/tag.ejs +0 -19
- package/scripts/helper/randomLinks.js +0 -16
- package/scripts/helper/themeJsExport.js +0 -79
- package/source/css/commentBarrage.css +0 -174
- package/source/css/custom.css +0 -901
- package/source/css/main.css +0 -16285
- package/source/css/search/algolia-search.css +0 -141
- package/source/css/search/local-search.css +0 -138
- package/source/css/var.css +0 -189
- /package/source/js/{rightmenu.js → rightside.js} +0 -0
package/source/js/utils.js
CHANGED
@@ -1,153 +1,176 @@
|
|
1
1
|
const utils = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
throttle: function (func, wait, options) {
|
19
|
-
let timeout, context, args
|
20
|
-
let previous = 0
|
21
|
-
if (!options) options = {}
|
22
|
-
|
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
|
-
}
|
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
|
+
},
|
29
17
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
18
|
+
throttle: function (func, wait, options) {
|
19
|
+
let timeout, context, args
|
20
|
+
let previous = 0
|
21
|
+
if (!options) options = {}
|
22
|
+
|
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
const paddingRight = innerWidth - clientWidth
|
68
|
-
if (innerWidth !== clientWidth) {
|
69
|
-
document.body.style.paddingRight = paddingRight + 'px'
|
70
|
-
}
|
71
|
-
},
|
72
|
-
|
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
|
-
},
|
84
|
-
|
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
|
-
},
|
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
|
+
}
|
93
48
|
|
94
|
-
|
95
|
-
|
96
|
-
let current = ele.offsetParent
|
49
|
+
return throttled
|
50
|
+
},
|
97
51
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
52
|
+
fadeIn: (ele, time) => {
|
53
|
+
ele.style.cssText = `display:block;animation: to_show ${time}s`
|
54
|
+
},
|
55
|
+
|
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
|
+
},
|
63
|
+
|
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
|
+
},
|
72
|
+
|
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
|
+
},
|
84
|
+
|
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
|
+
},
|
93
|
+
|
94
|
+
getEleTop: ele => {
|
95
|
+
let actualTop = 0
|
96
|
+
while (ele) {
|
97
|
+
actualTop += ele.offsetTop
|
98
|
+
ele = ele.offsetParent
|
99
|
+
}
|
100
|
+
return actualTop
|
101
|
+
},
|
102
|
+
|
103
|
+
randomNum: (length) => {
|
104
|
+
return Math.floor(Math.random() * length)
|
105
|
+
},
|
106
|
+
|
107
|
+
timeDiff: (timeObj, today) => {
|
108
|
+
var timeDiff = today.getTime() - timeObj.getTime();
|
109
|
+
return Math.floor(timeDiff / (1000 * 3600 * 24));
|
110
|
+
},
|
111
|
+
|
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
|
+
},
|
136
|
+
|
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
|
+
addEventListenerPjax: function (element, eventType, callback, useCapture = false) {
|
148
|
+
element.addEventListener(eventType, callback, useCapture);
|
149
|
+
utils.addGlobalFn("pjax", function () {
|
150
|
+
element.removeEventListener(eventType, callback, useCapture);
|
151
|
+
});
|
152
|
+
},
|
153
|
+
addGlobalFn: (key, fn, name = false, parent = window) => {
|
154
|
+
const globalFn = parent.globalFn || {}
|
155
|
+
const keyObj = globalFn[key] || {}
|
156
|
+
|
157
|
+
if (name && keyObj[name]) return
|
102
158
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
if ('scrollBehavior' in document.documentElement.style) {
|
120
|
-
window.scrollTo({
|
121
|
-
top: pos,
|
122
|
-
behavior: 'smooth'
|
123
|
-
})
|
124
|
-
return
|
159
|
+
name = name || Object.keys(keyObj).length
|
160
|
+
keyObj[name] = fn
|
161
|
+
globalFn[key] = keyObj
|
162
|
+
parent.globalFn = globalFn
|
163
|
+
},
|
164
|
+
animateIn: (ele, text) => {
|
165
|
+
ele.style.display = 'block'
|
166
|
+
ele.style.animation = text
|
167
|
+
},
|
168
|
+
animateOut: (ele, text) => {
|
169
|
+
ele.addEventListener('animationend', function f() {
|
170
|
+
ele.style.display = ''
|
171
|
+
ele.style.animation = ''
|
172
|
+
ele.removeEventListener('animationend', f)
|
173
|
+
})
|
174
|
+
ele.style.animation = text
|
125
175
|
}
|
126
|
-
|
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
|
-
}
|
176
|
+
}
|
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
|
-
<% } %>
|
package/layout/archive.ejs
DELETED
@@ -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>
|
package/layout/category.ejs
DELETED
@@ -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>
|
package/layout/page/about.ejs
DELETED
@@ -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>
|
package/layout/page/circle.ejs
DELETED
package/layout/page/echarts.ejs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
<%- page.content %>
|
package/layout/page/links.ejs
DELETED
@@ -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
|
-
<% } %>
|
package/layout/page/page.ejs
DELETED
package/layout/page/rss.ejs
DELETED
@@ -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>
|
package/layout/page/says.ejs
DELETED
@@ -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>
|
package/layout/page/tags.ejs
DELETED
@@ -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>
|
package/layout/page/tlink.ejs
DELETED
@@ -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>
|