hexo-theme-solitude 1.9.1 → 1.9.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.
Files changed (56) hide show
  1. package/.github/ISSUE_TEMPLATE/config.yml +5 -1
  2. package/CODE_OF_CONDUCT.md +53 -93
  3. package/_config.yml +11 -0
  4. package/languages/default.yml +12 -7
  5. package/languages/en.yml +12 -7
  6. package/languages/zh-CN.yml +8 -3
  7. package/languages/zh-TW.yml +7 -4
  8. package/layout/includes/footer.pug +1 -0
  9. package/layout/includes/head/opengraph.pug +1 -0
  10. package/layout/includes/inject/body.pug +1 -1
  11. package/layout/includes/inject/head.pug +1 -1
  12. package/layout/includes/page/message.pug +5 -0
  13. package/layout/includes/page/music.pug +2 -2
  14. package/layout/includes/widgets/aside/asideArchive.pug +1 -1
  15. package/layout/includes/widgets/aside/asideCustom.pug +5 -5
  16. package/layout/includes/widgets/aside/asideInfoCard.pug +1 -1
  17. package/layout/includes/widgets/aside/asideSwitch.pug +1 -1
  18. package/layout/includes/widgets/page/about/personalities.pug +3 -3
  19. package/layout/includes/widgets/page/message/content.pug +9 -0
  20. package/layout/includes/widgets/page/message/js.pug +8 -0
  21. package/layout/includes/widgets/page/message/twikoo.pug +44 -0
  22. package/layout/includes/widgets/page/message/valine.pug +48 -0
  23. package/layout/includes/widgets/page/message/waline.pug +0 -0
  24. package/layout/includes/widgets/randomlink.pug +10 -4
  25. package/layout/includes/widgets/third-party/comments/artalk.pug +1 -1
  26. package/layout/includes/widgets/third-party/comments/twikoo.pug +1 -1
  27. package/layout/includes/widgets/third-party/news-comment/artalk.pug +3 -3
  28. package/layout/includes/widgets/third-party/news-comment/twikoo.pug +3 -3
  29. package/layout/includes/widgets/third-party/news-comment/valine.pug +3 -3
  30. package/layout/includes/widgets/third-party/news-comment/waline.pug +3 -3
  31. package/layout/page.pug +2 -0
  32. package/package.json +2 -2
  33. package/plugins.yml +6 -6
  34. package/scripts/event/cdn.js +6 -1
  35. package/source/css/_comments/valine.styl +2 -1
  36. package/source/css/_global/index.styl +8 -13
  37. package/source/css/_highlight/highlight/diff.styl +6 -2
  38. package/source/css/_highlight/highlight/index.styl +1 -0
  39. package/source/css/_highlight/prismjs/diff.styl +2 -3
  40. package/source/css/_layout/article-container.styl +9 -3
  41. package/source/css/_layout/aside.styl +1 -0
  42. package/source/css/_layout/console.styl +3 -1
  43. package/source/css/_page/index.styl +1 -1
  44. package/source/css/_page/message.styl +63 -0
  45. package/source/css/_page/music.styl +1 -1
  46. package/source/css/_page/tag.styl +1 -0
  47. package/source/css/_post/tools.styl +4 -0
  48. package/source/css/_tags/note.styl +5 -0
  49. package/source/css/third_party/snackbar.min.css +1 -1
  50. package/source/js/third_party/barrage.min.js +6 -0
  51. package/source/js/third_party/efu_ai.min.js +4 -4
  52. package/source/js/third_party/envelope.min.js +5 -0
  53. package/source/js/third_party/universe.min.js +1 -1
  54. package/source/js/utils.js +2 -1
  55. package/source/css/_page/douban.styl +0 -127
  56. package/source/js/barrage_comment.js +0 -77
@@ -1,127 +0,0 @@
1
- .hexo-douban-items
2
- display flex
3
- flex-wrap wrap
4
- gap 12px
5
- flex-direction row
6
-
7
- .hexo-douban-comment
8
- display none
9
-
10
- .hexo-douban-item
11
- position relative
12
- width calc(100% / 4 - 9px)
13
- border-radius 12px
14
- border var(--style-border)
15
- box-shadow var(--efu-shadow-border)
16
- background var(--efu-card-bg)
17
- transition .3s
18
- animation slide-in 0.6s 0.3s backwards
19
- border var(--style-border)
20
- margin 8px 0
21
- height 160px
22
- min-height 160px !important
23
- overflow hidden
24
-
25
- +maxWidth1200()
26
- width calc(100% / 3 - 9px)
27
-
28
- +maxWidth899()
29
- width calc(100% / 2 - 9px)
30
-
31
- +maxWidth600()
32
- width 100%
33
-
34
- &:hover
35
- border-color var(--efu-main)
36
-
37
- .hexo-douban-picture
38
- width 120px
39
- height 100%
40
- top 0
41
- padding 10px
42
-
43
- img
44
- margin 0
45
- height 100%
46
- max-width 100%
47
- border-radius 6px
48
-
49
- .hexo-douban-info
50
- display flex
51
- flex-wrap wrap
52
- align-content flex-start
53
- height 100%
54
- position relative
55
-
56
- .hexo-douban-rating
57
- position absolute
58
- bottom 5px
59
- line-height 16px
60
-
61
- .hexo-douban-meta
62
- display -webkit-box
63
- overflow hidden
64
- -webkit-box-orient vertical
65
-
66
- +maxWidth1300()
67
- -webkit-line-clamp 3 !important
68
-
69
- +maxWidth899()
70
- -webkit-line-clamp 4 !important
71
-
72
- .hexo-douban-title
73
- transition all .2s ease 0s
74
- white-space nowrap
75
- overflow hidden
76
- text-overflow ellipsis
77
- width 100%
78
-
79
- a
80
- border-bottom 0
81
-
82
- &:hover
83
- background none
84
- color var(--efu-main)
85
-
86
- .hexo-douban-pagination
87
- margin-top 1.25rem
88
- animation slide-in 0.6s 0.3s backwards
89
-
90
- .hexo-douban-button
91
- background var(--efu-card-bg)
92
- height 2rem
93
- line-height calc(2rem - 2px)
94
- border-radius 8px !important
95
- margin 0 0.3rem
96
- padding 6px 12px
97
- box-shadow var(--efu-shadow-border)
98
- border var(--style-border)
99
- transition 0.3s
100
- display inline-flex
101
- align-items center
102
-
103
- &:hover
104
- background var(--efu-main)
105
-
106
- .hexo-douban-tabs
107
- white-space nowrap
108
- overflow hidden
109
- display flex
110
- padding 0.4rem 1rem 0.4rem 1rem
111
- background var(--efu-card-bg)
112
- border-radius 12px
113
- border var(--style-border)
114
- animation slide-in 0.6s 0.3s backwards
115
-
116
- &:hover
117
- border-color var(--efu-main)
118
-
119
- a
120
- padding 0.1rem 0.5rem
121
- margin-right 6px
122
- font-weight 700
123
- border-radius 8px !important
124
- border-bottom 0
125
-
126
- .hexo-douban-tab-active
127
- background var(--efu-main)
@@ -1,77 +0,0 @@
1
- class Barrage {
2
- constructor(comments) {
3
- this.comments = comments;
4
- this.dom = document.querySelector(".comment-barrage");
5
- this.barrageList = [];
6
- this.barrageIndex = 0;
7
- this.barrageTimer = [];
8
- this.hoverOnCommentBarrage = false;
9
- this.init();
10
- }
11
-
12
- filterAndFlatten = (comments) => {
13
- return (comments.flatMap(comment => comment.replies ? [comment, ...this.filterAndFlatten(comment.replies)] : [comment]))
14
- }
15
-
16
- sanitizeContent(content) {
17
- return content.replace(/(<([^>]+)>)/ig, '').trim();
18
- }
19
-
20
- createBarrageItem(comment) {
21
- const content = this.sanitizeContent(comment.content);
22
- if (!content) return false;
23
- const element = document.createElement("div");
24
- element.className = "comment-barrage-item";
25
- element.innerHTML = `<div class="barrageHead"><a class="barrageTitle" href="javascript:sco.scrollTo('post-comment')">${GLOBAL_CONFIG.lang.barrage.title}</a><div class="barrageNick">${comment.nick}</div><img class="barrageAvatar" src="${GLOBAL_CONFIG.comment.avatar}/avatar/${comment.mailMd5}"/><a class="comment-barrage-close" href="javascript:sco.switchCommentBarrage();"><i class="solitude st-close-fill"></i></a></div><a class="barrageContent" href="${comment.id ? `javascript:sco.scrollTo(\'${comment.id}\')` : 'javascript:sco.scrollTo(\'post-comment\')'}">${content}</a>`;
26
- this.dom.appendChild(element);
27
- this.barrageTimer.push(element);
28
- return true;
29
- }
30
-
31
- removeBarrageItem(element) {
32
- element.classList.add("out");
33
- setTimeout(() => this.dom.removeChild(element), 1000);
34
- }
35
-
36
- manageBarrage() {
37
- if (this.barrageList.length && !this.hoverOnCommentBarrage) {
38
- if (!this.createBarrageItem(this.barrageList[this.barrageIndex])) {
39
- this.barrageIndex = (this.barrageIndex + 1) % this.barrageList.length;
40
- return this.manageBarrage();
41
- }
42
- this.barrageIndex = (this.barrageIndex + 1) % this.barrageList.length;
43
- }
44
- if (this.barrageTimer.length > Math.min(1, this.barrageList.length) && !this.hoverOnCommentBarrage) {
45
- this.removeBarrageItem(this.barrageTimer.shift());
46
- }
47
- }
48
-
49
- initBarrage() {
50
- const storageSwitch = utils.saveToLocal.get("commentBarrageSwitch");
51
- this.dom.style.display = storageSwitch ? "flex" : "none";
52
- this.barrageList = this.filterAndFlatten(this.comments);
53
- this.dom.innerHTML = "";
54
- clearInterval(this.commentInterval);
55
- this.commentInterval = setInterval(() => this.manageBarrage(), 5000);
56
- }
57
-
58
- init() {
59
- this.initBarrage();
60
- this.dom.addEventListener('mouseover', () => this.hoverOnCommentBarrage = true);
61
- this.dom.addEventListener('mouseout', () => this.hoverOnCommentBarrage = false);
62
- }
63
-
64
- destroy() {
65
- clearInterval(this.commentInterval);
66
- this.dom.removeEventListener('mouseover', () => this.hoverOnCommentBarrage = true)
67
- this.dom.removeEventListener('mouseout', () => this.hoverOnCommentBarrage = false)
68
- this.dom.innerHTML = ""
69
- }
70
- }
71
-
72
- function initializeCommentBarrage(array) {
73
- if (array.length === 0) return;
74
- let existingBarrage = window.currentBarrage;
75
- if (existingBarrage) existingBarrage.destroy();
76
- window.currentBarrage = new Barrage(array);
77
- }