hexo-theme-stellar 1.30.0 → 1.30.2
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/_config.yml +36 -31
- package/_data/icons.yml +3 -1
- package/layout/_partial/main/article/article_footer.ejs +1 -1
- package/layout/_partial/main/post_list/post_card.ejs +19 -14
- package/layout/_partial/scripts/utils.ejs +1 -1
- package/layout/layout.ejs +1 -1
- package/layout/page.ejs +1 -1
- package/package.json +1 -1
- package/scripts/tags/inline-labels.js +3 -0
- package/scripts/tags/lib/friends.js +4 -4
- package/scripts/tags/lib/okr.js +6 -6
- package/scripts/tags/lib/quot.js +16 -15
- package/scripts/tags/lib/sites.js +1 -1
- package/source/css/_common/base.styl +1 -1
- package/source/css/_common/blockquote.styl +16 -5
- package/source/css/_common/pre.styl +1 -0
- package/source/css/_components/list.styl +44 -12
- package/source/css/_components/md.styl +3 -46
- package/source/css/_components/pages/article-indent.styl +6 -0
- package/source/css/_components/pages/article-story.styl +120 -0
- package/source/css/_components/pages/article-tech.styl +35 -0
- package/source/css/_components/partial/article-banner.styl +32 -13
- package/source/css/_components/partial/article-footer.styl +24 -14
- package/source/css/_components/partial/related.styl +1 -1
- package/source/css/_components/sidebar/sidebar.styl +1 -0
- package/source/css/_components/tag-plugins/button.styl +11 -11
- package/source/css/_components/tag-plugins/common.styl +7 -4
- package/source/css/_components/tag-plugins/friends.styl +1 -2
- package/source/css/_components/tag-plugins/friends_posts.styl +160 -0
- package/source/css/_components/tag-plugins/inline-labels.styl +5 -0
- package/source/css/_components/tag-plugins/link.styl +2 -1
- package/source/css/_components/tag-plugins/mark.styl +1 -1
- package/source/css/_components/tag-plugins/mdrender.styl +15 -0
- package/source/css/_components/tag-plugins/note.styl +4 -1
- package/source/css/_components/tag-plugins/poetry.styl +2 -0
- package/source/css/_components/tag-plugins/quot.styl +51 -25
- package/source/css/_components/tag-plugins/sites.styl +22 -8
- package/source/css/_components/tag-plugins/tabs.styl +8 -10
- package/source/css/_components/tag-plugins/timeline.styl +12 -20
- package/source/css/_components/widgets/ghuser.styl +1 -1
- package/source/css/_components/widgets/markdown.styl +4 -3
- package/source/css/_components/widgets/related.styl +1 -1
- package/source/css/_components/widgets/tagcloud.styl +1 -1
- package/source/css/_components/widgets/timeline.styl +1 -1
- package/source/css/_custom.styl +6 -2
- package/source/css/_defines/const.styl +3 -0
- package/source/css/_defines/func.styl +10 -0
- package/source/css/_defines/theme.styl +9 -0
- package/source/js/services/artalk_latest_comment.js +2 -1
- package/source/js/services/fcircle.js +2 -1
- package/source/js/services/friends.js +2 -1
- package/source/js/services/friends_and_posts.js +58 -0
- package/source/js/services/ghinfo.js +2 -1
- package/source/js/services/giscus_latest_comment.js +2 -1
- package/source/js/services/mdrender.js +5 -2
- package/source/js/services/memos.js +2 -1
- package/source/js/services/sites.js +13 -5
- package/source/js/services/timeline.js +2 -1
- package/source/js/services/waline_latest_comment.js +2 -1
- package/source/js/services/weibo.js +2 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.ds-mdrender
|
|
2
|
+
p strong
|
|
3
|
+
font-size: $fs-body
|
|
4
|
+
font-weight: 500
|
|
5
|
+
color: var(--text)
|
|
6
|
+
|
|
7
|
+
.l_body[text-indent] article.content .ds-mdrender
|
|
8
|
+
p:not([class])
|
|
9
|
+
text-indent: 0
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
.l_body[type=story] .md-text.content
|
|
13
|
+
.ds-mdrender
|
|
14
|
+
ol,ul
|
|
15
|
+
margin-left: .5rem
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
code
|
|
30
30
|
background: none
|
|
31
31
|
.md-text .tag-plugin.note:not([color])
|
|
32
|
-
.highlight
|
|
32
|
+
.highlight, pre
|
|
33
33
|
background: var(--block-hover)
|
|
34
34
|
.md-text .tag-plugin.note[child=codeblock]
|
|
35
35
|
padding: 0
|
|
@@ -66,3 +66,6 @@
|
|
|
66
66
|
|
|
67
67
|
.md-text .tag-plugin .tag-plugin.note
|
|
68
68
|
--gap-p: 1rem
|
|
69
|
+
|
|
70
|
+
.l_body[type=story] .tag-plugin.note .title p:not([class])
|
|
71
|
+
text-indent: 0
|
|
@@ -31,32 +31,32 @@
|
|
|
31
31
|
font-size: calc(var(--fsp) + 2px)
|
|
32
32
|
color: var(--text)
|
|
33
33
|
|
|
34
|
-
// type=text
|
|
35
|
-
.md-text .tag-plugin.quot
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
34
|
+
// // type=text
|
|
35
|
+
// .md-text .tag-plugin.quot
|
|
36
|
+
// .content[type=text]
|
|
37
|
+
// &:before,&:after
|
|
38
|
+
// content: ""
|
|
39
|
+
// position: absolute
|
|
40
|
+
// width: 8px
|
|
41
|
+
// height: 14px
|
|
42
|
+
// &:before
|
|
43
|
+
// top: -8px
|
|
44
|
+
// left: 0
|
|
45
|
+
// border-top: 6px solid $color-accent
|
|
46
|
+
// border-left: 6px solid $color-accent
|
|
47
|
+
// &:after
|
|
48
|
+
// right: 0
|
|
49
|
+
// bottom: -8px
|
|
50
|
+
// border-right: 6px solid $color-accent
|
|
51
|
+
// border-bottom: 6px solid $color-accent
|
|
52
|
+
// h1.content[type=text]
|
|
53
|
+
// &:before,&:after
|
|
54
|
+
// width: 12px
|
|
55
|
+
// height: 20px
|
|
56
|
+
// border-width: 8px
|
|
57
57
|
|
|
58
58
|
// type=icon
|
|
59
|
-
.md-text .tag-plugin.quot
|
|
59
|
+
.md-text .tag-plugin.quot
|
|
60
60
|
img,svg
|
|
61
61
|
height: 1.5em
|
|
62
62
|
display: inline-block
|
|
@@ -68,4 +68,30 @@
|
|
|
68
68
|
padding-top: 1px
|
|
69
69
|
span.empty
|
|
70
70
|
padding: 0 8px
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
.md-text .tag-plugin.quot.p
|
|
73
|
+
.content
|
|
74
|
+
trans1 all
|
|
75
|
+
.content .text
|
|
76
|
+
position: relative
|
|
77
|
+
.content .text:after
|
|
78
|
+
content: ""
|
|
79
|
+
position: absolute
|
|
80
|
+
--width: 90%
|
|
81
|
+
width: var(--width)
|
|
82
|
+
height: 4px
|
|
83
|
+
left: calc(50% - var(--width) / 2)
|
|
84
|
+
bottom: -8px
|
|
85
|
+
border-radius: 100%
|
|
86
|
+
background: var(--text)
|
|
87
|
+
opacity: 0.2
|
|
88
|
+
filter: blur(2px)
|
|
89
|
+
trans1 all
|
|
90
|
+
&:hover
|
|
91
|
+
.content
|
|
92
|
+
transform: translateY(-4px) scale(1.05)
|
|
93
|
+
.text:after
|
|
94
|
+
opacity: 0.3
|
|
95
|
+
filter: blur(8px)
|
|
96
|
+
transform: translateY(4px) scale(1.2, 1.5)
|
|
97
|
+
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
aspect-ratio: 1.5
|
|
16
16
|
width: 100%
|
|
17
17
|
height: 100%
|
|
18
|
+
border-radius: $border-card-s
|
|
18
19
|
box-shadow: 0 1px 2px 0px rgba(0, 0, 0, 0.2)
|
|
19
20
|
.info
|
|
20
21
|
margin-top: 0.5rem
|
|
@@ -48,20 +49,33 @@
|
|
|
48
49
|
overflow: hidden
|
|
49
50
|
-webkit-line-clamp: 1
|
|
50
51
|
|
|
51
|
-
.
|
|
52
|
+
.labels
|
|
52
53
|
position: absolute
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
top: 2px
|
|
55
|
+
right: 2px
|
|
56
|
+
display: flex
|
|
57
|
+
flex-wrap: wrap
|
|
58
|
+
justify-content: flex-end
|
|
59
|
+
pointer-events: none
|
|
60
|
+
user-select: none
|
|
61
|
+
opacity 1
|
|
62
|
+
trans1 all
|
|
63
|
+
.label
|
|
64
|
+
font-weight: 500
|
|
65
|
+
color: white
|
|
66
|
+
font-size: 12px
|
|
67
|
+
padding: 3px 6px 2px 6px
|
|
68
|
+
margin: 2px
|
|
69
|
+
line-height: 1
|
|
70
|
+
border-radius: 16px
|
|
60
71
|
|
|
61
72
|
// transform
|
|
62
73
|
.sites-wrap .site-card .card-link
|
|
63
74
|
>img
|
|
64
75
|
floatable-trans()
|
|
65
76
|
&:hover
|
|
77
|
+
.labels
|
|
78
|
+
opacity 0
|
|
79
|
+
transform: translateY(-4px)
|
|
66
80
|
>img
|
|
67
81
|
floatable-float()
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
flex-direction: column
|
|
7
7
|
&[align=left]
|
|
8
8
|
align-items: flex-start
|
|
9
|
-
.nav-tabs
|
|
9
|
+
.nav-tabs,.tab-content
|
|
10
10
|
align-self: flex-start
|
|
11
11
|
&[align=center]
|
|
12
12
|
align-items: center
|
|
13
|
+
.nav-tabs,.tab-content
|
|
14
|
+
align-items: center
|
|
13
15
|
&[align=right]
|
|
14
16
|
align-items: flex-end
|
|
15
|
-
.nav-tabs
|
|
17
|
+
.nav-tabs,.tab-content
|
|
16
18
|
align-self: flex-end
|
|
17
19
|
|
|
18
20
|
.tag-plugin.tabs
|
|
@@ -75,18 +77,14 @@
|
|
|
75
77
|
max-width: 100%
|
|
76
78
|
text-align: justify
|
|
77
79
|
margin-top: .5rem
|
|
80
|
+
display: flex
|
|
81
|
+
flex-direction: column
|
|
78
82
|
.tab-pane
|
|
79
83
|
display: block
|
|
84
|
+
overflow: hidden
|
|
80
85
|
&:not(.active)
|
|
81
|
-
visibility: hidden
|
|
82
86
|
height: 0
|
|
83
87
|
&.active
|
|
84
|
-
visibility: visible
|
|
85
88
|
height: auto
|
|
86
|
-
.tab-content:has(.grid-box)
|
|
89
|
+
.tab-content:has(.grid-box),.tab-pane:has(.grid-box)
|
|
87
90
|
width: 100%
|
|
88
|
-
|
|
89
|
-
.l_body[text-indent] .md-text .tag-plugin.tabs .tab-content .tab-pane>p:not([class])
|
|
90
|
-
text-indent: 'calc(%s * 2)' % var(--fsp)
|
|
91
|
-
a
|
|
92
|
-
text-indent: 0
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
padding-left: 0
|
|
16
16
|
&:before
|
|
17
17
|
display: none
|
|
18
|
+
.l_body[type=story] .md-text.content
|
|
19
|
+
.tag-plugin.timeline
|
|
20
|
+
ol,ul
|
|
21
|
+
margin-left: 0
|
|
18
22
|
|
|
19
23
|
.tag-plugin.timeline .timenode
|
|
20
24
|
position: relative
|
|
@@ -82,7 +86,7 @@
|
|
|
82
86
|
|
|
83
87
|
.tag-plugin.timeline .body
|
|
84
88
|
background: var(--card)
|
|
85
|
-
border-radius:
|
|
89
|
+
border-radius: 16px
|
|
86
90
|
border-top-left-radius: 2px
|
|
87
91
|
padding: 0.5rem 1rem
|
|
88
92
|
margin-top: 4px
|
|
@@ -113,32 +117,21 @@
|
|
|
113
117
|
font-weight: 700
|
|
114
118
|
margin: 0.5rem 0 0.75rem
|
|
115
119
|
line-height: 1.25
|
|
120
|
+
border-bottom: 1px solid var(--block-border)
|
|
116
121
|
&:only-child
|
|
117
122
|
margin-bottom: 0.5rem
|
|
118
123
|
font-weight: 500
|
|
119
124
|
a
|
|
120
125
|
color: inherit
|
|
121
126
|
text-decoration: none
|
|
122
|
-
|
|
127
|
+
padding-bottom: 0.75rem
|
|
128
|
+
display: inline-block
|
|
123
129
|
trans1 all
|
|
124
|
-
background: none
|
|
125
130
|
&:hover
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
padding: 0
|
|
131
|
-
margin: 0
|
|
132
|
-
color: inherit
|
|
133
|
-
text-decoration: none
|
|
134
|
-
border-bottom: 2px solid $color-theme
|
|
135
|
-
trans1 all
|
|
136
|
-
background: none
|
|
137
|
-
&:hover
|
|
138
|
-
background: none
|
|
139
|
-
border-radius: 0
|
|
140
|
-
border-bottom: 2px solid $color-hover
|
|
141
|
-
|
|
131
|
+
color: $color-hover
|
|
132
|
+
>p:first-child:not([class])
|
|
133
|
+
font-size: 1rem
|
|
134
|
+
margin: .25rem 0 .5rem
|
|
142
135
|
|
|
143
136
|
a
|
|
144
137
|
&:has(img):after
|
|
@@ -159,7 +152,6 @@
|
|
|
159
152
|
flex-wrap: wrap
|
|
160
153
|
justify-content: space-between
|
|
161
154
|
align-items: stretch
|
|
162
|
-
background: var(--card)
|
|
163
155
|
span
|
|
164
156
|
line-height: 1.8
|
|
165
157
|
&:empty
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
.widget-wrapper.markdown
|
|
2
2
|
.widget-body
|
|
3
|
-
border-radius: $border-card
|
|
4
|
-
padding:
|
|
3
|
+
border-radius: $border-card-s
|
|
4
|
+
padding: .25rem 1rem
|
|
5
5
|
background: var(--alpha50)
|
|
6
|
-
|
|
6
|
+
>*:first-child
|
|
7
|
+
margin-top: .75rem
|
|
7
8
|
a:not([class])
|
|
8
9
|
trans1 all
|
|
9
10
|
border-bottom: 1px solid var(--text)
|
package/source/css/_custom.styl
CHANGED
|
@@ -18,6 +18,9 @@ $ff-codeblock = Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sa
|
|
|
18
18
|
$ff-code = $ff-codeblock
|
|
19
19
|
$ff-logo = $ff-body
|
|
20
20
|
|
|
21
|
+
$iQuoteLeft = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3C!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --%3E%3Cpath fill='currentColor' d='M3.691 6.292C5.094 4.771 7.217 4 10 4h1v2.819l-.804.161c-1.37.274-2.323.813-2.833 1.604A2.9 2.9 0 0 0 6.925 10H10a1 1 0 0 1 1 1v7c0 1.103-.897 2-2 2H3a1 1 0 0 1-1-1v-5l.003-2.919c-.009-.111-.199-2.741 1.688-4.789M20 20h-6a1 1 0 0 1-1-1v-5l.003-2.919c-.009-.111-.199-2.741 1.688-4.789C16.094 4.771 18.217 4 21 4h1v2.819l-.804.161c-1.37.274-2.323.813-2.833 1.604A2.9 2.9 0 0 0 17.925 10H21a1 1 0 0 1 1 1v7c0 1.103-.897 2-2 2'/%3E%3C/svg%3E"
|
|
22
|
+
$iQuoteRight = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3C!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --%3E%3Cpath fill='currentColor' d='M20.309 17.708C22.196 15.66 22.006 13.03 22 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292m-11.007 0C11.19 15.66 10.999 13.03 10.993 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292'/%3E%3C/svg%3E"
|
|
23
|
+
|
|
21
24
|
if hexo-config('style.font-family.body')
|
|
22
25
|
$ff-body = convert(hexo-config('style.font-family.body'))
|
|
23
26
|
|
|
@@ -55,9 +58,10 @@ $fsp3 = 'calc(%s - 3px)' % $fs-body
|
|
|
55
58
|
|
|
56
59
|
$border-card-l = convert(hexo-config('style.border-radius.card-l'))
|
|
57
60
|
$border-card = convert(hexo-config('style.border-radius.card'))
|
|
61
|
+
$border-card-s = convert(hexo-config('style.border-radius.card-s'))
|
|
58
62
|
$border-bar = convert(hexo-config('style.border-radius.bar'))
|
|
59
63
|
$border-image = convert(hexo-config('style.border-radius.image'))
|
|
60
|
-
$border-button =
|
|
64
|
+
$border-button = 8px
|
|
61
65
|
|
|
62
66
|
// 可以动态变化的属性
|
|
63
67
|
:root
|
|
@@ -94,7 +98,7 @@ $border-button = 4px
|
|
|
94
98
|
--gap-max: calc(var(--gap-margin) + var(--gap-padding))
|
|
95
99
|
|
|
96
100
|
// 文章布局风格
|
|
97
|
-
.l_body
|
|
101
|
+
.l_body[type=story]
|
|
98
102
|
--gap-p: 2rem
|
|
99
103
|
div.tag-plugin,p>img
|
|
100
104
|
margin-top: 2.4rem
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
svg-mask-icon($svg)
|
|
2
|
+
-webkit-mask-image: url($svg)
|
|
3
|
+
-webkit-mask-repeat: no-repeat
|
|
4
|
+
-webkit-mask-position: center
|
|
5
|
+
-webkit-mask-size: contain
|
|
6
|
+
mask-image: url($svg)
|
|
7
|
+
mask-repeat: no-repeat
|
|
8
|
+
mask-position: center
|
|
9
|
+
mask-size: contain
|
|
10
|
+
|
|
1
11
|
|
|
2
12
|
// // 可替代 transition 使用
|
|
3
13
|
// transition($op = all, $time = 0.28s, $ease = ease-out)
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// 通用 hsla 函数
|
|
2
|
+
hsla-var(h = var(--hue), s = var(--sat), l = var(--light), a = 1)
|
|
3
|
+
return unquote('hsla(%s, %s, %s, %s)' % (h s l a))
|
|
4
|
+
|
|
1
5
|
// Deprecated function. Keep for compatibility.
|
|
2
6
|
theme($t)
|
|
3
7
|
convert(hexo-config('style.prefers_theme')) == $t
|
|
@@ -43,6 +47,11 @@ _common_root()
|
|
|
43
47
|
--theme-link: $color-link
|
|
44
48
|
--theme-color: $color-theme
|
|
45
49
|
--theme-color-opa: $color-theme-opa
|
|
50
|
+
// new
|
|
51
|
+
--hue: 50
|
|
52
|
+
--sat: 90%
|
|
53
|
+
--light: 80%
|
|
54
|
+
--dynamic-color: hsla-var()
|
|
46
55
|
|
|
47
56
|
_light_root()
|
|
48
57
|
--site-bg: hsl($color-background-h, $color-background-s, $color-background-l)
|
|
@@ -9,7 +9,8 @@ utils.jq(() => {
|
|
|
9
9
|
if (api == null) {
|
|
10
10
|
continue;
|
|
11
11
|
}
|
|
12
|
-
utils.request(el, api,
|
|
12
|
+
utils.request(el, api, async resp => {
|
|
13
|
+
const data = await resp.json();
|
|
13
14
|
data = data.data || [];
|
|
14
15
|
data.forEach((item, i) => {
|
|
15
16
|
var cell = '<div class="timenode" index="' + i + '">';
|
|
@@ -9,7 +9,8 @@ utils.jq(() => {
|
|
|
9
9
|
}
|
|
10
10
|
const default_avatar = def.avatar;
|
|
11
11
|
// layout
|
|
12
|
-
utils.request(el, api,
|
|
12
|
+
utils.request(el, api, async resp => {
|
|
13
|
+
const data = await resp.json();
|
|
13
14
|
const arr = data.article_data || [];
|
|
14
15
|
const limit = el.getAttribute('limit');
|
|
15
16
|
arr.forEach((item, i) => {
|
|
@@ -9,7 +9,8 @@ utils.jq(() => {
|
|
|
9
9
|
}
|
|
10
10
|
const default_avatar = def.avatar;
|
|
11
11
|
// layout
|
|
12
|
-
utils.request(el, api,
|
|
12
|
+
utils.request(el, api, async resp => {
|
|
13
|
+
const data = await resp.json();
|
|
13
14
|
for (let item of (data.content || data)) {
|
|
14
15
|
var cell = `<div class="grid-cell user-card">`;
|
|
15
16
|
cell += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.html_url || item.url}">`;;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
utils.jq(() => {
|
|
2
|
+
$(function () {
|
|
3
|
+
const els = document.getElementsByClassName('ds-friends_and_posts');
|
|
4
|
+
for (var i = 0; i < els.length; i++) {
|
|
5
|
+
const el = els[i];
|
|
6
|
+
const api = el.getAttribute('api');
|
|
7
|
+
if (api == null) {
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
const default_avatar = def.avatar;
|
|
11
|
+
// layout
|
|
12
|
+
utils.request(el, api, async resp => {
|
|
13
|
+
const data = await resp.json();
|
|
14
|
+
for (let item of (data.content || data)) {
|
|
15
|
+
var cell = `<div class="grid-cell user-post-card">`;
|
|
16
|
+
cell += `<div class="avatar-box">`;
|
|
17
|
+
cell += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.html_url || item.url}">`;;
|
|
18
|
+
cell += `<img src="${item.avatar_url || item.avatar || item.icon || default_avatar}" onerror="javascript:this.removeAttribute(\'data-src\');this.src=\'${default_avatar}\';"/>`;
|
|
19
|
+
cell += `<span class="title">${item.title || item.login}</span>`;
|
|
20
|
+
cell += `</a>`;
|
|
21
|
+
cell += `<div class="labels">`;
|
|
22
|
+
for (let label of item.labels) {
|
|
23
|
+
if (label.lightness > 75) {
|
|
24
|
+
cell += `<div class="label" style="background:#${label.color};color:hsla(${label.hue}, ${label.saturation}%, 20%, 1);">${label.name}</div>`;
|
|
25
|
+
} else if (label.saturation > 90 && label.lightness > 40) {
|
|
26
|
+
cell += `<div class="label" style="background:#${label.color};color:hsla(${label.hue}, 50%, 20%, 1);">${label.name}</div>`;
|
|
27
|
+
} else {
|
|
28
|
+
cell += `<div class="label" style="background:#${label.color};color:white">${label.name}</div>`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
cell += `</div>`;
|
|
32
|
+
cell += `</div>`;
|
|
33
|
+
cell += `<div class="previews">`;
|
|
34
|
+
if (item.description) {
|
|
35
|
+
cell += `<div class="desc">${item.description || item.issue_number || ''}</div>`;
|
|
36
|
+
} else {
|
|
37
|
+
cell += `<div class="desc">#${item.issue_number}</div>`;
|
|
38
|
+
}
|
|
39
|
+
cell += `<div class="posts">`;
|
|
40
|
+
if (item.posts?.length > 0) {
|
|
41
|
+
for (let post of item.posts) {
|
|
42
|
+
cell += `<a class="post-link" target="_blank" rel="external nofollow noopener noreferrer" href="${post.link}">`;
|
|
43
|
+
cell += `<span class="title">${post.title}</span>`;
|
|
44
|
+
cell += `<span class="date">${post.published}</span>`;
|
|
45
|
+
cell += `</a>`;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
cell += `<span class="no-post">${item.feed?.length > 0 ? 'RSS 解析失败' : '未设置 RSS 链接'}</span>`;
|
|
49
|
+
}
|
|
50
|
+
cell += `</div>`;
|
|
51
|
+
cell += `</div>`;
|
|
52
|
+
cell += `</div>`;
|
|
53
|
+
$(el).find('.grid-box').append(cell);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -8,7 +8,8 @@ utils.jq(() => {
|
|
|
8
8
|
continue;
|
|
9
9
|
}
|
|
10
10
|
// layout
|
|
11
|
-
utils.request(null, api,
|
|
11
|
+
utils.request(null, api, async resp => {
|
|
12
|
+
const data = await resp.json();
|
|
12
13
|
function fill(data) {
|
|
13
14
|
for (let key of Object.keys(data)) {
|
|
14
15
|
$(el).find("[type=text]#" + key).text(data[key]);
|
|
@@ -9,7 +9,8 @@ utils.jq(() => {
|
|
|
9
9
|
}
|
|
10
10
|
const default_avatar = def.avatar;
|
|
11
11
|
// layout
|
|
12
|
-
utils.request(el, api,
|
|
12
|
+
utils.request(el, api, async resp => {
|
|
13
|
+
const data = await resp.json();
|
|
13
14
|
const limit = el.getAttribute('limit');
|
|
14
15
|
data.forEach((item, i) => {
|
|
15
16
|
if (limit && i >= limit) {
|
|
@@ -3,8 +3,11 @@ utils.jq(() => {
|
|
|
3
3
|
for (var i = 0; i < els.length; i++) {
|
|
4
4
|
const el = els[i];
|
|
5
5
|
const src = `${el.getAttribute('src')}?t=${new Date().getTime()}`;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
console.log('src', src);
|
|
7
|
+
|
|
8
|
+
utils.request(el, src, async resp => {
|
|
9
|
+
const data = await resp.text();
|
|
10
|
+
el.innerHTML = marked.parse(data);
|
|
8
11
|
});
|
|
9
12
|
}
|
|
10
13
|
});
|
|
@@ -9,7 +9,8 @@ utils.jq(() => {
|
|
|
9
9
|
const limit = el.getAttribute('limit');
|
|
10
10
|
const host = api.match(/https:\/\/(.*?)\/(.*)/i)[1];
|
|
11
11
|
|
|
12
|
-
utils.request(el, api, async
|
|
12
|
+
utils.request(el, api, async resp => {
|
|
13
|
+
const data = await resp.json();
|
|
13
14
|
let memos = versionHandlers.identify(data);
|
|
14
15
|
if (memos.version === "feature" )return;
|
|
15
16
|
|
|
@@ -10,18 +10,26 @@ utils.jq(() => {
|
|
|
10
10
|
const default_avatar = def.avatar;
|
|
11
11
|
const default_cover = def.cover;
|
|
12
12
|
// layout
|
|
13
|
-
utils.request(el, api,
|
|
13
|
+
utils.request(el, api, async resp => {
|
|
14
|
+
const data = await resp.json();
|
|
14
15
|
for (let item of data.content) {
|
|
15
16
|
var cell = `<div class="grid-cell site-card">`;
|
|
16
17
|
cell += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`;
|
|
17
|
-
cell += `<img src="${item.cover || item.screenshot}" onerror="javascript:this.removeAttribute(\'data-src\');this.src=\'${default_cover}\';"/>`;
|
|
18
|
+
cell += `<img src="${item.cover || item.snapshot || item.screenshot}" onerror="javascript:this.removeAttribute(\'data-src\');this.src=\'${default_cover}\';"/>`;
|
|
18
19
|
cell += `<div class="info">`;
|
|
19
20
|
cell += `<img src="${item.icon || item.avatar || default_avatar}" onerror="javascript:this.removeAttribute(\'data-src\');this.src=\'${default_avatar}\';"/>`;
|
|
20
21
|
cell += `<span class="title">${item.title}</span>`;
|
|
21
22
|
cell += `<span class="desc">${item.description || item.url}</span>`;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
cell += `</div>`;
|
|
24
|
+
cell += `<div class="labels">`;
|
|
25
|
+
for (let label of item.labels) {
|
|
26
|
+
if (label.lightness > 75) {
|
|
27
|
+
cell += `<div class="label" style="background:#${label.color};color:hsla(${label.hue}, ${label.saturation}%, 20%, 1);">${label.name}</div>`;
|
|
28
|
+
} else if (label.saturation > 90 && label.lightness > 40) {
|
|
29
|
+
cell += `<div class="label" style="background:#${label.color};color:hsla(${label.hue}, 50%, 20%, 1);">${label.name}</div>`;
|
|
30
|
+
} else {
|
|
31
|
+
cell += `<div class="label" style="background:#${label.color};color:white">${label.name}</div>`;
|
|
32
|
+
}
|
|
25
33
|
}
|
|
26
34
|
cell += `</div>`;
|
|
27
35
|
cell += `</a>`;
|
|
@@ -18,7 +18,8 @@ utils.jq(() => {
|
|
|
18
18
|
continue;
|
|
19
19
|
}
|
|
20
20
|
// layout
|
|
21
|
-
utils.request(el, api,
|
|
21
|
+
utils.request(el, api, async resp => {
|
|
22
|
+
const data = await resp.json();
|
|
22
23
|
const query = new URL(api).search;
|
|
23
24
|
const arr = data.content || data;
|
|
24
25
|
var users = [];
|
|
@@ -10,7 +10,8 @@ utils.jq(() => {
|
|
|
10
10
|
}
|
|
11
11
|
const api = apiBase + '/comment?type=recent&count=' + limit;
|
|
12
12
|
const default_avatar = def.avatar;
|
|
13
|
-
utils.request(el, api,
|
|
13
|
+
utils.request(el, api, async resp => {
|
|
14
|
+
const data = await resp.json();
|
|
14
15
|
data.forEach((item, i) => {
|
|
15
16
|
var cell = '<div class="timenode" index="' + i + '">';
|
|
16
17
|
cell += '<div class="header">';
|
|
@@ -9,7 +9,8 @@ utils.jq(() => {
|
|
|
9
9
|
}
|
|
10
10
|
const default_avatar = el.getAttribute('avatar') || def.avatar;
|
|
11
11
|
// layout
|
|
12
|
-
utils.request(el, api,
|
|
12
|
+
utils.request(el, api, async resp => {
|
|
13
|
+
const data = await resp.json();
|
|
13
14
|
const arr = data.tweets || [];
|
|
14
15
|
const limit = el.getAttribute('limit');
|
|
15
16
|
arr.forEach((item, i) => {
|