hexo-theme-solitude 1.9.2 → 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 (44) 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/head/opengraph.pug +1 -0
  9. package/layout/includes/inject/head.pug +2 -2
  10. package/layout/includes/page/message.pug +5 -0
  11. package/layout/includes/page/music.pug +2 -2
  12. package/layout/includes/widgets/aside/asideArchive.pug +1 -1
  13. package/layout/includes/widgets/page/message/content.pug +9 -0
  14. package/layout/includes/widgets/page/message/js.pug +8 -0
  15. package/layout/includes/widgets/page/message/twikoo.pug +44 -0
  16. package/layout/includes/widgets/page/message/valine.pug +48 -0
  17. package/layout/includes/widgets/page/message/waline.pug +0 -0
  18. package/layout/includes/widgets/randomlink.pug +10 -4
  19. package/layout/includes/widgets/third-party/news-comment/artalk.pug +3 -3
  20. package/layout/includes/widgets/third-party/news-comment/twikoo.pug +3 -3
  21. package/layout/includes/widgets/third-party/news-comment/valine.pug +3 -3
  22. package/layout/includes/widgets/third-party/news-comment/waline.pug +3 -3
  23. package/layout/page.pug +2 -0
  24. package/package.json +2 -2
  25. package/plugins.yml +6 -6
  26. package/scripts/event/cdn.js +6 -1
  27. package/source/css/_global/index.styl +8 -13
  28. package/source/css/_highlight/highlight/diff.styl +6 -2
  29. package/source/css/_highlight/highlight/index.styl +1 -0
  30. package/source/css/_layout/article-container.styl +9 -3
  31. package/source/css/_layout/aside.styl +1 -0
  32. package/source/css/_layout/console.styl +3 -1
  33. package/source/css/_page/index.styl +1 -1
  34. package/source/css/_page/message.styl +63 -0
  35. package/source/css/_page/music.styl +1 -1
  36. package/source/css/_page/tag.styl +1 -0
  37. package/source/css/_tags/note.styl +5 -0
  38. package/source/css/third_party/snackbar.min.css +1 -1
  39. package/source/js/third_party/barrage.min.js +6 -0
  40. package/source/js/third_party/efu_ai.min.js +4 -4
  41. package/source/js/third_party/envelope.min.js +5 -0
  42. package/source/js/third_party/universe.min.js +1 -1
  43. package/source/css/_page/douban.styl +0 -127
  44. package/source/js/barrage_comment.js +0 -77
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by the efu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -26,7 +26,7 @@
26
26
  "url": "https://github.com/valor-x/hexo-theme-solitude/issues",
27
27
  "email": "o@efu.me"
28
28
  },
29
- "homepage": "https://efu.me/",
29
+ "homepage": "https://www.efu.me/",
30
30
  "author": "Hexo-Theme-Solitude<o@efu.me>",
31
31
  "license": "MIT"
32
32
  }
package/plugins.yml CHANGED
@@ -1,11 +1,11 @@
1
1
  algolia_search:
2
2
  name: algoliasearch
3
3
  file: dist/algoliasearch-lite.umd.js
4
- version: 4.23.2
4
+ version: 4.23.3
5
5
  instantsearch:
6
6
  name: instantsearch.js
7
7
  file: dist/instantsearch.production.min.js
8
- version: 4.66.1
8
+ version: 4.67.0
9
9
  pjax:
10
10
  name: pjax
11
11
  file: pjax.min.js
@@ -31,11 +31,11 @@ valine:
31
31
  artalk_css:
32
32
  name: artalk
33
33
  file: dist/Artalk.css
34
- version: 2.8.4
34
+ version: 2.8.5
35
35
  artalk_js:
36
36
  name: artalk
37
37
  file: dist/Artalk.js
38
- version: 2.8.4
38
+ version: 2.8.5
39
39
  katex:
40
40
  name: katex
41
41
  file: dist/katex.min.css
@@ -90,7 +90,7 @@ snackbar:
90
90
  file: dist/snackbar.min.js
91
91
  version: 0.1.16
92
92
  solitude_css:
93
- name: st-source
93
+ name: solitude-source
94
94
  file: icon/solitude.min.css
95
95
  version: 1.0.5
96
96
  medium_zoom:
@@ -110,7 +110,7 @@ fancyapps_css:
110
110
  mermaid_js:
111
111
  name: mermaid
112
112
  file: dist/mermaid.min.js
113
- version: 10.8.0
113
+ version: 10.9.0
114
114
  blueimp_md5:
115
115
  name: blueimp-md5
116
116
  file: js/md5.min.js
@@ -66,7 +66,7 @@ hexo.extend.filter.register('before_generate', () => {
66
66
  },
67
67
  commentBarrage: {
68
68
  name: 'hexo-theme-solitude',
69
- file: 'js/barrage_comment.js',
69
+ file: 'js/third_party/barrage.min.js',
70
70
  version
71
71
  },
72
72
  waterfall: {
@@ -78,6 +78,11 @@ hexo.extend.filter.register('before_generate', () => {
78
78
  name: 'hexo-theme-solitude',
79
79
  file: 'js/third_party/universe.min.js',
80
80
  version
81
+ },
82
+ envelope_js: {
83
+ name: 'hexo-theme-solitude',
84
+ file: 'js/third_party/envelope.min.js',
85
+ version
81
86
  }
82
87
  }
83
88
 
@@ -249,19 +249,24 @@ input::placeholder
249
249
  margin 0 0 1rem
250
250
 
251
251
  table
252
- display table
252
+ display block
253
253
  width 100%
254
254
  border-spacing 0
255
255
  border-collapse collapse
256
256
  empty-cells show
257
+ overflow-x auto
258
+
259
+ &::-webkit-scrollbar
260
+ display none
257
261
 
258
262
  table thead
259
- background rgba(153, 169, 191, .1)
263
+ background var(--efu-secondbg)
260
264
 
261
265
  table td, table th
262
266
  padding .3rem .6rem
263
- border 1px solid var(--light-grey)
267
+ border var(--style-border-always)
264
268
  vertical-align middle
269
+ min-width 100px
265
270
 
266
271
  button
267
272
  padding 0
@@ -311,10 +316,6 @@ blockquote
311
316
  margin 1rem 0
312
317
  padding .5rem .8rem
313
318
 
314
- p
315
- padding 0
316
- margin 0
317
-
318
319
  li, ul
319
320
  list-style none
320
321
  display block
@@ -348,12 +349,6 @@ a.extend
348
349
  .prev
349
350
  left 0
350
351
 
351
- table td, table th
352
- border var(--style-border-always)
353
-
354
- table thead
355
- background var(--efu-secondbg)
356
-
357
352
  b, strong
358
353
  color var(--efu-lighttext)
359
354
 
@@ -1,6 +1,10 @@
1
1
  figure.highlight
2
- table
3
- scrollbar-color var(--hlscrollbar-bg) transparent
2
+ table::-webkit-scrollbar
3
+ color var(--efu-secondbg)
4
+ height 6px
5
+ background var(--efu-hl-bg)
6
+ border-radius 6px
7
+ display initial
4
8
  pre .deletion
5
9
  color $highlight-deletion
6
10
 
@@ -18,6 +18,7 @@ figure
18
18
  &.gutter
19
19
  opacity .6
20
20
  user-select none
21
+ min-width initial
21
22
 
22
23
  pre
23
24
  overflow auto
@@ -56,9 +56,6 @@
56
56
  color var(--efu-lighttext)
57
57
  opacity 1
58
58
 
59
- &::before
60
- color var(--efu-main)
61
-
62
59
  p
63
60
  font-size .9rem
64
61
  line-height 1.7
@@ -81,6 +78,12 @@
81
78
  border-radius 4px
82
79
  background var(--efu-main)
83
80
 
81
+ blockquote
82
+ p
83
+ padding 0
84
+ margin 0
85
+ font-size 15px
86
+
84
87
  code:not([class*='language-'])
85
88
  color var(--efu-white)
86
89
  padding 0.2rem 0.4rem
@@ -117,6 +120,9 @@
117
120
  position relative
118
121
  margin 0.2rem 0
119
122
 
123
+ p
124
+ margin 0
125
+
120
126
  ul
121
127
  > li
122
128
  &:not(.tab)
@@ -171,6 +171,7 @@
171
171
  #card-toc
172
172
  +minWidth901()
173
173
  right 0
174
+ padding .5rem
174
175
 
175
176
  .toc-content
176
177
  overflow-y: auto
@@ -279,13 +279,15 @@
279
279
  .card-archive-list
280
280
  display flex
281
281
  flex-direction row
282
- justify-content space-between
283
282
  flex-wrap wrap
284
283
  height 164px
285
284
 
286
285
  li.card-archive-list-item
287
286
  flex 0 0 24%
288
287
 
288
+ &:not(:nth-child(4n))
289
+ margin-right .555rem
290
+
289
291
  .card-archive-list-link
290
292
  border-radius 8px
291
293
  margin-top 8px
@@ -26,7 +26,7 @@ if $about
26
26
 
27
27
  @import "other"
28
28
 
29
- @import "douban"
29
+ @import "message"
30
30
 
31
31
  #page h1.page-title
32
32
  display inline
@@ -0,0 +1,63 @@
1
+ .switch_message
2
+ display flex
3
+ justify-content center
4
+ margin 2rem 0
5
+ gap 1rem
6
+ button
7
+ background-color var(--efu-main)
8
+ border var(--style-border-always)
9
+ border-radius 50px
10
+ color var(--efu-card-bg)
11
+ padding 0.5rem 1rem
12
+ transition background-color 0.3s
13
+
14
+ #barrage
15
+ display flex
16
+ justify-content center
17
+ width 100%
18
+ height calc(100% - 60px)
19
+ position fixed
20
+ left 0
21
+ top 60px
22
+ z-index 1
23
+ pointer-events none
24
+
25
+ .default-style
26
+ pointer-events all
27
+ cursor pointer
28
+ font-size 16px
29
+ border-radius 100px
30
+ overflow hidden
31
+
32
+ a
33
+ background-color rgba(0, 0, 0, 0.5)
34
+ transition .3s
35
+ color #eee
36
+ display flex
37
+ align-items center
38
+ justify-content center
39
+ padding 6px 16px 6px 6px
40
+ text-decoration none
41
+ border-bottom none
42
+
43
+ &:hover
44
+ background-color rgba(0, 0, 0, 0.7)
45
+
46
+ img
47
+ pointer-events none
48
+ height 30px
49
+ width 30px
50
+ margin 0 5px 0 0 !important
51
+ border-radius 50% !important
52
+
53
+ p
54
+ line-height 1
55
+ pointer-events none
56
+ margin 0 !important
57
+ max-width 300px
58
+ white-space nowrap
59
+ overflow hidden
60
+ text-overflow ellipsis
61
+
62
+ .hide
63
+ opacity 0
@@ -239,7 +239,7 @@ body[data-type=music]
239
239
  color #fff
240
240
 
241
241
  .aplayer-lrc
242
- padding-top 240px
242
+ padding-top 24%
243
243
  height 100vh
244
244
 
245
245
  +maxWidth798()
@@ -1,6 +1,7 @@
1
1
  #tag
2
2
  +minWidth1300()
3
3
  padding: 4rem 2rem 1rem 2rem
4
+ overflow hidden
4
5
 
5
6
  +maxWidth768()
6
7
  padding 0 1rem
@@ -43,6 +43,11 @@ $colors = {
43
43
  left .7rem
44
44
  font-size larger
45
45
 
46
+ a
47
+ color inherit !important
48
+ &:hover
49
+ color var(--efu-white) !important
50
+
46
51
  for $color, $value in $colors
47
52
  &.{$color}:not(.no-icon)::before
48
53
  color $value
@@ -1 +1 @@
1
- @keyframes snackbar-progress{0%{width:0}to{width:100%}}.snackbar-container{transition:all .5s ease;font-family:Roboto,sans-serif;font-size:14px;position:fixed;align-items:center;line-height:22px;padding:18px 24px;bottom:-100px;top:-100px;opacity:0;z-index:9999;background:var(--efu-lighttext)!important;color:var(--efu-card-bg);border-radius:0;display:flex;justify-content:center;max-width:none;min-width:100%!important;margin:0!important;left:0!important;height:60px;transform:none!important}.snackbar-container p{color:var(--efu-card-bg)!important;font-weight:700!important;text-align:center;font-size:.8rem!important;display:flex;justify-content:center}.snackbar-container .action{display:inline-block;font-size:inherit;margin:0 0 0 24px;min-width:min-content;cursor:pointer;color:var(--efu-card-bg);background:var(--efu-lighttext);padding:4px 6px;font-weight:700;border-radius:8px;transition:.3s;border:var(--style-border)}.snackbar-container .action:hover{background:var(--efu-card-bg);color:var(--efu-lighttext)}.snackbar-container:after{position:absolute;width:0;height:100%;left:0;top:0;background:var(--efu-white);opacity:.1;content:"";animation:snackbar-progress var(--efu-snackbar-time) linear forwards;pointer-events:none}@media (min-width:640px){.snackbar-container{min-width:288px;max-width:568px;display:inline-flex;border-radius:2px;margin:24px}}@media (max-width:640px){.snackbar-container{left:0;right:0;width:100%}}.snackbar-pos.bottom-center{top:auto!important;bottom:0;left:50%;transform:translate(-50%,0)}.snackbar-pos.bottom-left{top:auto!important;bottom:0;left:0}.snackbar-pos.bottom-right{top:auto!important;bottom:0;right:0}.snackbar-pos.top-center,.snackbar-pos.top-left{bottom:auto!important;top:0;left:0}.snackbar-pos.top-center{left:50%;transform:translate(-50%,0)}.snackbar-pos.top-right{bottom:auto!important;top:0;right:0}@media (max-width:640px){.snackbar-pos.bottom-center,.snackbar-pos.top-center{left:0;transform:none}}
1
+ @keyframes snackbar-progress{0%{width:0}to{width:100%}}.snackbar-container{transition:all .5s ease;font-family:Roboto,sans-serif;font-size:14px;position:fixed;align-items:center;line-height:22px;padding:18px 24px;bottom:-100px;top:-100px;opacity:0;z-index:9999;background:var(--efu-lighttext)!important;color:var(--efu-card-bg);border-radius:0;display:flex;justify-content:center;max-width:none;min-width:100%!important;margin:0!important;left:0!important;height:60px;transform:none!important}.snackbar-container p{color:var(--efu-card-bg)!important;font-weight:700!important;text-align:center;font-size:.8rem!important;display:flex;justify-content:center}.snackbar-container .action{display:inline-block;font-size:inherit;margin:0 0 0 24px;min-width:min-content;cursor:pointer;color:var(--efu-card-bg) !important;background:var(--efu-lighttext);padding:4px 6px;font-weight:700;border-radius:8px;transition:.3s;border:var(--style-border)}.snackbar-container .action:hover{background:var(--efu-card-bg);color:var(--efu-lighttext) !important}.snackbar-container:after{position:absolute;width:0;height:100%;left:0;top:0;background:var(--efu-white);opacity:.1;content:"";animation:snackbar-progress var(--efu-snackbar-time) linear forwards;pointer-events:none}@media (min-width:640px){.snackbar-container{min-width:288px;max-width:568px;display:inline-flex;border-radius:2px;margin:24px}}@media (max-width:640px){.snackbar-container{left:0;right:0;width:100%}}.snackbar-pos.bottom-center{top:auto!important;bottom:0;left:50%;transform:translate(-50%,0)}.snackbar-pos.bottom-left{top:auto!important;bottom:0;left:0}.snackbar-pos.bottom-right{top:auto!important;bottom:0;right:0}.snackbar-pos.top-center,.snackbar-pos.top-left{bottom:auto!important;top:0;left:0}.snackbar-pos.top-center{left:50%;transform:translate(-50%,0)}.snackbar-pos.top-right{bottom:auto!important;top:0;right:0}@media (max-width:640px){.snackbar-pos.bottom-center,.snackbar-pos.top-center{left:0;transform:none}}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Barrage Comment
3
+ * author: @efuo
4
+ * date: 2024-04-28
5
+ */
6
+ function _0x2736(_0x423b83,_0x26de1b){const _0x562b41=_0x562b();return _0x2736=function(_0x2736dc,_0x1e863c){_0x2736dc=_0x2736dc-0x11f;let _0x1c44ad=_0x562b41[_0x2736dc];return _0x1c44ad;},_0x2736(_0x423b83,_0x26de1b);}const _0xf096ba=_0x2736;(function(_0x244294,_0x51eb5a){const _0x2047ac=_0x2736,_0x461abb=_0x244294();while(!![]){try{const _0x362f69=-parseInt(_0x2047ac(0x12f))/0x1+-parseInt(_0x2047ac(0x126))/0x2+-parseInt(_0x2047ac(0x120))/0x3+-parseInt(_0x2047ac(0x15b))/0x4+parseInt(_0x2047ac(0x13c))/0x5+parseInt(_0x2047ac(0x153))/0x6*(parseInt(_0x2047ac(0x15c))/0x7)+parseInt(_0x2047ac(0x132))/0x8*(parseInt(_0x2047ac(0x152))/0x9);if(_0x362f69===_0x51eb5a)break;else _0x461abb['push'](_0x461abb['shift']());}catch(_0x59d2ed){_0x461abb['push'](_0x461abb['shift']());}}}(_0x562b,0xa9d59));class Barrage{constructor(_0x35d098){const _0xc51bb8=_0x2736;this['comments']=_0x35d098,this[_0xc51bb8(0x136)]=document[_0xc51bb8(0x15a)](_0xc51bb8(0x142)),this[_0xc51bb8(0x12c)]=[],this[_0xc51bb8(0x133)]=0x0,this[_0xc51bb8(0x139)]=[],this[_0xc51bb8(0x14b)]=![],this[_0xc51bb8(0x146)]();}[_0xf096ba(0x13e)]=_0x50912d=>{const _0x243af9=_0xf096ba;return _0x50912d['flatMap'](_0x18bbb5=>_0x18bbb5[_0x243af9(0x14a)]?[_0x18bbb5,...this['filterAndFlatten'](_0x18bbb5[_0x243af9(0x14a)])]:[_0x18bbb5]);};[_0xf096ba(0x135)](_0x25b918){const _0x4cf7a3=_0xf096ba;return _0x25b918[_0x4cf7a3(0x124)](/(<([^>]+)>)/ig,'')[_0x4cf7a3(0x12e)]();}[_0xf096ba(0x147)](_0x3c5b88){const _0x58f618=_0xf096ba,_0x1c09f9=this[_0x58f618(0x135)](_0x3c5b88[_0x58f618(0x156)]);if(!_0x1c09f9)return![];const _0xbed29a=document[_0x58f618(0x127)]('div');return _0xbed29a[_0x58f618(0x122)]=_0x58f618(0x138),_0xbed29a[_0x58f618(0x12d)]='<div\x20class=\x22barrageHead\x22><a\x20class=\x22barrageTitle\x22\x20href=\x22javascript:sco.scrollTo(\x27post-comment\x27)\x22>'+GLOBAL_CONFIG[_0x58f618(0x125)][_0x58f618(0x158)][_0x58f618(0x134)]+_0x58f618(0x140)+_0x3c5b88['nick']+_0x58f618(0x149)+GLOBAL_CONFIG[_0x58f618(0x130)][_0x58f618(0x13b)]+_0x58f618(0x143)+_0x3c5b88[_0x58f618(0x131)]+_0x58f618(0x14d)+(_0x3c5b88['id']?_0x58f618(0x14f)+_0x3c5b88['id']+'\x27)':'javascript:sco.scrollTo(\x27post-comment\x27)')+'\x22>'+_0x1c09f9+_0x58f618(0x11f),this[_0x58f618(0x136)][_0x58f618(0x155)](_0xbed29a),this[_0x58f618(0x139)][_0x58f618(0x12a)](_0xbed29a),!![];}[_0xf096ba(0x141)](_0x4142a6){const _0x5da976=_0xf096ba;_0x4142a6[_0x5da976(0x13a)][_0x5da976(0x14e)](_0x5da976(0x13f)),setTimeout(()=>this[_0x5da976(0x136)][_0x5da976(0x121)](_0x4142a6),0x3e8);}[_0xf096ba(0x154)](){const _0x3d0cb8=_0xf096ba;if(this['barrageList'][_0x3d0cb8(0x159)]&&!this[_0x3d0cb8(0x14b)]){if(!this[_0x3d0cb8(0x147)](this['barrageList'][this[_0x3d0cb8(0x133)]]))return this[_0x3d0cb8(0x133)]=(this[_0x3d0cb8(0x133)]+0x1)%this[_0x3d0cb8(0x12c)][_0x3d0cb8(0x159)],this[_0x3d0cb8(0x154)]();this[_0x3d0cb8(0x133)]=(this[_0x3d0cb8(0x133)]+0x1)%this['barrageList'][_0x3d0cb8(0x159)];}this[_0x3d0cb8(0x139)][_0x3d0cb8(0x159)]>Math['min'](0x1,this['barrageList'][_0x3d0cb8(0x159)])&&!this[_0x3d0cb8(0x14b)]&&this[_0x3d0cb8(0x141)](this['barrageTimer'][_0x3d0cb8(0x150)]());}['initBarrage'](){const _0x571de5=_0xf096ba,_0x2e2e3e=utils[_0x571de5(0x157)][_0x571de5(0x137)](_0x571de5(0x128));this[_0x571de5(0x136)]['style']['display']=_0x2e2e3e?_0x571de5(0x13d):_0x571de5(0x144),this[_0x571de5(0x12c)]=this['filterAndFlatten'](this[_0x571de5(0x145)]),this[_0x571de5(0x136)][_0x571de5(0x12d)]='',clearInterval(this['commentInterval']),this[_0x571de5(0x14c)]=setInterval(()=>this[_0x571de5(0x154)](),0x1388);}[_0xf096ba(0x146)](){const _0x81bb1e=_0xf096ba;this['initBarrage'](),this['dom'][_0x81bb1e(0x148)]('mouseover',()=>this['hoverOnCommentBarrage']=!![]),this[_0x81bb1e(0x136)][_0x81bb1e(0x148)](_0x81bb1e(0x151),()=>this[_0x81bb1e(0x14b)]=![]);}[_0xf096ba(0x123)](){const _0x569798=_0xf096ba;clearInterval(this[_0x569798(0x14c)]),this[_0x569798(0x136)][_0x569798(0x129)]('mouseover',()=>this[_0x569798(0x14b)]=!![]),this[_0x569798(0x136)][_0x569798(0x129)](_0x569798(0x151),()=>this['hoverOnCommentBarrage']=![]),this[_0x569798(0x136)][_0x569798(0x12d)]='';}}function _0x562b(){const _0x3031bd=['</div><img\x20class=\x22barrageAvatar\x22\x20src=\x22','replies','hoverOnCommentBarrage','commentInterval','\x22/><a\x20class=\x22comment-barrage-close\x22\x20href=\x22javascript:sco.switchCommentBarrage();\x22><i\x20class=\x22solitude\x20st-close-fill\x22></i></a></div><a\x20class=\x22barrageContent\x22\x20href=\x22','add','javascript:sco.scrollTo(\x27','shift','mouseout','10792323NNfVVh','32478HpqMfw','manageBarrage','appendChild','content','saveToLocal','barrage','length','querySelector','209952OxSGhj','854DBnOiw','</a>','3742368aCgLQg','removeChild','className','destroy','replace','lang','1438760uXBNRa','createElement','commentBarrageSwitch','removeEventListener','push','currentBarrage','barrageList','innerHTML','trim','271090IyHbzI','comment','mailMd5','8MDfQRc','barrageIndex','title','sanitizeContent','dom','get','comment-barrage-item','barrageTimer','classList','avatar','5632610YtcmxI','flex','filterAndFlatten','out','</a><div\x20class=\x22barrageNick\x22>','removeBarrageItem','.comment-barrage','/avatar/','none','comments','init','createBarrageItem','addEventListener'];_0x562b=function(){return _0x3031bd;};return _0x562b();}function initializeCommentBarrage(_0x506af1){const _0x438d69=_0xf096ba;if(_0x506af1[_0x438d69(0x159)]===0x0)return;let _0x6d138e=window[_0x438d69(0x12b)];if(_0x6d138e)_0x6d138e[_0x438d69(0x123)]();window[_0x438d69(0x12b)]=new Barrage(_0x506af1);}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * author: Efu
3
- * email: o@efu.me
4
- * website: https://efu.me
2
+ * efuAI
3
+ * author: @efuo
4
+ * version: 1.0.0
5
5
  */
6
- class efuAI{constructor(){this.root="https://summary.tianli0.top",this.aiTalkMode=!1,this.aiPostExplanation='',this.config=GLOBAL_CONFIG.post_ai,this.scoGPTIsRunning=!1}init(){this.scoGPTIsRunning=!1;this.aiPostExplanation=PAGE_CONFIG.ai_text?PAGE_CONFIG.ai_text+"":false;if(!this.aiPostExplanation){this.generate()}else{this.aiShowAnimation(Promise.resolve(this.aiPostExplanation))}this.AIEngine()}getTitleAndContent(){const e=document.getElementById("article-container"),t=document.title,n=e.getElementsByTagName("p"),i=e.querySelectorAll("h1, h2, h3, h4, h5");return(t+" "+Array.from(i).concat(Array.from(n)).map((e=>e.innerText.replace(/https?:\/\/[^\s]+/g,""))).join(" ")).slice(0,1e3)}async generate(){this.aiShowAnimation(this.fetch(document.title,this.getTitleAndContent(),this.config.key))}async fetch(e,t,n){const i=`${this.root}/?content=${encodeURIComponent(t)}&title=${e}&key=${encodeURIComponent(n)}&url=${encodeURIComponent(window.location.href)}`,s=await fetch(i),o=await s.json();return s.ok?(this.aiPostExplanation=o.summary,o.summary):(console.error("Request failed:",o.err_msg),o.err_msg)}aiShowAnimation(e,t=!1){const n=document.querySelector(".ai-explanation"),i=document.querySelector(".ai-tag");if(!n||this.scoGPTIsRunning)return;this.scoGPTIsRunning=!0,this.cleanSuggestions(),i.classList.add("loadingAI"),n.style.display="block",n.innerHTML='生成中...<span class="blinking-cursor"></span>';let s,o,a=!0,c=0,r=!0;const l=new IntersectionObserver((e=>{a=e[0].isIntersecting,a&&requestAnimationFrame(o)}),{threshold:0});e.then((e=>{s=performance.now(),o=()=>{if(c<e.length&&a){const r=performance.now(),g=r-s,h=e.slice(c,c+1),u=/[,。!、?,.!?]/.test(h),m=/[a-zA-Z0-9]/.test(h);g>=(u?100*Math.random()+100:m?10:25)&&(n.innerText=e.slice(0,c+1),s=r,c++,c<e.length?n.innerHTML=e.slice(0,c)+'<span class="blinking-cursor"></span>':(n.innerHTML=e,n.style.display="block",this.scoGPTIsRunning=!1,i.classList.remove("loadingAI"),l.disconnect(),t&&this.createSuggestions())),a&&requestAnimationFrame(o)}},a&&r&&setTimeout((()=>{requestAnimationFrame(o),r=!1}),3e3),l.observe(n)})).catch((e=>{console.error("检索信息失败:",e),n.innerHTML="检索信息失败",n.style.display="block",this.scoGPTIsRunning=!1,i.classList.remove("loadingAI"),l.disconnect()}))}AIEngine(){const e=document.querySelector(".ai-tag");e&&e.addEventListener("click",(()=>{this.scoGPTIsRunning||(this.aiTalkMode=!0,this.aiShowAnimation(Promise.resolve(this.config.talk),!0))}))}cleanSuggestions(){const e=document.querySelector(".ai-suggestions");e?e.innerHTML="":console.error("没有这个元素:'ai-suggestions'")}createSuggestions(){this.aiTalkMode&&(this.cleanSuggestions(),this.createSuggestionItemWithAction("这篇文章讲了什么?",(()=>{""===this.aiPostExplanation?this.generate():this.aiShowAnimation(Promise.resolve(this.aiPostExplanation),!0)})),this.config.randomPost&&this.createSuggestionItemWithAction("带我去看看其他文章",(()=>toRandomPost())),this.aiTalkMode=!0)}createSuggestionItemWithAction(e,t){const n=document.querySelector(".ai-suggestions");if(!n)return void console.error("无法找到具有class为ai-suggestions的元素");const i=document.createElement("div");i.classList.add("ai-suggestions-item"),i.textContent=e,i.addEventListener("click",t),n.appendChild(i)}}const efu_ai=new efuAI;
6
+ const _0x13613d=_0x413b;function _0x413b(_0x2b151b,_0x2765b5){const _0x2e2ac7=_0x2e2a();return _0x413b=function(_0x413be1,_0x2731a7){_0x413be1=_0x413be1-0x6a;let _0x48e6e4=_0x2e2ac7[_0x413be1];return _0x48e6e4;},_0x413b(_0x2b151b,_0x2765b5);}(function(_0x23c5ad,_0x1d8983){const _0x4a3867=_0x413b,_0x549d7e=_0x23c5ad();while(!![]){try{const _0x23e9f6=parseInt(_0x4a3867(0xa9))/0x1*(-parseInt(_0x4a3867(0x95))/0x2)+parseInt(_0x4a3867(0x7d))/0x3*(-parseInt(_0x4a3867(0x83))/0x4)+-parseInt(_0x4a3867(0xb2))/0x5*(parseInt(_0x4a3867(0xb7))/0x6)+-parseInt(_0x4a3867(0x77))/0x7*(-parseInt(_0x4a3867(0x72))/0x8)+parseInt(_0x4a3867(0x7e))/0x9+-parseInt(_0x4a3867(0xb8))/0xa+parseInt(_0x4a3867(0x9f))/0xb*(parseInt(_0x4a3867(0x6f))/0xc);if(_0x23e9f6===_0x1d8983)break;else _0x549d7e['push'](_0x549d7e['shift']());}catch(_0xf0b15c){_0x549d7e['push'](_0x549d7e['shift']());}}}(_0x2e2a,0x24be2));class efuAI{constructor(){const _0x5c45b1=_0x413b;this[_0x5c45b1(0x98)]=_0x5c45b1(0xb1),this[_0x5c45b1(0x84)]=!0x1,this[_0x5c45b1(0x7c)]='',this[_0x5c45b1(0x8a)]=GLOBAL_CONFIG[_0x5c45b1(0xb3)],this[_0x5c45b1(0x90)]=!0x1;}['init'](){const _0x185d66=_0x413b;this[_0x185d66(0x90)]=!0x1,this[_0x185d66(0x7c)]=PAGE_CONFIG[_0x185d66(0x87)]?PAGE_CONFIG[_0x185d66(0x87)]+'':![],!this['aiPostExplanation']?this[_0x185d66(0xa6)]():this[_0x185d66(0x76)](Promise[_0x185d66(0x78)](this[_0x185d66(0x7c)])),this['AIEngine']();}['getTitleAndContent'](){const _0x1c05d3=_0x413b,_0x497431=document['getElementById'](_0x1c05d3(0x6d)),_0x1134ec=document[_0x1c05d3(0xb4)],_0x30a3a2=_0x497431[_0x1c05d3(0xa3)]('p'),_0x2d35eb=_0x497431['querySelectorAll'](_0x1c05d3(0x80));return(_0x1134ec+'\x20'+Array[_0x1c05d3(0xa0)](_0x2d35eb)[_0x1c05d3(0x9d)](Array[_0x1c05d3(0xa0)](_0x30a3a2))[_0x1c05d3(0x74)](_0x25a656=>_0x25a656[_0x1c05d3(0x88)][_0x1c05d3(0x86)](/https?:\/\/[^\s]+/g,''))[_0x1c05d3(0xac)]('\x20'))[_0x1c05d3(0xb0)](0x0,0x3e8);}async[_0x13613d(0xa6)](){const _0x23a9bd=_0x13613d;this[_0x23a9bd(0x76)](this['fetch'](document[_0x23a9bd(0xb4)],this[_0x23a9bd(0x96)](),this['config'][_0x23a9bd(0xaf)]));}async[_0x13613d(0x8f)](_0x22e80e,_0x3dcc90,_0x24437c){const _0xaf00b3=_0x13613d,_0x565c45=this[_0xaf00b3(0x98)]+'/?content='+encodeURIComponent(_0x3dcc90)+_0xaf00b3(0x7a)+_0x22e80e+_0xaf00b3(0x75)+encodeURIComponent(_0x24437c)+_0xaf00b3(0x92)+encodeURIComponent(window[_0xaf00b3(0x9e)][_0xaf00b3(0xad)]),_0x460d6f=await fetch(_0x565c45),_0x1b4076=await _0x460d6f[_0xaf00b3(0xa4)]();return _0x460d6f['ok']?(this[_0xaf00b3(0x7c)]=_0x1b4076['summary'],_0x1b4076['summary']):(console[_0xaf00b3(0xa1)]('Request\x20failed:',_0x1b4076[_0xaf00b3(0xa8)]),_0x1b4076['err_msg']);}['aiShowAnimation'](_0xad4d41,_0x42d337=!0x1){const _0x59e5bb=_0x13613d,_0x3e9d86=document[_0x59e5bb(0x8e)](_0x59e5bb(0x70)),_0xd29cf1=document[_0x59e5bb(0x8e)](_0x59e5bb(0xb5));if(!_0x3e9d86||this[_0x59e5bb(0x90)])return;this[_0x59e5bb(0x90)]=!0x0,this[_0x59e5bb(0x8c)](),_0xd29cf1[_0x59e5bb(0x8b)][_0x59e5bb(0x9b)](_0x59e5bb(0x85)),_0x3e9d86[_0x59e5bb(0x93)][_0x59e5bb(0x9a)]='block',_0x3e9d86[_0x59e5bb(0x7b)]=_0x59e5bb(0x89),setTimeout(()=>{const _0x40cf66=_0x59e5bb;let _0x214250,_0x4a5de1,_0x4f6a34=!0x0,_0x238416=0x0,_0x1792a7=!0x0;const _0x24b6fe=new IntersectionObserver(_0x46a81a=>{const _0x30414d=_0x413b;_0x4f6a34=_0x46a81a[0x0][_0x30414d(0x6e)],_0x4f6a34&&requestAnimationFrame(_0x4a5de1);},{'threshold':0x0});_0xad4d41['then'](_0x12449a=>{const _0x4a1249=_0x413b;_0x214250=performance[_0x4a1249(0xa7)](),_0x4a5de1=()=>{const _0x12a8a9=_0x4a1249;if(_0x238416<_0x12449a[_0x12a8a9(0x73)]&&_0x4f6a34){const _0x27454f=performance[_0x12a8a9(0xa7)](),_0x2ece04=_0x27454f-_0x214250,_0x493a62=_0x12449a['slice'](_0x238416,_0x238416+0x1),_0x29dd3e=/[,。!、?,.!?]/[_0x12a8a9(0x91)](_0x493a62),_0x323f23=/[a-zA-Z0-9]/[_0x12a8a9(0x91)](_0x493a62);_0x2ece04>=(_0x29dd3e?0x64*Math['random']()+0x64:_0x323f23?0xa:0x19)&&(_0x3e9d86[_0x12a8a9(0x88)]=_0x12449a[_0x12a8a9(0xb0)](0x0,_0x238416+0x1),_0x214250=_0x27454f,_0x238416++,_0x238416<_0x12449a[_0x12a8a9(0x73)]?_0x3e9d86[_0x12a8a9(0x7b)]=_0x12449a[_0x12a8a9(0xb0)](0x0,_0x238416)+_0x12a8a9(0x79):(_0x3e9d86['innerHTML']=_0x12449a,_0x3e9d86['style'][_0x12a8a9(0x9a)]='block',this[_0x12a8a9(0x90)]=!0x1,_0xd29cf1[_0x12a8a9(0x8b)]['remove'](_0x12a8a9(0x85)),_0x24b6fe[_0x12a8a9(0x82)](),_0x42d337&&this[_0x12a8a9(0x6a)]())),_0x4f6a34&&requestAnimationFrame(_0x4a5de1);}},_0x4f6a34&&_0x1792a7&&setTimeout(()=>{requestAnimationFrame(_0x4a5de1),_0x1792a7=!0x1;},0xbb8),_0x24b6fe['observe'](_0x3e9d86);})[_0x40cf66(0xab)](_0x497c7f=>{const _0x16a888=_0x40cf66;console[_0x16a888(0xa1)](_0x16a888(0x6c),_0x497c7f),_0x3e9d86[_0x16a888(0x7b)]='检索信息失败',_0x3e9d86['style'][_0x16a888(0x9a)]=_0x16a888(0x97),this[_0x16a888(0x90)]=!0x1,_0xd29cf1[_0x16a888(0x8b)][_0x16a888(0xa5)](_0x16a888(0x85)),_0x24b6fe[_0x16a888(0x82)]();});},0xbb8);}[_0x13613d(0x71)](){const _0xa48776=_0x13613d,_0x294414=document[_0xa48776(0x8e)](_0xa48776(0xb5));_0x294414&&_0x294414['addEventListener'](_0xa48776(0xa2),()=>{const _0x5e3005=_0xa48776;this['scoGPTIsRunning']||(this[_0x5e3005(0x84)]=!0x0,this['aiShowAnimation'](Promise['resolve'](this['config'][_0x5e3005(0xae)]),!0x0));});}[_0x13613d(0x8c)](){const _0x4e5582=_0x13613d,_0x355d20=document[_0x4e5582(0x8e)](_0x4e5582(0xb6));_0x355d20?_0x355d20[_0x4e5582(0x7b)]='':console[_0x4e5582(0xa1)](_0x4e5582(0xaa));}['createSuggestions'](){const _0x1196c6=_0x13613d;this[_0x1196c6(0x84)]&&(this[_0x1196c6(0x8c)](),this[_0x1196c6(0x99)](_0x1196c6(0x81),()=>{const _0x2d4131=_0x1196c6;''===this[_0x2d4131(0x7c)]?this[_0x2d4131(0xa6)]():this[_0x2d4131(0x76)](Promise[_0x2d4131(0x78)](this[_0x2d4131(0x7c)]),!0x0);}),this[_0x1196c6(0x8a)][_0x1196c6(0xb9)]&&this['createSuggestionItemWithAction']('带我去看看其他文章',()=>toRandomPost()),this[_0x1196c6(0x84)]=!0x0);}['createSuggestionItemWithAction'](_0x411977,_0x1ee9c4){const _0x15cc5f=_0x13613d,_0x5e399f=document[_0x15cc5f(0x8e)](_0x15cc5f(0xb6));if(!_0x5e399f)return void console['error']('无法找到具有class为ai-suggestions的元素');const _0x504608=document[_0x15cc5f(0x6b)]('div');_0x504608['classList'][_0x15cc5f(0x9b)](_0x15cc5f(0x94)),_0x504608[_0x15cc5f(0x9c)]=_0x411977,_0x504608[_0x15cc5f(0x7f)](_0x15cc5f(0xa2),_0x1ee9c4),_0x5e399f[_0x15cc5f(0x8d)](_0x504608);}}function _0x2e2a(){const _0x17cf3e=['loadingAI','replace','ai_text','innerText','生成中...<span\x20class=\x22blinking-cursor\x22></span>','config','classList','cleanSuggestions','appendChild','querySelector','fetch','scoGPTIsRunning','test','&url=','style','ai-suggestions-item','6YFtYAZ','getTitleAndContent','block','root','createSuggestionItemWithAction','display','add','textContent','concat','location','11mBQjxP','from','error','click','getElementsByTagName','json','remove','generate','now','err_msg','95089WLUpyk','没有这个元素:\x27ai-suggestions\x27','catch','join','href','talk','key','slice','https://summary.tianli0.top','106175QRactq','post_ai','title','.ai-tag','.ai-suggestions','66dgrcvD','2694560CoUACr','randomPost','createSuggestions','createElement','检索信息失败:','article-container','isIntersecting','11202588AcRnYR','.ai-explanation','AIEngine','32wwjFQL','length','map','&key=','aiShowAnimation','238161ujxgZE','resolve','<span\x20class=\x22blinking-cursor\x22></span>','&title=','innerHTML','aiPostExplanation','28326zDzbwu','267111zRGBLY','addEventListener','h1,\x20h2,\x20h3,\x20h4,\x20h5','这篇文章讲了什么?','disconnect','68AXICSD','aiTalkMode'];_0x2e2a=function(){return _0x17cf3e;};return _0x2e2a();}const efu_ai=new efuAI();
@@ -0,0 +1,5 @@
1
+ /**
2
+ * EasyDanmaku v1.0.0
3
+ * author: Leonus
4
+ */
5
+ class EasyDanmaku{constructor(t){this.container=this.checkParams(t),this.pathname=t.page||null,this.wrapperStyle=t.wrapperStyle||null,this.line=t.line||10,this.speed=t.speed||5,this.runtime=t.runtime||10,this.colourful=t.colourful||!1,this.loop=t.loop||!1,this.hover=t.hover||!1,this.coefficient=t.coefficient||1.38,this.originIndex=0,this.originList=null,this.offsetValue=this.container.offsetHeight/this.line,this.vipIndex=0,this.overflowArr=[],this.clearIng=!1,this.cleartimer=null,this.init(),this.handleEvents(t)}handleEvents(t){this.onComplete=t.onComplete||null,this.onHover=t.onHover||null}init(){this.runstatus=1,this.aisle=[],this.container.style.overflow="hidden",this.hover&&this.handleMouseHover(),"relative"!==Utils.getStyle(this.container,"position")&&"fixed"!==Utils.getStyle(this.container,"position")&&(this.container.style.position="relative");for(let t=0;t<this.line;t++)this.aisle.push({normalRow:!0,vipRow:!0})}checkParams(t){if(!document.querySelector(t.el))throw`Could not find the ${t.el} element`;if(t.wrapperStyle&&"string"!=typeof t.wrapperStyle)throw"The type accepted by the wrapperStyle parameter is string";if(t.line&&"number"!=typeof t.line)throw"The type accepted by the line parameter is number";if(t.speed&&"number"!=typeof t.speed)throw"The type accepted by the speed parameter is number";if(t.colourful&&"boolean"!=typeof t.colourful)throw"The type accepted by the colourful parameter is boolean";if(t.runtime&&"number"!=typeof t.runtime)throw"The type accepted by the runtime parameter is number";if(t.loop&&"boolean"!=typeof t.loop)throw"The type accepted by the loop parameter is boolean";if(t.coefficient&&"number"!=typeof t.coefficient)throw"The type accepted by the coefficient parameter is number";if(t.hover&&"boolean"!=typeof t.hover)throw"The type accepted by the hover parameter is boolean";if(t.onComplete&&"function"!=typeof t.onComplete)throw"The type accepted by the onComplete parameter is function";if(t.onHover&&"function"!=typeof t.onHover)throw"The type accepted by the onHover parameter is function";return document.querySelector(t.el)}send(t,e=null,i=null){if(0==this.runstatus)return void this.overflowArr.push({content:t,normalClass:e});if(t.length<1)return;this.offsetValue=this.container.offsetHeight/this.line;let n=document.createElement("div"),r=0,s=this.speed,o=null,l=0;n.innerHTML=t,n.style.display="inline-block",n.classList.add("default-style"),(e||this.wrapperStyle)&&n.classList.add(e||this.wrapperStyle),function a(){if(r=Math.round(Math.random()*(this.line-1)),this.aisle[r].normalRow){this.aisle[r].normalRow=!1,this.container.appendChild(n),s+=n.offsetWidth/n.parentNode.offsetWidth*2,n.style.cssText=`\n text-align:center;\n min-width:130px;\n will-change: transform;\n position:absolute;\n right: -${n.offsetWidth+130}px;\n transition: transform ${s}s linear;\n transform: translateX(-${n.parentNode.offsetWidth+n.offsetWidth+130}px);\n top: ${r*this.offsetValue}px;\n line-height:${this.offsetValue}px;\n color:${this.colourful?"#"+("00000"+(16777216*Math.random()|0).toString(16)).substr(-6):void 0}\n `;let t=(n.parentNode.offsetWidth+n.offsetWidth)/s/60;o=setInterval((()=>{l+=t,l>n.offsetWidth*this.coefficient&&(this.aisle[r].normalRow=!0,clearInterval(o))}),16.66),setTimeout((()=>{1!=n.getAttribute("relieveDel")&&(i&&i({runtime:s,target:n,width:n.offsetWidth}),n.remove())}),1e3*s)}else{this.aisle.some((t=>!0===t.normalRow))?a.call(this):(()=>{this.overflowArr.push({content:t,normalClass:e}),this.clearIng||this.clearOverflowDanmakuArray()})()}}.call(this)}batchSend(t,e=!1,i=null){let n=this.runtime||1.23*t.length;this.originList=t,this.hasAvatar=e,this.normalClass=i;let r=setInterval((()=>{location.pathname!=this.pathname&&clearInterval(r),this.originIndex>t.length-1?(clearInterval(r),this.originIndex=0,this.onComplete&&this.onComplete(),this.loop&&this.batchSend(this.originList,e,i)):(e?this.send(`${t[this.originIndex].url?'<a href="'+t[this.originIndex].url+'">':""}<img src=${t[this.originIndex].avatar}>\n <p>${t[this.originIndex].content}</p>${t[this.originIndex].url?"</a>":""}\n `,i||this.wrapperStyle):this.send(t[this.originIndex],i||this.wrapperStyle),this.originIndex++)}),n/t.length*1e3)}centeredSend(t,e,i=3e3,n=null){let r=document.createElement("div"),s=0;r.innerHTML=t,(e||this.wrapperStyle)&&r.classList.add(e||this.wrapperStyle),function t(){if(this.aisle[s].vipRow)this.container.appendChild(r),r.style.cssText=`\n position:absolute;\n left:50%;\n transform:translateX(-50%);\n top: ${s*this.offsetValue}px;\n `,this.aisle[s].vipRow=!1,setTimeout((()=>{n&&n({duration:i,target:r,width:r.offsetWidth}),r.remove(),this.aisle[s].vipRow=!0}),i);else{if(s++,s>this.line-1)return;t.call(this)}}.call(this)}play(){const t=this.container.children;for(let e=0;e<t.length;e++)this.controlDanmakurunStatus(t[e],1);this.runstatus=1,0!==this.overflowArr.length&&this.clearOverflowDanmakuArray()}pause(){const t=this.container.children;for(let e=0;e<t.length;e++)this.controlDanmakurunStatus(t[e],0);this.runstatus=0}controlDanmakurunStatus(t,e){const i=0,n=/-(\S*),/;if(e===1){clearTimeout(t.timer);const e=Utils.getStyle(t,"transform").match(n)[1];t.style.transition=`transform ${this.speed}s linear`,t.style.transform=`translateX(-${t.parentNode.offsetWidth+parseInt(e)+t.offsetWidth+130}px)`,t.timer=setTimeout((()=>{t.remove()}),1e3*this.speed)}else if(e===i){clearTimeout(t.timer);const e=Utils.getStyle(t,"transform").match(n)[1];t.style.transition="transform 0s linear",t.style.transform=`translateX(-${e}px)`,t.setAttribute("relieveDel",1)}}handleMouseHover(){Utils.eventDelegation(this.container,"default-style","mouseover",(t=>{t.style["z-index"]=1e3,this.controlDanmakurunStatus(t,0),this.onHover&&this.onHover(t)})),Utils.eventDelegation(this.container,"default-style","mouseout",(t=>{t.style.zIndex=1,1==this.runstatus&&this.controlDanmakurunStatus(t,1)}))}clearOverflowDanmakuArray(){clearInterval(this.cleartimer),this.clearIng=!0;let t=0;this.cleartimer=setInterval((()=>{0===this.overflowArr.length?(t++,t>20&&(clearInterval(this.cleartimer),this.clearIng=!1)):(this.send(this.overflowArr[0].content,this.overflowArr[0].normalClass||this.wrapperStyle),this.overflowArr.shift())}),500)}}class Utils{static getStyle(t,e){return window.getComputedStyle(t,null)[e]}static eventDelegation(t,e,i,n){t.addEventListener(i,(t=>{try{t.target.className.includes(e)?n(t.target):t.target.parentNode.className.includes(e)&&n(t.target.parentNode)}catch(t){}}))}}
@@ -1,5 +1,5 @@
1
1
  /**
2
+ * @name: Universe
2
3
  * author: Leonus
3
- * email: 990320751@qq.com
4
4
  */
5
5
  function dark(){window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;var t,i,e,s,n=.05,h=document.getElementById("universe"),a=!0,o="226,225,224",r=[];function d(){t=window.innerWidth,i=window.innerHeight,e=.216*t,h.setAttribute("width",t),h.setAttribute("height",i)}function c(){s.clearRect(0,0,t,i);for(var e=r.length,n=0;n<e;n++){var h=r[n];h.move(),h.fadeIn(),h.fadeOut(),h.draw()}}function f(){this.reset=function(){this.giant=u(3),this.comet=!this.giant&&!a&&u(10),this.x=m(0,t-10),this.y=m(0,i),this.r=m(1.1,2.6),this.dx=m(n,6*n)+(this.comet+1-1)*n*m(50,120)+.1,this.dy=-m(n,6*n)-(this.comet+1-1)*n*m(50,120),this.fadingOut=null,this.fadingIn=!0,this.opacity=0,this.opacityTresh=m(.2,1-.4*(this.comet+1-1)),this.do=m(5e-4,.002)+.001*(this.comet+1-1)},this.fadeIn=function(){this.fadingIn&&(this.fadingIn=!(this.opacity>this.opacityTresh),this.opacity+=this.do)},this.fadeOut=function(){this.fadingOut&&(this.fadingOut=!(this.opacity<0),this.opacity-=this.do/2,(this.x>t||this.y<0)&&(this.fadingOut=!1,this.reset()))},this.draw=function(){if(s.beginPath(),this.giant)s.fillStyle="rgba(180,184,240,"+this.opacity+")",s.arc(this.x,this.y,2,0,2*Math.PI,!1);else if(this.comet){s.fillStyle="rgba("+o+","+this.opacity+")",s.arc(this.x,this.y,1.5,0,2*Math.PI,!1);for(var t=0;t<30;t++)s.fillStyle="rgba("+o+","+(this.opacity-this.opacity/20*t)+")",s.rect(this.x-this.dx/4*t,this.y-this.dy/4*t-2,2,2),s.fill()}else s.fillStyle="rgba(226,225,142,"+this.opacity+")",s.rect(this.x,this.y,this.r,this.r);s.closePath(),s.fill()},this.move=function(){this.x+=this.dx,this.y+=this.dy,!1===this.fadingOut&&this.reset(),(this.x>t-t/4||this.y<0)&&(this.fadingOut=!0)},setTimeout((function(){a=!1}),50)}function u(t){return Math.floor(1e3*Math.random())+1<10*t}function m(t,i){return Math.random()*(i-t)+t}d(),window.addEventListener("resize",d,!1),function(){s=h.getContext("2d");for(var t=0;t<e;t++)r[t]=new f,r[t].reset();c()}(),function t(){"dark"==document.getElementsByTagName("html")[0].getAttribute("data-theme")&&c(),window.requestAnimationFrame(t)}()}
@@ -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
- }