hexo-theme-solitude 1.11.2 → 1.11.3
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/README.md +3 -0
- package/languages/default.yml +2 -1
- package/languages/en.yml +2 -1
- package/languages/zh-CN.yml +1 -0
- package/languages/zh-TW.yml +1 -0
- package/layout/includes/head/config.pug +1 -0
- package/layout/includes/inject/head.pug +1 -1
- package/layout/includes/widgets/third-party/comments/artalk.pug +1 -1
- package/package.json +1 -1
- package/source/css/_layout/aside.styl +1 -1
- package/source/css/_layout/console.styl +0 -1
- package/source/css/_search/local-search.styl +4 -0
- package/source/js/main.js +15 -12
- package/source/js/utils.js +8 -0
package/README.md
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|

|
16
16
|
[](https://github.com/valor-x/hexo-theme-solitude/stargazers)
|
17
17
|
[](https://www.npmjs.com/package/hexo-theme-solitude)
|
18
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_shield)
|
18
19
|
|
19
20
|

|
20
21
|

|
@@ -88,3 +89,5 @@
|
|
88
89
|
## 版权
|
89
90
|
|
90
91
|
[MIT](./LICENSE) License © 2023-至今 [EverFu](https://github.com/efuo)
|
92
|
+
|
93
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_large)
|
package/languages/default.yml
CHANGED
@@ -4,6 +4,7 @@ random: Random
|
|
4
4
|
upload: 'datetime: '
|
5
5
|
totalk: You don't need to delete blank lines, just type in your comments.
|
6
6
|
loading: Loading...
|
7
|
+
day: ' days'
|
7
8
|
|
8
9
|
theme:
|
9
10
|
dark: Dark
|
@@ -71,7 +72,7 @@ nav:
|
|
71
72
|
|
72
73
|
award:
|
73
74
|
thanks: Thanks
|
74
|
-
tipping:
|
75
|
+
tipping: Sponsor
|
75
76
|
title: List of appreciation
|
76
77
|
|
77
78
|
search:
|
package/languages/en.yml
CHANGED
@@ -4,6 +4,7 @@ random: Random
|
|
4
4
|
upload: 'datetime: '
|
5
5
|
totalk: You don't need to delete blank lines, just type in your comments.
|
6
6
|
loading: Loading...
|
7
|
+
day: ' days'
|
7
8
|
|
8
9
|
theme:
|
9
10
|
dark: Dark
|
@@ -71,7 +72,7 @@ nav:
|
|
71
72
|
|
72
73
|
award:
|
73
74
|
thanks: Thanks
|
74
|
-
tipping:
|
75
|
+
tipping: Sponsor
|
75
76
|
title: List of appreciation
|
76
77
|
|
77
78
|
search:
|
package/languages/zh-CN.yml
CHANGED
package/languages/zh-TW.yml
CHANGED
@@ -27,7 +27,7 @@ include ../head/pwa.pug
|
|
27
27
|
|
28
28
|
script.
|
29
29
|
console.log(
|
30
|
-
"%c Program: Hexo %c Theme: Solitude %c Version: v1.11.
|
30
|
+
"%c Program: Hexo %c Theme: Solitude %c Version: v1.11.3",
|
31
31
|
"border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
|
32
32
|
"padding: 5px 10px;color:white;background:#3e9f50;",
|
33
33
|
"padding: 5px 10px;color:white;background:#0084ff;border-radius:0 5px 5px 0",
|
@@ -23,8 +23,8 @@ script.
|
|
23
23
|
})
|
24
24
|
const $content = comment.getRender().$content
|
25
25
|
GLOBAL_CONFIG.lightbox && utils.lightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
26
|
-
sco.owoBig({body: '.atk-grp', item: '.atk-item'})
|
27
26
|
})
|
27
|
+
sco.owoBig({body: '.atk-grp', item: '.atk-item'})
|
28
28
|
!{commentBarrage} && barrageArtalk(array)
|
29
29
|
})
|
30
30
|
const destroyArtalk = () => artalkItem.destroy()
|
package/package.json
CHANGED
package/source/js/main.js
CHANGED
@@ -329,7 +329,7 @@ let sco = {
|
|
329
329
|
*/
|
330
330
|
addRuntime: function () {
|
331
331
|
let el = document.getElementById('runtimeshow')
|
332
|
-
el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.
|
332
|
+
el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.day)
|
333
333
|
},
|
334
334
|
/**
|
335
335
|
* toTalk
|
@@ -775,17 +775,20 @@ class tabs {
|
|
775
775
|
}
|
776
776
|
|
777
777
|
static clickFnOfTabs() {
|
778
|
-
document.querySelectorAll('#article-container .tab > button').forEach(item
|
779
|
-
item.addEventListener('click', e
|
780
|
-
const
|
778
|
+
document.querySelectorAll('#article-container .tab > button').forEach(function (item) {
|
779
|
+
item.addEventListener('click', function (e) {
|
780
|
+
const that = this
|
781
|
+
const $tabItem = that.parentNode
|
781
782
|
if (!$tabItem.classList.contains('active')) {
|
782
783
|
const $tabContent = $tabItem.parentNode.nextElementSibling
|
783
|
-
const $siblings = $tabItem
|
784
|
+
const $siblings = utils.siblings($tabItem, '.active')[0]
|
784
785
|
$siblings && $siblings.classList.remove('active')
|
785
786
|
$tabItem.classList.add('active')
|
786
|
-
const tabId =
|
787
|
-
|
788
|
-
|
787
|
+
const tabId = that.getAttribute('data-href').replace('#', '')
|
788
|
+
const childList = [...$tabContent.children]
|
789
|
+
childList.forEach(item => {
|
790
|
+
if (item.id === tabId) item.classList.add('active')
|
791
|
+
else item.classList.remove('active')
|
789
792
|
})
|
790
793
|
}
|
791
794
|
})
|
@@ -793,14 +796,14 @@ class tabs {
|
|
793
796
|
}
|
794
797
|
|
795
798
|
static backToTop() {
|
796
|
-
document.querySelectorAll('#article-container .tabs .tab-to-top').forEach(item
|
797
|
-
item.addEventListener('click', ()
|
798
|
-
utils.scrollToDest(utils.getEleTop(item.
|
799
|
+
document.querySelectorAll('#article-container .tabs .tab-to-top').forEach(function (item) {
|
800
|
+
item.addEventListener('click', function () {
|
801
|
+
utils.scrollToDest(utils.getEleTop(item.parentElement.parentElement.parentNode), 300)
|
802
|
+
|
799
803
|
})
|
800
804
|
})
|
801
805
|
}
|
802
806
|
}
|
803
|
-
|
804
807
|
// 页面刷新
|
805
808
|
window.refreshFn = () => {
|
806
809
|
const {is_home, is_page, page, is_post} = PAGE_CONFIG;
|
package/source/js/utils.js
CHANGED
@@ -59,6 +59,14 @@
|
|
59
59
|
}
|
60
60
|
return actualTop;
|
61
61
|
},
|
62
|
+
siblings: (ele, selector) => {
|
63
|
+
return [...ele.parentNode.children].filter((child) => {
|
64
|
+
if (selector) {
|
65
|
+
return child !== ele && child.matches(selector)
|
66
|
+
}
|
67
|
+
return child !== ele
|
68
|
+
})
|
69
|
+
},
|
62
70
|
randomNum: (length) => {
|
63
71
|
return Math.floor(Math.random() * length)
|
64
72
|
},
|