hexo-theme-solitude 2.1.7 → 2.1.9
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/.github/screenshot.avif +0 -0
- package/CONTRIBUTING.md +1 -1
- package/LICENSE +1 -1
- package/README.md +19 -30
- package/README_en-US.md +26 -37
- package/README_zh-Hant.md +27 -36
- package/SECURITY.md +1 -1
- package/_config.yml +2 -2
- package/layout/includes/inject/body.pug +1 -1
- package/layout/includes/page/default.pug +1 -1
- package/layout/includes/page/links.pug +1 -1
- package/layout/includes/page/tlink.pug +1 -1
- package/layout/includes/widgets/page/about/hobbies.pug +18 -17
- package/layout/includes/widgets/page/about/tenyear.pug +24 -25
- package/layout/includes/widgets/page/links/linksCard.pug +5 -2
- package/layout/includes/widgets/page/message/content.pug +1 -1
- package/layout/post.pug +1 -1
- package/package.json +1 -1
- package/plugins.yml +10 -10
- package/scripts/event/welcome.js +11 -7
- package/scripts/filter/randomPosts.js +14 -3
- package/scripts/tags/article.js +53 -15
- package/scripts/tags/tabs.js +26 -17
- package/source/css/_comments/comment.styl +4 -3
- package/source/css/_comments/twikoo.styl +4 -5
- package/source/css/_global/animation.styl +0 -15
- package/source/css/_global/index.styl +19 -19
- package/source/css/_highlight/prismjs/index.styl +1 -1
- package/source/css/_highlight/prismjs/line-number.styl +1 -1
- package/source/css/_layout/article-container.styl +3 -3
- package/source/css/_layout/console.styl +1 -0
- package/source/css/_page/_about/about.styl +1 -1
- package/source/css/_page/_about/game.styl +2 -17
- package/source/css/_page/error.styl +2 -3
- package/source/css/_page/links.styl +2 -2
- package/source/css/_page/music.styl +1 -0
- package/source/css/_page/other.styl +1 -0
- package/source/css/_page/says.styl +4 -3
- package/source/css/_tags/gallery.styl +1 -1
- package/source/css/_tags/tabs.styl +2 -2
- package/source/js/covercolor/local.js +9 -1
- package/source/js/main.js +30 -17
- package/source/js/music.js +8 -3
- package/source/js/right_menu.js +11 -7
- package/source/js/third_party/post_ai.min.js +1 -1
- package/source/js/tw_cn.js +2 -2
@@ -1,5 +1,16 @@
|
|
1
1
|
hexo.extend.filter.register('after_render:html', function (data) {
|
2
|
-
const posts = hexo.locals.get('posts')
|
3
|
-
|
4
|
-
|
2
|
+
const posts = hexo.locals.get('posts')
|
3
|
+
.filter(post => post.random !== false)
|
4
|
+
.map(post => post.path);
|
5
|
+
|
6
|
+
const scriptContent = `
|
7
|
+
<script>
|
8
|
+
const posts = ${JSON.stringify(posts)};
|
9
|
+
function toRandomPost() {
|
10
|
+
const randomPost = posts[Math.floor(Math.random() * posts.length)];
|
11
|
+
pjax.loadUrl(GLOBAL_CONFIG.root + randomPost);
|
12
|
+
}
|
13
|
+
</script>`;
|
14
|
+
|
15
|
+
return data + scriptContent;
|
5
16
|
});
|
package/scripts/tags/article.js
CHANGED
@@ -1,18 +1,56 @@
|
|
1
|
-
'use strict'
|
1
|
+
'use strict';
|
2
2
|
|
3
3
|
const article = ([path]) => {
|
4
4
|
const post = hexo.locals.get("posts").data.find(post => post.path === path);
|
5
|
-
if (!post)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
if (!post) return '';
|
6
|
+
|
7
|
+
const createTagLinks = tags => tags.map(tag =>
|
8
|
+
`<a class="article-meta__tags fancybox" href="${tag.path}" onclick="event.stopPropagation();">
|
9
|
+
<span class="tags-punctuation">
|
10
|
+
<i class="solitude fa-solid fa-hashtag"></i>${tag.name}
|
11
|
+
</span>
|
12
|
+
</a>`
|
13
|
+
).join('');
|
14
|
+
|
15
|
+
const createCategory = categories => categories.length > 0
|
16
|
+
? `<span class="article-meta sticky-warp">
|
17
|
+
<span class="original">${categories[0].name}</span>
|
18
|
+
</span>`
|
19
|
+
: '';
|
20
|
+
|
21
|
+
const createPostCover = post =>
|
22
|
+
`<div class="post_cover">
|
23
|
+
<a href="/${post.path}" class="fancybox" title="${post.title}">
|
24
|
+
<img class="post_bg" src="${post.cover}" alt="${post.title}">
|
25
|
+
</a>
|
26
|
+
</div>`;
|
27
|
+
|
28
|
+
const createRecentPostInfoTop = (category, post) =>
|
29
|
+
`<div class="recent-post-info-top">
|
30
|
+
<div class="recent-post-info-top-tips">${category}</div>
|
31
|
+
<a class="article-title fancybox" href="/${post.path}" title="${post.title}">${post.title}</a>
|
32
|
+
</div>`;
|
33
|
+
|
34
|
+
const createContent = description =>
|
35
|
+
`<div class="content">${description || ''}</div>`;
|
36
|
+
|
37
|
+
const createArticleMetaWrap = (tags, date) =>
|
38
|
+
`<div class="article-meta-wrap">
|
39
|
+
<span class="article-meta tags">${tags}</span>
|
40
|
+
<span class="post-meta-date">
|
41
|
+
<time datetime="${date}" style="display: inline;"></time>
|
42
|
+
</span>
|
43
|
+
</div>`;
|
44
|
+
|
45
|
+
const tags = createTagLinks(post.tags);
|
46
|
+
const category = createCategory(post.categories.data);
|
47
|
+
const postCover = createPostCover(post);
|
48
|
+
const recentPostInfoTop = createRecentPostInfoTop(category, post);
|
49
|
+
const content = createContent(post.description);
|
50
|
+
const articleMetaWrap = createArticleMetaWrap(tags, post.date);
|
51
|
+
const recentPostInfo = `<div class="recent-post-info">${recentPostInfoTop + content + articleMetaWrap}</div>`;
|
52
|
+
|
53
|
+
return `<div class="recent-post-item" onclick="pjax.loadUrl('/${post.path}')">${postCover + recentPostInfo}</div>`;
|
54
|
+
};
|
55
|
+
|
56
|
+
hexo.extend.tag.register('article', article);
|
package/scripts/tags/tabs.js
CHANGED
@@ -11,23 +11,32 @@ function postTabs([name, active], content) {
|
|
11
11
|
|
12
12
|
active = Number(active) || 0;
|
13
13
|
|
14
|
-
const
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
14
|
+
const generateTabItems = (matches, name, active) => {
|
15
|
+
return matches.map((match, tabId) => {
|
16
|
+
const [tabCaption = '', tabIcon = ''] = match[1].split('@');
|
17
|
+
const postContent = hexo.render.renderSync({ text: match[2], engine: 'markdown' }).trim();
|
18
|
+
const tabHref = `${name.toLowerCase().replace(/\s+/g, '-')}-${tabId}`;
|
19
|
+
|
20
|
+
const iconHtml = tabIcon ? `<i class="${tabIcon.trim()} tab solitude"></i>` : '';
|
21
|
+
const isActive = active === tabId ? ' active' : '';
|
22
|
+
const toTopButton = '<button type="button" class="tab-to-top" aria-label="scroll to top"><i class="solitude fas fa-arrow-up"></i></button>';
|
23
|
+
|
24
|
+
return {
|
25
|
+
nav: `<li class="tab${isActive}"><button type="button" data-href="#${tabHref}">${iconHtml}${tabCaption.trim() || `${name} ${tabId}`}</button></li>`,
|
26
|
+
content: `<div class="tab-item-content${isActive}" id="${tabHref}">${postContent}${toTopButton}</div>`
|
27
|
+
};
|
28
|
+
});
|
29
|
+
};
|
30
|
+
|
31
|
+
const tabItems = generateTabItems(matches, name, active);
|
32
|
+
|
33
|
+
const createTabStructure = (tabItems) => {
|
34
|
+
const tabNav = `<ul class="nav-tabs">${tabItems.map(item => item.nav).join('')}</ul>`;
|
35
|
+
const tabContent = `<div class="tab-contents">${tabItems.map(item => item.content).join('')}</div>`;
|
36
|
+
return { tabNav, tabContent };
|
37
|
+
};
|
38
|
+
|
39
|
+
const { tabNav, tabContent } = createTabStructure(tabItems);
|
31
40
|
|
32
41
|
return `<div class="tabs" id="${name.toLowerCase().replace(/\s+/g, '-')}">${tabNav}${tabContent}</div>`;
|
33
42
|
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
.comment-headline
|
4
4
|
display inline-block
|
5
5
|
vertical-align middle
|
6
|
-
font-weight
|
6
|
+
font-weight bold
|
7
7
|
font-size 20px
|
8
8
|
|
9
9
|
#comment-switch
|
@@ -31,7 +31,7 @@
|
|
31
31
|
background-color #307af6
|
32
32
|
vertical-align middle
|
33
33
|
cursor pointer
|
34
|
-
transition all .4s ease
|
34
|
+
transition all .4s ease
|
35
35
|
|
36
36
|
&::before
|
37
37
|
position absolute
|
@@ -42,7 +42,7 @@
|
|
42
42
|
border-radius 50%
|
43
43
|
background-color #fff
|
44
44
|
content ""
|
45
|
-
transition all .4s ease
|
45
|
+
transition all .4s ease
|
46
46
|
|
47
47
|
&.move
|
48
48
|
background-color #ff7242
|
@@ -77,6 +77,7 @@
|
|
77
77
|
font-size .6rem
|
78
78
|
color var(--efu-secondtext)
|
79
79
|
border-radius 8px
|
80
|
+
|
80
81
|
if hexo-config('comment.use')[1] || ',' in hexo-config('comment.use')
|
81
82
|
&.move
|
82
83
|
if hexo-config('comment.count')
|
@@ -36,7 +36,7 @@
|
|
36
36
|
color var(--efu-lighttext) !important
|
37
37
|
cursor pointer
|
38
38
|
user-select none
|
39
|
-
padding 0 12px
|
39
|
+
padding 0 12px
|
40
40
|
transition all .3s
|
41
41
|
border-radius 8px
|
42
42
|
background-color var(--efu-secondbg)
|
@@ -49,7 +49,6 @@
|
|
49
49
|
.tk-action-icon svg
|
50
50
|
fill var(--efu-card-bg) !important
|
51
51
|
|
52
|
-
|
53
52
|
.tk-action-icon
|
54
53
|
svg
|
55
54
|
transition all .3s
|
@@ -187,7 +186,7 @@
|
|
187
186
|
.tk-content
|
188
187
|
.tk-owo-emotion
|
189
188
|
width 3em
|
190
|
-
margin 0 2px
|
189
|
+
margin 0 2px
|
191
190
|
|
192
191
|
.tk-owo-emotion,
|
193
192
|
.twikoo
|
@@ -302,7 +301,7 @@
|
|
302
301
|
color var(--efu-secondtext)
|
303
302
|
|
304
303
|
.tk-content
|
305
|
-
margin-top 0!important
|
304
|
+
margin-top 0 !important
|
306
305
|
|
307
306
|
.tk-meta-input
|
308
307
|
.el-input
|
@@ -356,7 +355,7 @@ img.tk-avatar-img
|
|
356
355
|
font-weight 700
|
357
356
|
|
358
357
|
.el-input__inner
|
359
|
-
background-color
|
358
|
+
background-color var(--efu-secondbg) !important
|
360
359
|
border 0 !important
|
361
360
|
color var(--efu-fontcolor) !important
|
362
361
|
padding-left 8px
|
@@ -21,7 +21,6 @@
|
|
21
21
|
50%
|
22
22
|
top -16px
|
23
23
|
opacity 1
|
24
|
-
filter none
|
25
24
|
100%
|
26
25
|
top 0
|
27
26
|
opacity .4
|
@@ -32,7 +31,6 @@
|
|
32
31
|
transform translateY(-50px)
|
33
32
|
100%
|
34
33
|
opacity 1
|
35
|
-
filter none
|
36
34
|
transform translateY(0)
|
37
35
|
|
38
36
|
@keyframes headerNoOpacity
|
@@ -47,7 +45,6 @@
|
|
47
45
|
margin-top 50px
|
48
46
|
100%
|
49
47
|
opacity 1
|
50
|
-
filter none
|
51
48
|
margin-top 0
|
52
49
|
|
53
50
|
@keyframes titlescale
|
@@ -56,7 +53,6 @@
|
|
56
53
|
transform scale(.7)
|
57
54
|
100%
|
58
55
|
opacity 1
|
59
|
-
filter none
|
60
56
|
transform scale(1)
|
61
57
|
|
62
58
|
@keyframes search_close
|
@@ -72,12 +68,10 @@
|
|
72
68
|
opacity 0
|
73
69
|
100%
|
74
70
|
opacity 1
|
75
|
-
filter none
|
76
71
|
|
77
72
|
@keyframes to_hide
|
78
73
|
0%
|
79
74
|
opacity 1
|
80
|
-
filter none
|
81
75
|
100%
|
82
76
|
opacity 0
|
83
77
|
|
@@ -99,7 +93,6 @@
|
|
99
93
|
transform translateY(10px)
|
100
94
|
100%
|
101
95
|
opacity 1
|
102
|
-
filter none
|
103
96
|
transform translateY(0)
|
104
97
|
|
105
98
|
@keyframes donate_effcet
|
@@ -108,13 +101,11 @@
|
|
108
101
|
transform translateY(-20px)
|
109
102
|
100%
|
110
103
|
opacity 1
|
111
|
-
filter none
|
112
104
|
transform translateY(0)
|
113
105
|
|
114
106
|
@keyframes announ_animation
|
115
107
|
0%, 100%
|
116
108
|
transform scale(1)
|
117
|
-
filter blur(0)
|
118
109
|
50%
|
119
110
|
transform scale(1.2)
|
120
111
|
filter blur(20px)
|
@@ -260,15 +251,9 @@
|
|
260
251
|
@keyframes light_tag
|
261
252
|
0%
|
262
253
|
transform skewx(0)
|
263
|
-
-o-transform skewx(0)
|
264
|
-
-moz-transform skewx(0)
|
265
|
-
-webkit-transform skewx(0)
|
266
254
|
left -150px
|
267
255
|
99%
|
268
256
|
transform skewx(-25deg)
|
269
|
-
-o-transform skewx(-25deg)
|
270
|
-
-moz-transform skewx(-25deg)
|
271
|
-
-webkit-transform skewx(-25deg)
|
272
257
|
left 50px
|
273
258
|
|
274
259
|
@keyframes floating
|
@@ -77,9 +77,9 @@ html
|
|
77
77
|
line-height 1.15
|
78
78
|
-webkit-text-size-adjust 100%
|
79
79
|
text-size-adjust 100%
|
80
|
-
height: 100
|
81
|
-
font-size
|
82
|
-
overflow-y
|
80
|
+
height: 100%
|
81
|
+
font-size 20px
|
82
|
+
overflow-y overlay
|
83
83
|
|
84
84
|
main
|
85
85
|
display block
|
@@ -146,7 +146,7 @@ hr
|
|
146
146
|
box-sizing content-box
|
147
147
|
height 0
|
148
148
|
overflow visible
|
149
|
-
display
|
149
|
+
display none
|
150
150
|
|
151
151
|
a
|
152
152
|
color var(--efu-fontcolor)
|
@@ -363,29 +363,29 @@ i.solitude
|
|
363
363
|
font-synthesis style
|
364
364
|
|
365
365
|
#body-wrap
|
366
|
-
display
|
367
|
-
flex-direction
|
368
|
-
min-height
|
369
|
-
justify-content
|
366
|
+
display flex
|
367
|
+
flex-direction column
|
368
|
+
min-height 100vh
|
369
|
+
justify-content space-between
|
370
370
|
|
371
371
|
.layout
|
372
|
-
display
|
373
|
-
margin
|
374
|
-
padding
|
372
|
+
display flex
|
373
|
+
margin 0 auto
|
374
|
+
padding 0 1.5rem
|
375
375
|
width 100%
|
376
|
-
max-width
|
376
|
+
max-width 1200px
|
377
377
|
+maxWidth768()
|
378
378
|
padding 0
|
379
379
|
|
380
380
|
&#content-inner
|
381
|
-
max-width
|
382
|
-
flex-grow
|
381
|
+
max-width 1400px
|
382
|
+
flex-grow 1
|
383
383
|
|
384
384
|
/.hide-aside.layout
|
385
|
-
max-width
|
385
|
+
max-width 1400px
|
386
386
|
|
387
387
|
> div
|
388
|
-
width
|
388
|
+
width 100% !important
|
389
389
|
|
390
390
|
> div:first-child
|
391
391
|
width calc(100% - 300px)
|
@@ -419,10 +419,10 @@ i.solitude
|
|
419
419
|
span.tags-punctuation
|
420
420
|
i
|
421
421
|
font-weight bold
|
422
|
-
font-size
|
422
|
+
font-size 12px
|
423
423
|
transition none
|
424
|
-
margin-right
|
425
|
-
opacity
|
424
|
+
margin-right 2px
|
425
|
+
opacity .4
|
426
426
|
|
427
427
|
.hide-aside #page &
|
428
428
|
font-size 16px
|
@@ -1,4 +1,4 @@
|
|
1
|
-
.
|
1
|
+
.article-container
|
2
2
|
overflow-wrap break-word
|
3
3
|
+maxWidth768()
|
4
4
|
overflow hidden
|
@@ -7,7 +7,7 @@
|
|
7
7
|
.post &
|
8
8
|
padding 1rem 2rem
|
9
9
|
+maxWidth768()
|
10
|
-
padding .5rem
|
10
|
+
padding .5rem .5rem 1rem .5rem
|
11
11
|
|
12
12
|
iframe
|
13
13
|
border-radius 12px
|
@@ -66,7 +66,7 @@
|
|
66
66
|
font-size .9rem
|
67
67
|
line-height 1.7
|
68
68
|
font-weight 400
|
69
|
-
margin
|
69
|
+
margin .5rem 0
|
70
70
|
text-align left
|
71
71
|
letter-spacing .6px
|
72
72
|
|
@@ -1,11 +1,10 @@
|
|
1
1
|
#about-page
|
2
|
-
.author-content-item.game
|
2
|
+
.author-content-item.game
|
3
3
|
min-height 300px
|
4
4
|
overflow hidden
|
5
5
|
color var(--efu-white)
|
6
6
|
|
7
7
|
&::after
|
8
|
-
box-shadow 0 -69px 203px 11px #04120f inset
|
9
8
|
position absolute
|
10
9
|
content ''
|
11
10
|
width 100%
|
@@ -22,18 +21,4 @@
|
|
22
21
|
z-index 2
|
23
22
|
display flex
|
24
23
|
flex-direction column
|
25
|
-
padding 1rem 2rem
|
26
|
-
|
27
|
-
.author-content-item.game-jl
|
28
|
-
min-height 300px
|
29
|
-
overflow hidden
|
30
|
-
color var(--efu-white)
|
31
|
-
|
32
|
-
&::after
|
33
|
-
box-shadow 0 -69px 203px 11px #415dc9 inset
|
34
|
-
position absolute
|
35
|
-
content ''
|
36
|
-
width 100%
|
37
|
-
height 100%
|
38
|
-
top 0
|
39
|
-
left 0
|
24
|
+
padding 1rem 2rem
|
@@ -42,10 +42,9 @@
|
|
42
42
|
flex 1 1 0
|
43
43
|
height 100%
|
44
44
|
width 600px
|
45
|
-
border-
|
46
|
-
border-bottom-left-radius 8px
|
45
|
+
border-radius 8px 0 0 8px
|
47
46
|
background-color var(--efu-main)
|
48
|
-
background-position center
|
47
|
+
background-position center
|
49
48
|
background-size cover
|
50
49
|
|
51
50
|
+maxWidth768()
|
@@ -29,6 +29,7 @@ if hexo-config('says.home_mini')
|
|
29
29
|
background var(--efu-background)
|
30
30
|
border none
|
31
31
|
padding 0 .2rem
|
32
|
+
|
32
33
|
i.bber-logo,
|
33
34
|
i.bber-gotobb
|
34
35
|
transition .3s
|
@@ -80,9 +81,9 @@ if hexo-config('says.enable')
|
|
80
81
|
opacity .6
|
81
82
|
|
82
83
|
.goComment
|
83
|
-
position
|
84
|
-
top
|
85
|
-
right
|
84
|
+
position absolute
|
85
|
+
top 0
|
86
|
+
right 0
|
86
87
|
|
87
88
|
div
|
88
89
|
&.bber-content
|
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
.article-container .tabs
|
3
3
|
position relative
|
4
4
|
border 1px solid var(--tab-border-color)
|
5
5
|
|
@@ -91,7 +91,7 @@
|
|
91
91
|
.tab-item-content
|
92
92
|
background var(--efu-card-bg)
|
93
93
|
|
94
|
-
|
94
|
+
.article-container .tabs
|
95
95
|
|
96
96
|
> .tab-contents .tab-item-content.active
|
97
97
|
animation tabshow 0s
|
@@ -23,7 +23,7 @@ const localColor = path => {
|
|
23
23
|
const colorThief = new ColorThief();
|
24
24
|
const img = new Image();
|
25
25
|
img.crossOrigin = "Anonymous";
|
26
|
-
img.onload = () => setThemeColors(rgbToHex(colorThief.getColor(img)));
|
26
|
+
img.onload = () => setThemeColors(rgbToHex(colorThief.getColor(img)), ...colorThief.getColor(img));
|
27
27
|
img.onerror = () => console.error('Image Error');
|
28
28
|
img.src = path;
|
29
29
|
}
|
@@ -61,6 +61,14 @@ const setThemeColors = (value, r = null, g = null, b = null) => {
|
|
61
61
|
initThemeColor();
|
62
62
|
}
|
63
63
|
|
64
|
+
function LightenDarkenColor(col, amt) {
|
65
|
+
var usePound = false;
|
66
|
+
if (col[0] === "#") {
|
67
|
+
col = col.slice(1);
|
68
|
+
usePound = true;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
64
72
|
const adjustCardStyles = () => {
|
65
73
|
const cardContents = document.getElementsByClassName('card-content');
|
66
74
|
Array.from(cardContents).forEach(item => {
|