hexo-theme-solitude 1.1.3 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -19
- package/_config.yml +243 -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} +59 -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 +16 -0
- package/layout/includes/widgets/third-party/search/index.pug +7 -0
- package/layout/includes/widgets/third-party/search/local-search.pug +15 -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 +944 -0
- package/source/css/_page/category.styl +141 -0
- package/source/css/_page/equipment.styl +108 -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 +22 -0
- package/source/css/_page/link.styl +433 -0
- package/source/css/_page/moment.styl +186 -0
- package/source/css/_page/rss.styl +87 -0
- package/source/css/_page/says.styl +353 -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 +206 -0
- package/source/css/_search/local-search.styl +112 -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 +104 -111
- package/source/js/extend/search/local-search.js +7 -7
- package/source/js/main.js +655 -505
- package/source/js/utils.js +131 -137
- 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
@@ -0,0 +1,90 @@
|
|
1
|
+
#aside-content
|
2
|
+
.card-power
|
3
|
+
.power-charge
|
4
|
+
margin-left auto
|
5
|
+
color var(--sco-secondtext)
|
6
|
+
font-size 14px
|
7
|
+
line-height 1
|
8
|
+
|
9
|
+
&:hover
|
10
|
+
color var(--sco-lighttext)
|
11
|
+
|
12
|
+
#power-star
|
13
|
+
display flex
|
14
|
+
padding 8px
|
15
|
+
border var(--style-border-always)
|
16
|
+
border-radius 8px
|
17
|
+
flex-direction row
|
18
|
+
flex-wrap nowrap
|
19
|
+
justify-content flex-start
|
20
|
+
position relative
|
21
|
+
margin 12px 0
|
22
|
+
background var(--sco-secondbg)
|
23
|
+
transition .3s ease-out
|
24
|
+
cursor pointer
|
25
|
+
|
26
|
+
&:hover
|
27
|
+
background var(--sco-main)
|
28
|
+
color var(--sco-white)
|
29
|
+
box-shadow var(--sco-shadow-theme)
|
30
|
+
|
31
|
+
#power-star-image
|
32
|
+
transform scale(.9)
|
33
|
+
|
34
|
+
#power-star-image
|
35
|
+
width 60px
|
36
|
+
height 60px
|
37
|
+
border-radius 60px
|
38
|
+
background-size cover
|
39
|
+
margin-right 12px
|
40
|
+
border var(--style-border-always)
|
41
|
+
transition .3s ease-out
|
42
|
+
|
43
|
+
#power-star-title
|
44
|
+
overflow hidden
|
45
|
+
text-overflow ellipsis
|
46
|
+
white-space nowrap
|
47
|
+
font-size 16px
|
48
|
+
font-weight 700
|
49
|
+
line-height 1
|
50
|
+
margin-bottom 8px
|
51
|
+
|
52
|
+
#power-star-desc
|
53
|
+
display -webkit-box
|
54
|
+
-webkit-box-orient vertical
|
55
|
+
-webkit-line-clamp 2
|
56
|
+
overflow hidden
|
57
|
+
font-size 12px
|
58
|
+
max-width 100%
|
59
|
+
line-height 1.2
|
60
|
+
|
61
|
+
.power-star-body
|
62
|
+
display flex
|
63
|
+
flex-direction column
|
64
|
+
align-items flex-start
|
65
|
+
flex-wrap wrap
|
66
|
+
position relative
|
67
|
+
width calc(100% - 68px)
|
68
|
+
justify-content center
|
69
|
+
|
70
|
+
.power-list
|
71
|
+
display flex
|
72
|
+
flex-direction row
|
73
|
+
flex-wrap wrap
|
74
|
+
margin 0 -4px
|
75
|
+
|
76
|
+
.power-item-body
|
77
|
+
display flex
|
78
|
+
flex-direction row
|
79
|
+
flex-wrap wrap
|
80
|
+
|
81
|
+
.power-item
|
82
|
+
.power-item-link
|
83
|
+
a
|
84
|
+
padding 2px 4px
|
85
|
+
border-radius 4px
|
86
|
+
margin-left 8px
|
87
|
+
|
88
|
+
&:hover
|
89
|
+
background var(--sco-main)
|
90
|
+
color var(--sco-white)
|
@@ -0,0 +1,85 @@
|
|
1
|
+
#aside-content
|
2
|
+
.card-toc
|
3
|
+
padding .5rem .5rem !important
|
4
|
+
|
5
|
+
&:hover
|
6
|
+
box-shadow var(--sco-shadow-border)
|
7
|
+
|
8
|
+
+minWidth900()
|
9
|
+
right 0 !important
|
10
|
+
|
11
|
+
.toc-content
|
12
|
+
overflow-y auto
|
13
|
+
max-height calc(100vh - 300px)
|
14
|
+
|
15
|
+
&::before
|
16
|
+
position absolute
|
17
|
+
top .6rem
|
18
|
+
right 1.2rem
|
19
|
+
color #a9a9a9
|
20
|
+
content attr(progress-percentage)
|
21
|
+
font-style italic
|
22
|
+
font-size 1.2rem
|
23
|
+
|
24
|
+
.toc-link.active
|
25
|
+
border-left-color #0061cc
|
26
|
+
background #0079ff
|
27
|
+
color #fff
|
28
|
+
|
29
|
+
#card-toc
|
30
|
+
+minWidth901()
|
31
|
+
right 0 !important
|
32
|
+
|
33
|
+
.toc-content
|
34
|
+
overflow-y: auto
|
35
|
+
max-height: calc(100vh - 300px)
|
36
|
+
ol
|
37
|
+
margin 0
|
38
|
+
padding 0
|
39
|
+
|
40
|
+
&ul
|
41
|
+
list-style: none
|
42
|
+
|
43
|
+
&:hover
|
44
|
+
.toc-content
|
45
|
+
.toc-link:not(.active) span
|
46
|
+
filter: blur(0)
|
47
|
+
opacity: 1
|
48
|
+
|
49
|
+
.toc-item.active .toc-link
|
50
|
+
opacity 1
|
51
|
+
border-radius 8px
|
52
|
+
|
53
|
+
.toc-link
|
54
|
+
line-height 24px
|
55
|
+
padding 8px
|
56
|
+
border-left 0 solid transparent
|
57
|
+
border-radius 12px
|
58
|
+
color var(--sco-secondtext)
|
59
|
+
cursor default
|
60
|
+
min-height 40px
|
61
|
+
display flex
|
62
|
+
align-items center
|
63
|
+
transition all .2s ease-in-out 0s
|
64
|
+
|
65
|
+
&.active
|
66
|
+
border-radius 12px
|
67
|
+
border-left-color var(--sco-hovertext)
|
68
|
+
background-color var(--sco-card-bg)
|
69
|
+
color var(--sco-lighttext)
|
70
|
+
font-weight 700
|
71
|
+
font-size 20px
|
72
|
+
|
73
|
+
&:not(.active) span
|
74
|
+
opacity .6
|
75
|
+
cursor pointer
|
76
|
+
filter blur(1px)
|
77
|
+
transition .3s
|
78
|
+
|
79
|
+
&:hover
|
80
|
+
color var(--sco-lighttext)
|
81
|
+
|
82
|
+
[data-theme=dark]
|
83
|
+
.toc
|
84
|
+
.toc-item.active .toc-link .toc-text
|
85
|
+
color: var(--sco-white)
|
@@ -0,0 +1,40 @@
|
|
1
|
+
@charset "UTF-8"
|
2
|
+
|
3
|
+
if hexo-config('css_prefix')
|
4
|
+
@import 'nib'
|
5
|
+
|
6
|
+
// project
|
7
|
+
@import '_global/animation.css'
|
8
|
+
@import '_global/*'
|
9
|
+
@import '_layout/*'
|
10
|
+
@import '_page/index.styl'
|
11
|
+
@import '_post/*'
|
12
|
+
|
13
|
+
// widgets
|
14
|
+
@import '_widgets/index.styl'
|
15
|
+
|
16
|
+
// comment
|
17
|
+
if hexo-config('comment.enable')
|
18
|
+
@import '_comment/index.styl'
|
19
|
+
@import '_comment/twikoo.styl' when hexo-config('comment.type') == 'twikoo'
|
20
|
+
|
21
|
+
// commentBarrage
|
22
|
+
if hexo-config('thirdparty.comment.enable')
|
23
|
+
@import '_post/commentBarrage.styl'
|
24
|
+
|
25
|
+
// extra
|
26
|
+
@import '_extra/console.styl'
|
27
|
+
|
28
|
+
// rightmenu
|
29
|
+
if hexo-config('rightside.enable')
|
30
|
+
@import '_extra/rightmenu.styl'
|
31
|
+
|
32
|
+
// search
|
33
|
+
if hexo-config('thirdparty.search.enable')
|
34
|
+
if hexo-config('thirdparty.search.type') == 'algolia'
|
35
|
+
@import '_search/algolia-search'
|
36
|
+
else if hexo-config('thirdparty.search.type') == 'local'
|
37
|
+
@import '_search/local-search'
|
38
|
+
|
39
|
+
// dark
|
40
|
+
@import '_mode/*'
|
@@ -3,12 +3,13 @@ function initializeCommentBarrage() {
|
|
3
3
|
let e = {
|
4
4
|
maxBarrage: 1,
|
5
5
|
barrageTime: 8e3,
|
6
|
-
twikooUrl:
|
6
|
+
twikooUrl: GLOBAL_CONFIG.comment.twikoo.url,
|
7
7
|
pageUrl: window.location.pathname,
|
8
|
-
accessToken:
|
8
|
+
accessToken: GLOBAL_CONFIG.comment.twikoo.accessToken,
|
9
9
|
};
|
10
10
|
new class {
|
11
11
|
commentInterval = null
|
12
|
+
|
12
13
|
constructor(e) {
|
13
14
|
this.config = {
|
14
15
|
...e,
|
@@ -106,11 +107,11 @@ function initializeCommentBarrage() {
|
|
106
107
|
async initCommentBarrage() {
|
107
108
|
if (localStorage.getItem("commentBarrageSwitch") != null) {
|
108
109
|
document.querySelector(".comment-barrage").style.display = "flex";
|
109
|
-
document.querySelector(".menu-commentBarrage-text").textContent = "关闭热评";
|
110
|
+
GLOBAL_CONFIG.rightside.enable && (document.querySelector(".menu-commentBarrage-text").textContent = "关闭热评");
|
110
111
|
document.querySelector("#consoleCommentBarrage").classList.add("on");
|
111
112
|
} else {
|
112
113
|
document.querySelector(".comment-barrage").style.display = "none";
|
113
|
-
document.querySelector(".menu-commentBarrage-text").textContent = "显示热评";
|
114
|
+
GLOBAL_CONFIG.rightside.enable && (document.querySelector(".menu-commentBarrage-text").textContent = "显示热评");
|
114
115
|
document.querySelector("#consoleCommentBarrage").classList.remove("on");
|
115
116
|
}
|
116
117
|
const comments = await this.fetchComments();
|
@@ -154,4 +155,6 @@ function initializeCommentBarrage() {
|
|
154
155
|
(e)
|
155
156
|
}
|
156
157
|
|
157
|
-
|
158
|
+
if(PAGE_CONFIG.comment){
|
159
|
+
initializeCommentBarrage();
|
160
|
+
}
|
@@ -1,77 +1,76 @@
|
|
1
1
|
const changeContent = (content) => {
|
2
2
|
if (content === '') return content
|
3
|
-
|
3
|
+
|
4
4
|
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>|<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>|<pre><code>.*?<\/pre>|<[^>]+>/g, (match, img, link, code) => {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
if (img) return '[图片]';
|
6
|
+
if (link) return '[链接]';
|
7
|
+
if (code) return '[代码]';
|
8
|
+
return '';
|
9
9
|
})
|
10
|
-
|
10
|
+
|
11
11
|
if (content.length > 150) {
|
12
|
-
|
12
|
+
content = content.substring(0, 150) + '...'
|
13
13
|
}
|
14
14
|
return content
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
}
|
16
|
+
|
17
|
+
const getComment = () => {
|
18
18
|
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
19
|
-
|
19
|
+
|
20
20
|
const runTwikoo = () => {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
21
|
+
twikoo.getRecentComments({
|
22
|
+
envId: GLOBAL_CONFIG.comment.twikoo.url,
|
23
|
+
region: '',
|
24
|
+
pageSize: 6,
|
25
|
+
includeReply: true
|
26
|
+
}).then(function (res) {
|
27
|
+
const twikooArray = res.map(e => ({
|
28
|
+
'content': changeContent(e.comment),
|
29
|
+
'avatar': e.avatar,
|
30
|
+
'nick': e.nick,
|
31
|
+
'url': `${e.url}#${e.id}`,
|
32
|
+
'date': new Date(e.created).toISOString()
|
33
|
+
}))
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
if (window.location.pathname === "/links/" || window.location.pathname === "/links") {
|
36
|
+
let submit = document.getElementsByClassName('tk-submit ')
|
37
|
+
let text = document.getElementsByClassName("el-textarea__inner");
|
38
|
+
text[0].value += `昵称(请勿包含博客等字样):
|
39
39
|
网站地址(要求博客地址,请勿提交个人主页):
|
40
40
|
头像图片url(请提供尽可能清晰的图片,我会上传到我的图床):
|
41
41
|
描述:`;
|
42
|
-
|
43
|
-
|
42
|
+
text[0].style.height = "142px"
|
43
|
+
submit.item(0).style.display = "none";
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
window.checkForm = function () {
|
46
|
+
const checkboxes = document.querySelectorAll('input[onclick="checkForm()"]');
|
47
|
+
let allChecked = true;
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
checkboxes.forEach(checkbox => {
|
50
|
+
if (!checkbox.checked) {
|
51
|
+
allChecked = false;
|
52
|
+
}
|
53
|
+
});
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
if (allChecked) {
|
56
|
+
submit.item(0).style.display = "block";
|
57
|
+
} else {
|
58
|
+
submit.item(0).style.display = "none";
|
59
|
+
}
|
60
|
+
}
|
59
61
|
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
$dom.innerHTML= "无法获取评论,请确认相关配置是否正确"
|
66
|
-
})
|
62
|
+
|
63
|
+
generateHtml(twikooArray)
|
64
|
+
}).catch(function (err) {
|
65
|
+
$dom.innerHTML = "无法获取评论,请确认相关配置是否正确"
|
66
|
+
})
|
67
67
|
}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
runTwikoo()
|
69
|
+
}
|
70
|
+
|
71
|
+
const generateHtml = array => {
|
72
72
|
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
73
|
-
|
74
|
-
let result = array.length ? array.map(item => `
|
73
|
+
$dom.innerHTML = array.length ? array.map(item => `
|
75
74
|
<div class='aside-list-item'>
|
76
75
|
<a href='${item.url}' class='thumbnail'>
|
77
76
|
<img src='${item.avatar}' alt='${item.nick}'>
|
@@ -83,17 +82,15 @@ const changeContent = (content) => {
|
|
83
82
|
</div>
|
84
83
|
</div>
|
85
84
|
`).join('') : '没有评论'
|
86
|
-
|
87
|
-
$dom.innerHTML = result
|
88
85
|
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
89
86
|
window.pjax && window.pjax.refresh($dom)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
87
|
+
changeTimeFormat()
|
88
|
+
}
|
89
|
+
|
90
|
+
const newestCommentInit = () => {
|
94
91
|
const $asideList = document.querySelector('#card-newest-comments .aside-list')
|
95
92
|
if ($asideList) {
|
96
|
-
|
93
|
+
getComment()
|
97
94
|
}
|
98
|
-
|
95
|
+
}
|
99
96
|
|
@@ -144,7 +144,7 @@ function initThemeColor() {
|
|
144
144
|
let themeColor;
|
145
145
|
if (currentTop > 0) {
|
146
146
|
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--sco-card-bg');
|
147
|
-
} else if (
|
147
|
+
} else if (PAGE_CONFIG.is_post) {
|
148
148
|
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--sco-main');
|
149
149
|
} else {
|
150
150
|
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--sco-background');
|