hexo-theme-solitude 1.5.3 → 1.5.5
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/FUNDING.yml +1 -1
- package/.github/ISSUE_TEMPLATE/bug_report.yml +7 -6
- package/.github/ISSUE_TEMPLATE/feature_request.yml +1 -1
- package/.github/logo.svg +13 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/README.md +4 -3
- package/README_EN.md +3 -2
- package/README_zh-tw.md +2 -1
- package/_config.yml +0 -12
- package/languages/en.yml +9 -6
- package/languages/zh-CN.yml +9 -6
- package/languages/zh-TW.yml +9 -6
- package/layout/includes/head/config.pug +9 -6
- package/layout/includes/inject/body.pug +7 -0
- package/layout/includes/inject/head.pug +1 -1
- package/layout/includes/widgets/post/copyright.pug +0 -2
- package/layout/page.pug +0 -4
- package/package.json +1 -1
- package/plugins.yml +0 -4
- package/scripts/event/cdn.js +6 -1
- package/scripts/filter/default.js +2 -2
- package/scripts/tags/button.js +1 -1
- package/scripts/tags/bvideo.js +2 -2
- package/scripts/tags/gallery.js +54 -0
- package/scripts/tags/image.js +1 -1
- package/scripts/tags/link.js +6 -3
- package/scripts/tags/note.js +6 -0
- package/source/css/_page/_gallery/index.styl +0 -66
- package/source/css/_page/share.styl +2 -2
- package/source/css/_widgets/_post/content.styl +7 -0
- package/source/css/_widgets/_post/copyright.styl +0 -18
- package/source/css/_widgets/_tags/button.styl +29 -49
- package/source/css/_widgets/_tags/checkbox.styl +176 -57
- package/source/css/_widgets/_tags/fold.styl +65 -79
- package/source/css/_widgets/_tags/gallery.styl +67 -0
- package/source/css/_widgets/_tags/index.styl +32 -30
- package/source/css/_widgets/_tags/label.styl +4 -3
- package/source/css/_widgets/_tags/link.styl +48 -77
- package/source/css/_widgets/_tags/media.styl +57 -0
- package/source/css/_widgets/_tags/mermaid.styl +1 -2
- package/source/css/_widgets/_tags/note.styl +1 -7
- package/source/css/_widgets/_tags/span.styl +24 -51
- package/source/css/_widgets/_tags/tabs.styl +3 -1
- package/source/css/_widgets/index.styl +1 -1
- package/source/js/covercolor/api.js +16 -16
- package/source/js/covercolor/local.js +16 -16
- package/source/js/lately.min.js +6 -0
- package/source/js/main.js +2 -32
- package/source/js/utils.js +6 -0
- package/.github/logo.png +0 -0
- package/layout/includes/page/album.pug +0 -38
- package/layout/includes/page/gallery.pug +0 -11
- package/scripts/generator/gallery.js +0 -49
- package/scripts/tags/card.js +0 -9
- package/scripts/tags/u.js +0 -7
- package/source/css/_widgets/_tags/bvideo.styl +0 -8
- package/source/css/_widgets/_tags/card.styl +0 -52
- package/source/css/_widgets/_tags/image.styl +0 -10
- package/source/css/_widgets/_tags/inline-image.styl +0 -6
@@ -1,3 +1,24 @@
|
|
1
|
+
.red
|
2
|
+
color var(--efu-red)
|
3
|
+
|
4
|
+
.green
|
5
|
+
color var(--efu-green)
|
6
|
+
|
7
|
+
.blue
|
8
|
+
color var(--efu-blue)
|
9
|
+
|
10
|
+
.yellow
|
11
|
+
color var(--efu-yellow)
|
12
|
+
|
13
|
+
.pink
|
14
|
+
color var(--efu-pink)
|
15
|
+
|
16
|
+
.purple
|
17
|
+
color var(--efu-purple)
|
18
|
+
|
19
|
+
.orange
|
20
|
+
color var(--efu-orange)
|
21
|
+
|
1
22
|
.bg-red
|
2
23
|
background-color var(--efu-red)
|
3
24
|
color var(--efu-white)
|
@@ -25,37 +46,18 @@
|
|
25
46
|
background-color var(--efu-orange)
|
26
47
|
color var(--efu-white)
|
27
48
|
|
28
|
-
.
|
29
|
-
|
30
|
-
color var(--efu-white)
|
49
|
+
.block
|
50
|
+
display block
|
31
51
|
|
32
|
-
.
|
33
|
-
|
34
|
-
color var(--efu-white)
|
35
|
-
|
36
|
-
.red
|
37
|
-
color var(--efu-red)
|
52
|
+
.center
|
53
|
+
margin 0 auto
|
38
54
|
|
39
|
-
.
|
40
|
-
|
41
|
-
|
42
|
-
.blue
|
43
|
-
color var(--efu-blue)
|
44
|
-
|
45
|
-
.yellow
|
46
|
-
color var(--efu-yellow)
|
47
|
-
|
48
|
-
.pink
|
49
|
-
color var(--efu-pink)
|
50
|
-
|
51
|
-
.purple
|
52
|
-
color var(--efu-purple)
|
53
|
-
|
54
|
-
.orange
|
55
|
-
color var(--efu-orange)
|
55
|
+
.right
|
56
|
+
margin-left auto
|
56
57
|
|
57
|
-
.
|
58
|
-
|
58
|
+
.larger
|
59
|
+
font-size 1.5rem
|
60
|
+
margin 5px
|
59
61
|
|
60
|
-
|
61
|
-
|
62
|
+
i
|
63
|
+
transform scale(1.5)
|
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
#article-container
|
2
|
+
.hl-label
|
3
|
+
padding 2px 4px
|
4
|
+
border-radius 3px
|
@@ -1,83 +1,54 @@
|
|
1
|
-
#article-container
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
border var(--style-border)
|
6
|
-
flex-direction column
|
7
|
-
padding .3rem 1rem .6rem
|
8
|
-
border-width 1px !important
|
9
|
-
margin-top 1rem
|
10
|
-
|
11
|
-
&:hover
|
12
|
-
color var(--efu-main) !important
|
13
|
-
border var(--style-border-hover) !important
|
14
|
-
|
15
|
-
.tag-link-tips
|
16
|
-
border-bottom var(--style-border-always)
|
17
|
-
padding-bottom 4px
|
18
|
-
font-size .6rem
|
19
|
-
color var(--efu-gray)
|
20
|
-
font-weight 400
|
21
|
-
pointer-events none
|
22
|
-
|
23
|
-
&:hover .tag-link-tips
|
24
|
-
color var(--efu-card-bg)
|
25
|
-
opacity .6
|
26
|
-
|
27
|
-
.tag-link-bottom
|
1
|
+
#article-container
|
2
|
+
.tag-link
|
3
|
+
background var(--efu-secondbg)
|
4
|
+
border-radius 8px !important
|
28
5
|
display flex
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
6
|
+
border var(--style-border)
|
7
|
+
flex-direction column
|
8
|
+
padding 0.5rem 1rem
|
9
|
+
border-width 1px
|
10
|
+
margin 1rem 0
|
33
11
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
height 60px
|
38
|
-
background-size cover !important
|
39
|
-
border-radius 8px
|
40
|
-
background var(--efu-card-bg)
|
41
|
-
pointer-events none
|
42
|
-
display flex
|
43
|
-
|
44
|
-
i
|
45
|
-
padding 0
|
46
|
-
margin auto
|
47
|
-
font-size 24px
|
48
|
-
color var(--efu-fontcolor)
|
12
|
+
&:hover
|
13
|
+
background var(--efu-main)
|
14
|
+
border var(--style-border-hover) !important
|
49
15
|
|
50
|
-
|
51
|
-
|
52
|
-
pointer-events none
|
16
|
+
.tag-link-tips
|
17
|
+
color var(--efu-card-bg)
|
53
18
|
|
54
|
-
|
55
|
-
|
56
|
-
line-height 1.2
|
57
|
-
pointer-events none
|
58
|
-
word-break break-all
|
59
|
-
text-overflow ellipsis
|
60
|
-
display -webkit-box
|
61
|
-
-webkit-box-orient vertical
|
62
|
-
-webkit-line-clamp 2
|
63
|
-
overflow hidden
|
19
|
+
i
|
20
|
+
margin-left auto
|
64
21
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
22
|
+
.tag-link-bottom
|
23
|
+
display flex
|
24
|
+
margin-top 0.5rem
|
25
|
+
align-items center
|
26
|
+
justify-content space-around
|
27
|
+
|
28
|
+
.tag-link-left
|
29
|
+
width 60px
|
30
|
+
min-width 60px
|
31
|
+
height 60px
|
32
|
+
background-size cover
|
33
|
+
border-radius 8px
|
34
|
+
background-color var(--efu-card-bg)
|
35
|
+
display flex
|
36
|
+
align-items center
|
37
|
+
justify-content center
|
38
|
+
|
39
|
+
i
|
40
|
+
padding 0
|
41
|
+
margin auto
|
42
|
+
font-size 24px
|
43
|
+
color var(--efu-fontcolor)
|
44
|
+
|
45
|
+
.tag-link-right
|
46
|
+
margin-left 1rem
|
47
|
+
max-width calc(100% - 76px - 1rem)
|
79
48
|
|
80
|
-
.tag-link-
|
81
|
-
|
82
|
-
padding-
|
83
|
-
|
49
|
+
.tag-link-tips
|
50
|
+
border-bottom var(--style-border)
|
51
|
+
padding-bottom 4px
|
52
|
+
font-size 12px
|
53
|
+
color var(--efu-gray)
|
54
|
+
font-weight 400
|
@@ -0,0 +1,57 @@
|
|
1
|
+
trans($time = 0.28s)
|
2
|
+
transition: all $time ease
|
3
|
+
-moz-transition: all $time ease
|
4
|
+
-webkit-transition: all $time ease
|
5
|
+
-o-transition: all $time ease
|
6
|
+
|
7
|
+
audio,video
|
8
|
+
border-radius: 4px
|
9
|
+
max-width: 100%
|
10
|
+
video
|
11
|
+
z-index: 1
|
12
|
+
trans()
|
13
|
+
&:hover
|
14
|
+
box-shadow: 0 4px 8px 0px rgba(0, 0, 0, 0.24), 0 8px 16px 0px rgba(0, 0, 0, 0.24)
|
15
|
+
|
16
|
+
div.video
|
17
|
+
line-height: 0
|
18
|
+
text-align: center
|
19
|
+
|
20
|
+
div.videos
|
21
|
+
max-width: "calc(100% + 2 * %s)" % 4px
|
22
|
+
display: flex
|
23
|
+
flex-wrap: wrap
|
24
|
+
justify-content: flex-start
|
25
|
+
align-items: flex-end
|
26
|
+
margin: 1em 0 - 4px
|
27
|
+
.video,iframe
|
28
|
+
width: 100%
|
29
|
+
margin: 4px
|
30
|
+
|
31
|
+
iframe
|
32
|
+
border-radius: 4px
|
33
|
+
width: 100%
|
34
|
+
min-height: 300px
|
35
|
+
&.left
|
36
|
+
justify-content: flex-start
|
37
|
+
&.center
|
38
|
+
justify-content: center
|
39
|
+
&.right
|
40
|
+
justify-content: flex-end
|
41
|
+
&.stretch
|
42
|
+
align-items: stretch
|
43
|
+
&[col='1']
|
44
|
+
.video,iframe
|
45
|
+
width: 100%
|
46
|
+
&[col='2']
|
47
|
+
.video,iframe
|
48
|
+
width: "calc(50% - 2 * %s)" % 4px
|
49
|
+
&[col='3']
|
50
|
+
.video,iframe
|
51
|
+
width: "calc(33.33% - 2 * %s)" % 4px
|
52
|
+
&[col='4']
|
53
|
+
.video,iframe
|
54
|
+
width: "calc(25% - 2 * %s)" % 4px
|
55
|
+
[data-theme="dark"]
|
56
|
+
audio,video
|
57
|
+
filter brightness(0.7)
|
@@ -31,10 +31,6 @@ $colors = {
|
|
31
31
|
&.success:not(.no-icon)::before
|
32
32
|
content: '\e0a4'
|
33
33
|
|
34
|
-
&.success:not(.no-icon)
|
35
|
-
p
|
36
|
-
color var(--efu-card-bg)
|
37
|
-
|
38
34
|
&::before
|
39
35
|
font-family 'solitude'
|
40
36
|
|
@@ -74,9 +70,7 @@ $colors = {
|
|
74
70
|
border 1px solid transparent !important
|
75
71
|
|
76
72
|
&.flat
|
77
|
-
border
|
78
|
-
border-right initial
|
79
|
-
border-bottom initial
|
73
|
+
border initial
|
80
74
|
border-image initial
|
81
75
|
border-left 5px solid #eee
|
82
76
|
background-color #f9f9f9
|
@@ -1,61 +1,34 @@
|
|
1
1
|
#article-container
|
2
|
-
|
3
|
-
font-weight: bold
|
4
|
-
color: mix(#44D7B6, #444, 75)
|
5
|
-
font-size: 1.25rem
|
6
|
-
padding-top: 1.5rem
|
7
|
-
&:first-child
|
8
|
-
padding-top: 1rem
|
9
|
-
|
10
|
-
span.p,p.p
|
2
|
+
.p
|
11
3
|
&.left
|
12
|
-
|
13
|
-
|
4
|
+
text-align left
|
5
|
+
|
14
6
|
&.center
|
15
|
-
|
16
|
-
|
7
|
+
text-align center
|
8
|
+
|
17
9
|
&.right
|
18
|
-
|
19
|
-
text-align: right
|
10
|
+
text-align right
|
20
11
|
|
21
|
-
span.p,p.p
|
22
12
|
&.small
|
23
|
-
font-size
|
24
|
-
|
25
|
-
font-size: 2.5rem
|
26
|
-
line-height: 1.4
|
27
|
-
&.huge
|
28
|
-
font-size: 4rem
|
29
|
-
line-height: 1.4
|
30
|
-
&.ultra
|
31
|
-
font-size: 6rem
|
32
|
-
line-height: 1.4
|
33
|
-
&.small,&.large,&.huge,&.ultra
|
34
|
-
margin: 0
|
35
|
-
padding: 0
|
36
|
-
&.bold
|
37
|
-
font-weight: bold
|
38
|
-
&.h1,&.h2
|
39
|
-
padding-bottom: .2rem
|
40
|
-
font-weight: 500
|
13
|
+
font-size .5rem
|
14
|
+
|
41
15
|
&.h1
|
42
|
-
font-size
|
43
|
-
|
44
|
-
padding-top: 1em * 2
|
16
|
+
font-size 2.5rem
|
17
|
+
|
45
18
|
&.h2
|
46
|
-
font-size
|
47
|
-
|
48
|
-
padding-top: 1em * 2
|
49
|
-
border-bottom: 1px solid alpha(#444, .1)
|
19
|
+
font-size 1.625rem
|
20
|
+
|
50
21
|
&.h3
|
51
|
-
font-size
|
52
|
-
|
53
|
-
padding-top: 1em * 2
|
22
|
+
font-size 1.375rem
|
23
|
+
|
54
24
|
&.h4
|
55
|
-
font-size
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
25
|
+
font-size 1.125rem
|
26
|
+
|
27
|
+
&.large
|
28
|
+
font-size 1.5rem
|
29
|
+
|
30
|
+
&.huge
|
31
|
+
font-size 4rem
|
32
|
+
|
33
|
+
&.ultra
|
34
|
+
font-size 6rem
|
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
#article-container .tabs
|
2
3
|
position relative
|
3
4
|
border 1px solid var(--tab-border-color)
|
@@ -17,6 +18,7 @@
|
|
17
18
|
font-size inherit
|
18
19
|
|
19
20
|
&.active button
|
21
|
+
cursor default
|
20
22
|
border var(--style-border-hover-always)
|
21
23
|
background var(--efu-background)
|
22
24
|
border-radius 8px;
|
@@ -102,4 +104,4 @@
|
|
102
104
|
|
103
105
|
.tab-contents
|
104
106
|
border-radius 8px
|
105
|
-
overflow hidden
|
107
|
+
overflow hidden
|
@@ -3,10 +3,10 @@ const coverColor = () => {
|
|
3
3
|
if (path) {
|
4
4
|
handleApiColor(path);
|
5
5
|
} else {
|
6
|
-
document.documentElement.style.setProperty('--
|
7
|
-
document.documentElement.style.setProperty('--
|
8
|
-
document.documentElement.style.setProperty('--
|
9
|
-
document.documentElement.style.setProperty('--
|
6
|
+
document.documentElement.style.setProperty('--efu-main', 'var(--efu-theme)');
|
7
|
+
document.documentElement.style.setProperty('--efu-main-op', 'var(--efu-theme-op)');
|
8
|
+
document.documentElement.style.setProperty('--efu-main-op-deep', 'var(--efu-theme-op-deep)');
|
9
|
+
document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
|
10
10
|
initThemeColor()
|
11
11
|
}
|
12
12
|
}
|
@@ -43,17 +43,17 @@ function img2color(src) {
|
|
43
43
|
|
44
44
|
function setThemeColors(value, r = null, g = null, b = null) {
|
45
45
|
if (value) {
|
46
|
-
document.documentElement.style.setProperty('--
|
47
|
-
document.documentElement.style.setProperty('--
|
48
|
-
document.documentElement.style.setProperty('--
|
49
|
-
document.documentElement.style.setProperty('--
|
46
|
+
document.documentElement.style.setProperty('--efu-main', value);
|
47
|
+
document.documentElement.style.setProperty('--efu-main-op', value + '23');
|
48
|
+
document.documentElement.style.setProperty('--efu-main-op-deep', value + 'dd');
|
49
|
+
document.documentElement.style.setProperty('--efu-main-none', value + '00');
|
50
50
|
|
51
51
|
if (r && g && b) {
|
52
52
|
let brightness = Math.round(((parseInt(r) * 299) + (parseInt(g) * 587) + (parseInt(b) * 114)) / 1000);
|
53
53
|
if (brightness < 125) {
|
54
54
|
let cardContents = document.getElementsByClassName('card-content');
|
55
55
|
for (let i = 0; i < cardContents.length; i++) {
|
56
|
-
cardContents[i].style.setProperty('--
|
56
|
+
cardContents[i].style.setProperty('--efu-card-bg', 'var(--efu-white)');
|
57
57
|
}
|
58
58
|
|
59
59
|
let authorInfo = document.getElementsByClassName('author-info__sayhi');
|
@@ -67,10 +67,10 @@ function setThemeColors(value, r = null, g = null, b = null) {
|
|
67
67
|
document.getElementById("coverdiv").classList.add("loaded");
|
68
68
|
initThemeColor();
|
69
69
|
} else {
|
70
|
-
document.documentElement.style.setProperty('--
|
71
|
-
document.documentElement.style.setProperty('--
|
72
|
-
document.documentElement.style.setProperty('--
|
73
|
-
document.documentElement.style.setProperty('--
|
70
|
+
document.documentElement.style.setProperty('--efu-main', 'var(--efu-theme)');
|
71
|
+
document.documentElement.style.setProperty('--efu-main-op', 'var(--efu-theme-op)');
|
72
|
+
document.documentElement.style.setProperty('--efu-main-op-deep', 'var(--efu-theme-op-deep)');
|
73
|
+
document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
|
74
74
|
initThemeColor();
|
75
75
|
}
|
76
76
|
}
|
@@ -79,11 +79,11 @@ function initThemeColor() {
|
|
79
79
|
const currentTop = window.scrollY || document.documentElement.scrollTop;
|
80
80
|
let themeColor;
|
81
81
|
if (currentTop > 0) {
|
82
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--
|
82
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-card-bg');
|
83
83
|
} else if (PAGE_CONFIG.is_post) {
|
84
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--
|
84
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-main');
|
85
85
|
} else {
|
86
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--
|
86
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-background');
|
87
87
|
}
|
88
88
|
changeThemeColor(themeColor);
|
89
89
|
}
|
@@ -3,10 +3,10 @@ const coverColor = () => {
|
|
3
3
|
if (path) {
|
4
4
|
localColor(path);
|
5
5
|
} else {
|
6
|
-
document.documentElement.style.setProperty('--
|
7
|
-
document.documentElement.style.setProperty('--
|
8
|
-
document.documentElement.style.setProperty('--
|
9
|
-
document.documentElement.style.setProperty('--
|
6
|
+
document.documentElement.style.setProperty('--efu-main', 'var(--efu-theme)');
|
7
|
+
document.documentElement.style.setProperty('--efu-main-op', 'var(--efu-theme-op)');
|
8
|
+
document.documentElement.style.setProperty('--efu-main-op-deep', 'var(--efu-theme-op-deep)');
|
9
|
+
document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
|
10
10
|
initThemeColor()
|
11
11
|
}
|
12
12
|
}
|
@@ -108,17 +108,17 @@ function colorRgb(str) {
|
|
108
108
|
|
109
109
|
function setThemeColors(value, r = null, g = null, b = null) {
|
110
110
|
if (value) {
|
111
|
-
document.documentElement.style.setProperty('--
|
112
|
-
document.documentElement.style.setProperty('--
|
113
|
-
document.documentElement.style.setProperty('--
|
114
|
-
document.documentElement.style.setProperty('--
|
111
|
+
document.documentElement.style.setProperty('--efu-main', value);
|
112
|
+
document.documentElement.style.setProperty('--efu-main-op', value + '23');
|
113
|
+
document.documentElement.style.setProperty('--efu-main-op-deep', value + 'dd');
|
114
|
+
document.documentElement.style.setProperty('--efu-main-none', value + '00');
|
115
115
|
|
116
116
|
if (r && g && b) {
|
117
117
|
let brightness = Math.round(((parseInt(r) * 299) + (parseInt(g) * 587) + (parseInt(b) * 114)) / 1000);
|
118
118
|
if (brightness < 125) {
|
119
119
|
let cardContents = document.getElementsByClassName('card-content');
|
120
120
|
for (let i = 0; i < cardContents.length; i++) {
|
121
|
-
cardContents[i].style.setProperty('--
|
121
|
+
cardContents[i].style.setProperty('--efu-card-bg', 'var(--efu-white)');
|
122
122
|
}
|
123
123
|
|
124
124
|
let authorInfo = document.getElementsByClassName('author-info__sayhi');
|
@@ -132,10 +132,10 @@ function setThemeColors(value, r = null, g = null, b = null) {
|
|
132
132
|
document.getElementById("coverdiv").classList.add("loaded");
|
133
133
|
initThemeColor();
|
134
134
|
} else {
|
135
|
-
document.documentElement.style.setProperty('--
|
136
|
-
document.documentElement.style.setProperty('--
|
137
|
-
document.documentElement.style.setProperty('--
|
138
|
-
document.documentElement.style.setProperty('--
|
135
|
+
document.documentElement.style.setProperty('--efu-main', 'var(--efu-theme)');
|
136
|
+
document.documentElement.style.setProperty('--efu-main-op', 'var(--efu-theme-op)');
|
137
|
+
document.documentElement.style.setProperty('--efu-main-op-deep', 'var(--efu-theme-op-deep)');
|
138
|
+
document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
|
139
139
|
initThemeColor();
|
140
140
|
}
|
141
141
|
}
|
@@ -144,11 +144,11 @@ function initThemeColor() {
|
|
144
144
|
const currentTop = window.scrollY || document.documentElement.scrollTop;
|
145
145
|
let themeColor;
|
146
146
|
if (currentTop > 0) {
|
147
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--
|
147
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-card-bg');
|
148
148
|
} else if (PAGE_CONFIG.is_post) {
|
149
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--
|
149
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-main');
|
150
150
|
} else {
|
151
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--
|
151
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-background');
|
152
152
|
}
|
153
153
|
changeThemeColor(themeColor);
|
154
154
|
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/**
|
2
|
+
* Lately.min.js 2.5.2
|
3
|
+
* MIT License - http://www.opensource.org/licenses/mit-license.php
|
4
|
+
* https://tokinx.github.io/lately/
|
5
|
+
*/
|
6
|
+
!function(){window.Lately=new function(){var t=this;this.lang={second:"秒",minute:"分钟",hour:"小时",day:"天",month:"个月",year:"年",ago:"前",error:"NaN"};var e=function(e){e=new Date(n(e));var r=new function(){this.second=(Date.now()-e.getTime())/1e3,this.minute=this.second/60,this.hour=this.minute/60,this.day=this.hour/24,this.month=this.day/30,this.year=this.month/12},i=Object.keys(r).reverse().find(function(t){return r[t]>=1});return(i?function(t,e){return Math.floor(t)+e}(r[i],t.lang[i]):t.lang.error)+t.lang.ago},n=function(t){return t=new Date(t&&("number"==typeof t?t:t.replace(/-/g,"/").replace("T"," "))),!isNaN(t.getTime())&&t.getTime()};return{init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.target,a=void 0===i?"time":i,o=r.lang;o&&(t.lang=o);var u=!0,h=!1,l=void 0;try{for(var s,c=document.querySelectorAll(a)[Symbol.iterator]();!(u=(s=c.next()).done);u=!0){var f=s.value,g=n(f.dateTime)||n(f.title)||n(f.innerHTML)||0;if(!g)return;f.title=new Date(g).toLocaleString(),f.innerHTML=e(g)}}catch(t){h=!0,l=t}finally{try{!u&&c.return&&c.return()}finally{if(h)throw l}}},format:e}}}();
|
package/source/js/main.js
CHANGED
@@ -108,36 +108,6 @@ const showTodayCard = () => {
|
|
108
108
|
}
|
109
109
|
}
|
110
110
|
|
111
|
-
const changeTimeFormat = () => {
|
112
|
-
const timeElements = Array.from(document.getElementsByTagName("time"));
|
113
|
-
const lang = GLOBAL_CONFIG.lang.time;
|
114
|
-
const currentDate = new Date();
|
115
|
-
|
116
|
-
timeElements.forEach(timeElement => {
|
117
|
-
const datetime = timeElement.getAttribute("datetime");
|
118
|
-
const timeObj = new Date(datetime);
|
119
|
-
const daysDiff = utils.timeDiff(timeObj, currentDate);
|
120
|
-
|
121
|
-
let timeString;
|
122
|
-
if (daysDiff === 0) {
|
123
|
-
timeString = lang.recent;
|
124
|
-
} else if (daysDiff === 1) {
|
125
|
-
timeString = lang.yesterday;
|
126
|
-
} else if (daysDiff === 2) {
|
127
|
-
timeString = lang.berforeyesterday;
|
128
|
-
} else if (daysDiff <= 7) {
|
129
|
-
timeString = `${daysDiff}${lang.daybefore}`;
|
130
|
-
} else {
|
131
|
-
if (timeObj.getFullYear() !== currentDate.getFullYear()) {
|
132
|
-
timeString = `${timeObj.getFullYear()}/${timeObj.getMonth() + 1}/${timeObj.getDate()}`;
|
133
|
-
} else {
|
134
|
-
timeString = `${timeObj.getMonth() + 1}/${timeObj.getDate()}`;
|
135
|
-
}
|
136
|
-
}
|
137
|
-
timeElement.textContent = timeString;
|
138
|
-
});
|
139
|
-
}
|
140
|
-
|
141
111
|
const initObserver = () => {
|
142
112
|
let commentElement = document.getElementById("post-comment");
|
143
113
|
let paginationElement = document.getElementById("pagination");
|
@@ -352,7 +322,7 @@ let sco = {
|
|
352
322
|
},
|
353
323
|
addRuntime: function () {
|
354
324
|
let el = document.getElementById('runtimeshow')
|
355
|
-
el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.
|
325
|
+
el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.lately.day)
|
356
326
|
},
|
357
327
|
toTalk: function (txt) {
|
358
328
|
const inputs = ["#wl-edit", ".el-textarea__inner"]
|
@@ -799,7 +769,6 @@ window.refreshFn = () => {
|
|
799
769
|
sco.initAdjust()
|
800
770
|
scrollFn()
|
801
771
|
sidebarFn()
|
802
|
-
changeTimeFormat()
|
803
772
|
initObserver()
|
804
773
|
sco.addRuntime()
|
805
774
|
sco.hideCookie()
|
@@ -809,6 +778,7 @@ window.refreshFn = () => {
|
|
809
778
|
sco.categoriesBarActive()
|
810
779
|
sco.listenToPageInputPress()
|
811
780
|
sco.addNavBackgroundInit()
|
781
|
+
utils.changeTimeFormat()
|
812
782
|
GLOBAL_CONFIG.rightside.enable && addRightMenuClickEvent()
|
813
783
|
GLOBAL_CONFIG.lazyload.enable && utils.lazyloadImg()
|
814
784
|
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll("#article-container img:not(.flink-avatar)"))
|
package/source/js/utils.js
CHANGED
package/.github/logo.png
DELETED
Binary file
|