hexo-theme-stellar 1.30.1 → 1.30.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 (66) hide show
  1. package/_config.yml +34 -25
  2. package/layout/_partial/main/article/article_footer.ejs +1 -1
  3. package/layout/_partial/main/navbar/nav_tabs_blog.ejs +4 -0
  4. package/layout/_partial/main/navbar/nav_tabs_wiki.ejs +4 -0
  5. package/layout/_partial/main/post_list/post_card.ejs +4 -3
  6. package/layout/_partial/menubtn.ejs +1 -1
  7. package/layout/_partial/scripts/utils.ejs +1 -1
  8. package/layout/layout.ejs +1 -1
  9. package/layout/page.ejs +1 -1
  10. package/package.json +1 -1
  11. package/scripts/tags/inline-labels.js +3 -0
  12. package/scripts/tags/lib/okr.js +6 -6
  13. package/scripts/tags/lib/quot.js +16 -15
  14. package/source/css/_common/base.styl +1 -1
  15. package/source/css/_common/blockquote.styl +16 -5
  16. package/source/css/_common/blur.styl +2 -2
  17. package/source/css/_common/device.styl +12 -21
  18. package/source/css/_common/pre.styl +1 -0
  19. package/source/css/_components/layout.styl +12 -4
  20. package/source/css/_components/list.styl +4 -1
  21. package/source/css/_components/md.styl +3 -46
  22. package/source/css/_components/pages/article-indent.styl +6 -0
  23. package/source/css/_components/pages/article-story.styl +120 -0
  24. package/source/css/_components/pages/article-tech.styl +35 -0
  25. package/source/css/_components/partial/article-banner.styl +12 -7
  26. package/source/css/_components/partial/article-footer.styl +25 -15
  27. package/source/css/_components/partial/navbar.styl +31 -50
  28. package/source/css/_components/partial/related.styl +1 -1
  29. package/source/css/_components/sidebar/sidebar.styl +3 -2
  30. package/source/css/_components/tag-plugins/button.styl +11 -11
  31. package/source/css/_components/tag-plugins/common.styl +7 -4
  32. package/source/css/_components/tag-plugins/friends_posts.styl +2 -2
  33. package/source/css/_components/tag-plugins/inline-labels.styl +5 -0
  34. package/source/css/_components/tag-plugins/link.styl +2 -1
  35. package/source/css/_components/tag-plugins/mark.styl +1 -1
  36. package/source/css/_components/tag-plugins/mdrender.styl +15 -0
  37. package/source/css/_components/tag-plugins/note.styl +4 -1
  38. package/source/css/_components/tag-plugins/poetry.styl +2 -0
  39. package/source/css/_components/tag-plugins/quot.styl +51 -25
  40. package/source/css/_components/tag-plugins/sites.styl +1 -0
  41. package/source/css/_components/tag-plugins/tabs.styl +8 -10
  42. package/source/css/_components/tag-plugins/timeline.styl +12 -20
  43. package/source/css/_components/widgets/ghrepo.styl +1 -1
  44. package/source/css/_components/widgets/ghuser.styl +1 -1
  45. package/source/css/_components/widgets/markdown.styl +4 -3
  46. package/source/css/_components/widgets/related.styl +1 -1
  47. package/source/css/_components/widgets/tagcloud.styl +1 -1
  48. package/source/css/_components/widgets/timeline.styl +1 -1
  49. package/source/css/_components/widgets/toc.styl +1 -1
  50. package/source/css/_components/widgets/widgets.styl +1 -1
  51. package/source/css/_custom.styl +6 -2
  52. package/source/css/_defines/const.styl +4 -0
  53. package/source/css/_defines/func.styl +37 -0
  54. package/source/css/_defines/theme.styl +9 -0
  55. package/source/js/services/artalk_latest_comment.js +2 -1
  56. package/source/js/services/fcircle.js +2 -1
  57. package/source/js/services/friends.js +2 -1
  58. package/source/js/services/friends_and_posts.js +2 -1
  59. package/source/js/services/ghinfo.js +2 -1
  60. package/source/js/services/giscus_latest_comment.js +2 -1
  61. package/source/js/services/mdrender.js +5 -2
  62. package/source/js/services/memos.js +2 -1
  63. package/source/js/services/sites.js +2 -1
  64. package/source/js/services/timeline.js +2 -1
  65. package/source/js/services/waline_latest_comment.js +2 -1
  66. package/source/js/services/weibo.js +2 -1
@@ -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
- .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
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 .content[type=icon]
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
@@ -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: $border-card
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
- border-bottom: 2px solid $color-theme
127
+ padding-bottom: 0.75rem
128
+ display: inline-block
123
129
  trans1 all
124
- background: none
125
130
  &:hover
126
- background: none
127
- border-radius: 0
128
- border-bottom: 2px solid $color-hover
129
- >p:first-child:not([class]) a:not([class])
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
@@ -4,7 +4,7 @@
4
4
  padding: 0.75rem 0.5rem
5
5
  color: var(--text-p2)
6
6
  background: var(--card)
7
- border-radius: $border-card
7
+ border-radius: $border-card-s
8
8
  hoverable-card()
9
9
  >div+div
10
10
  margin-top: 0.5rem
@@ -4,7 +4,7 @@
4
4
  .widget-wrapper.user-card .widget-body
5
5
  text-align: center
6
6
  background: var(--card)
7
- border-radius: $border-card
7
+ border-radius: $border-card-s
8
8
  padding: 1rem
9
9
  box-shadow: $boxshadow-card
10
10
 
@@ -1,9 +1,10 @@
1
1
  .widget-wrapper.markdown
2
2
  .widget-body
3
- border-radius: $border-card
4
- padding: 4px 16px
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)
@@ -7,7 +7,7 @@
7
7
  line-height: 1.2
8
8
  background: var(--alpha20)
9
9
  padding: 10px 16px
10
- border-radius: $border-card
10
+ border-radius: $border-card-s
11
11
  display: block
12
12
  border-left: 0
13
13
  box-sizing: border-box
@@ -1,5 +1,5 @@
1
1
  .widget-wrapper.tagcloud .widget-body
2
- border-radius: $border-card
2
+ border-radius: $border-card-s
3
3
  padding: 12px 16px
4
4
  background: var(--alpha50)
5
5
  a
@@ -24,7 +24,7 @@
24
24
  .header:before
25
25
  left: calc(6px - var(--gap-padding))
26
26
  .body
27
- border-radius: $border-card
27
+ border-radius: $border-card-s
28
28
  padding: 0.5rem 1rem
29
29
  p,li
30
30
  --fsp: $fsp3
@@ -55,7 +55,7 @@
55
55
  padding: 16px 0
56
56
  &:first-child
57
57
  top: 8px
58
- padding-top: 8px
58
+ padding-top: 1rem
59
59
  .widget-body .toc
60
60
  max-height: 70vh
61
61
  @media screen and (max-width: $device-laptop)
@@ -77,7 +77,7 @@
77
77
  @media screen and (max-width: $device-laptop)
78
78
  .widget-wrapper
79
79
  margin-top: var(--gap-margin)
80
- border-radius: $border-card
80
+ border-radius: $border-card-s
81
81
  // 大屏幕
82
82
  @media screen and (min-width: $device-laptop)
83
83
  .widget-wrapper.markdown .widget-body
@@ -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 = 4px
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.story
101
+ .l_body[type=story]
98
102
  --gap-p: 2rem
99
103
  div.tag-plugin,p>img
100
104
  margin-top: 2.4rem
@@ -1,6 +1,7 @@
1
1
  // 用来进行设备适配,请勿修改
2
2
  $device-mobile-375 = 375px
3
3
  $device-mobile-425 = 425px
4
+ $device-mobile-iphone-max = 450px
4
5
  $device-mobile = 500px
5
6
  $device-mobile-max = 667px
6
7
  $device-tablet = 768px
@@ -48,3 +49,6 @@ $c-green = #3DC550
48
49
  $c-cyan = #1BCDFC
49
50
  $c-blue = #2196f3
50
51
  $c-purple = #9c27b0
52
+
53
+ $hue-yellow = 50
54
+ $cDeepOrange = hsl(14 100% 57%)
@@ -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)
@@ -122,3 +132,30 @@ hoverable-card()
122
132
  onlight()
123
133
  @media (prefers-color-scheme: dark)
124
134
  ondark()
135
+
136
+ newblur()
137
+ box-shadow: 0 0 2px rgba(black, .05), 0 0 8px rgba(black, .05)
138
+ trans1: all
139
+ &:before,&:after
140
+ z-index -1
141
+ position: absolute
142
+ pointer-events: none
143
+ content: ''
144
+ left: 0
145
+ right: 0
146
+ top: 0
147
+ bottom: 0
148
+ border-radius: 64px
149
+ &:before
150
+ backdrop-filter: blur(8px)
151
+ &:after
152
+ --blur-px: 16px
153
+ --blur-sat: 500%
154
+ background: var(--alpha50)
155
+ backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
156
+ mask: linear-gradient(rgba(white, 1), 10%, rgba(white, 0.2), 90%, rgba(white, 1)), linear-gradient(90deg, rgba(white, 1), 10%, rgba(white, 0.2), 90%, rgba(white, 1))
157
+ box-shadow: inset 0 0 8px 1px white
158
+ trans1 all
159
+ @media (prefers-color-scheme: dark)
160
+ opacity 0.4
161
+ background: var(--alpha20)
@@ -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, function (data) {
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, function(data) {
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, function(data) {
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}">`;;
@@ -9,7 +9,8 @@ utils.jq(() => {
9
9
  }
10
10
  const default_avatar = def.avatar;
11
11
  // layout
12
- utils.request(el, api, function(data) {
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-post-card">`;
15
16
  cell += `<div class="avatar-box">`;
@@ -8,7 +8,8 @@ utils.jq(() => {
8
8
  continue;
9
9
  }
10
10
  // layout
11
- utils.request(null, api, function(data) {
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, function(data) {
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
- utils.request(el, src, function(data) {
7
- el.innerHTML = marked.parse(resp.data);
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 data => {
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,7 +10,8 @@ utils.jq(() => {
10
10
  const default_avatar = def.avatar;
11
11
  const default_cover = def.cover;
12
12
  // layout
13
- utils.request(el, api, function(data) {
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}">`;
@@ -18,7 +18,8 @@ utils.jq(() => {
18
18
  continue;
19
19
  }
20
20
  // layout
21
- utils.request(el, api, function(data) {
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, function(data) {
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, function(data) {
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) => {