hexo-theme-stellar 1.32.0 → 1.32.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.
Files changed (115) hide show
  1. package/_config.yml +47 -41
  2. package/layout/_partial/cover/post_cover.ejs +1 -5
  3. package/layout/_partial/cover/wiki_cover.ejs +1 -1
  4. package/layout/_partial/main/footer.ejs +15 -5
  5. package/layout/_partial/main/navbar/article_banner.ejs +1 -1
  6. package/layout/_partial/main/navbar/ghinfo.ejs +1 -1
  7. package/layout/_partial/scripts/defines.ejs +3 -1
  8. package/layout/_partial/scripts/lazyload.ejs +67 -0
  9. package/layout/_partial/scripts/utils.ejs +1 -0
  10. package/layout/_partial/scripts.ejs +1 -0
  11. package/layout/_partial/sidebar/index_leftbar.ejs +1 -1
  12. package/layout/_partial/sidebar/logo.ejs +1 -1
  13. package/layout/_partial/widgets/author.ejs +1 -1
  14. package/layout/_partial/widgets/ghissues.ejs +1 -1
  15. package/layout/_partial/widgets/ghrepo.ejs +2 -2
  16. package/layout/_partial/widgets/ghuser.ejs +2 -2
  17. package/layout/_partial/widgets/markdown.ejs +1 -1
  18. package/layout/_partial/widgets/recent.ejs +1 -1
  19. package/layout/_partial/widgets/related.ejs +1 -1
  20. package/layout/_partial/widgets/timeline.ejs +1 -1
  21. package/layout/_partial/widgets/tree.ejs +1 -1
  22. package/layout/_plugins/scrollreveal.ejs +3 -3
  23. package/package.json +1 -1
  24. package/scripts/events/lib/get_image_ratios.js +53 -31
  25. package/scripts/tags/index.js +1 -1
  26. package/scripts/tags/lib/albums.js +4 -3
  27. package/scripts/tags/lib/banner.js +1 -1
  28. package/scripts/tags/lib/{quote.js → blockquote.js} +5 -5
  29. package/scripts/tags/lib/chat.js +1 -5
  30. package/scripts/tags/lib/friends.js +1 -1
  31. package/scripts/tags/lib/gallery.js +4 -3
  32. package/scripts/tags/lib/image.js +5 -5
  33. package/scripts/tags/lib/link.js +1 -5
  34. package/scripts/tags/lib/md.js +1 -1
  35. package/scripts/tags/lib/navbar.js +2 -2
  36. package/scripts/tags/lib/posters.js +4 -3
  37. package/scripts/tags/lib/sites.js +7 -1
  38. package/scripts/tags/lib/timeline.js +1 -1
  39. package/source/css/_common/base.styl +17 -9
  40. package/source/css/_common/blockquote.styl +1 -1
  41. package/source/css/_common/blur.styl +7 -7
  42. package/source/css/_common/button.styl +2 -2
  43. package/source/css/_common/canonical.styl +1 -1
  44. package/source/css/_common/cap.styl +1 -1
  45. package/source/css/_common/device.styl +4 -4
  46. package/source/css/_common/highlight.styl +7 -2
  47. package/source/css/_common/html.styl +1 -1
  48. package/source/css/_common/svg.styl +1 -1
  49. package/source/css/_common/title.styl +1 -1
  50. package/source/css/_components/layout.styl +2 -2
  51. package/source/css/_components/list.styl +1 -2
  52. package/source/css/_components/main.styl +8 -4
  53. package/source/css/_components/md.styl +2 -2
  54. package/source/css/_components/pages/archives.styl +5 -5
  55. package/source/css/_components/pages/article-story.styl +42 -40
  56. package/source/css/_components/pages/article-tech.styl +2 -2
  57. package/source/css/_components/pages/notebook.styl +2 -2
  58. package/source/css/_components/partial/footer.styl +5 -9
  59. package/source/css/_components/partial/navbar.styl +2 -2
  60. package/source/css/_components/partial/related.styl +6 -6
  61. package/source/css/_components/sidebar/footer.styl +1 -1
  62. package/source/css/_components/sidebar/menu.styl +3 -3
  63. package/source/css/_components/sidebar/search.styl +7 -7
  64. package/source/css/_components/sidebar/sidebar.styl +24 -24
  65. package/source/css/_components/tag-plugins/button.styl +2 -2
  66. package/source/css/_components/tag-plugins/chat.styl +44 -8
  67. package/source/css/_components/tag-plugins/checkbox.styl +1 -1
  68. package/source/css/_components/tag-plugins/copy.styl +13 -8
  69. package/source/css/_components/tag-plugins/friends.styl +5 -6
  70. package/source/css/_components/tag-plugins/friends_posts.styl +8 -7
  71. package/source/css/_components/tag-plugins/gallery.styl +1 -2
  72. package/source/css/_components/tag-plugins/image.styl +1 -1
  73. package/source/css/_components/tag-plugins/inline-labels.styl +3 -3
  74. package/source/css/_components/tag-plugins/navbar.styl +18 -8
  75. package/source/css/_components/tag-plugins/note.styl +0 -3
  76. package/source/css/_components/tag-plugins/okr.styl +2 -3
  77. package/source/css/_components/tag-plugins/override.styl +0 -5
  78. package/source/css/_components/tag-plugins/poetry.styl +1 -1
  79. package/source/css/_components/tag-plugins/quot.styl +1 -25
  80. package/source/css/_components/tag-plugins/quote.styl +1 -1
  81. package/source/css/_components/tag-plugins/read/paper.styl +2 -2
  82. package/source/css/_components/tag-plugins/read/reel.styl +4 -4
  83. package/source/css/_components/tag-plugins/sites.styl +14 -11
  84. package/source/css/_components/tag-plugins/tabs.styl +1 -1
  85. package/source/css/_components/tag-plugins/timeline.styl +10 -4
  86. package/source/css/_components/widgets/components.styl +3 -3
  87. package/source/css/_components/widgets/ghuser.styl +3 -3
  88. package/source/css/_components/widgets/list.styl +2 -2
  89. package/source/css/_components/widgets/markdown.styl +9 -3
  90. package/source/css/_components/widgets/related.styl +3 -3
  91. package/source/css/_components/widgets/tagcloud.styl +2 -2
  92. package/source/css/_components/widgets/timeline.styl +2 -2
  93. package/source/css/_components/widgets/toc.styl +3 -4
  94. package/source/css/_components/widgets/widgets.styl +4 -4
  95. package/source/css/_custom.styl +26 -38
  96. package/source/css/_defines/const.styl +1 -5
  97. package/source/css/_defines/func.styl +4 -4
  98. package/source/css/_defines/theme_base.styl +105 -0
  99. package/source/css/_defines/theme_colorful.styl +117 -0
  100. package/source/css/_plugins/comments/artalk.styl +25 -8
  101. package/source/css/_plugins/comments/twikoo.styl +11 -11
  102. package/source/css/_plugins/comments/waline.styl +2 -2
  103. package/source/css/_plugins/index.styl +1 -2
  104. package/source/css/_plugins/lazyload.styl +40 -50
  105. package/source/css/_plugins/mermaid.styl +1 -1
  106. package/source/css/_plugins/swiper.styl +2 -2
  107. package/source/css/_plugins/tianli_gpt.styl +8 -8
  108. package/source/css/main.styl +2 -1
  109. package/source/js/services/friends.js +1 -0
  110. package/source/js/services/friends_and_posts.js +1 -0
  111. package/source/js/services/sites.js +1 -0
  112. package/source/js/services/timeline.js +1 -0
  113. package/layout/_plugins/lazyload.ejs +0 -21
  114. package/source/css/_components/tag-plugins/common.styl +0 -120
  115. package/source/css/_defines/theme.styl +0 -120
@@ -0,0 +1,105 @@
1
+ // 通用 hsla 函数
2
+ x-hsla(h = var(--hue), s = var(--sat), l = var(--light), a = var(--alpha))
3
+ return unquote('hsla(%s %s %s / %s)' % (h s l a))
4
+
5
+ // 设置不同透明度的主题色
6
+ x-theme-alpha(a = 1)
7
+ return unquote('hsla(%s %s %s / %s)' % (var(--hue) var(--sat) var(--light) a))
8
+
9
+ // 设置基础主题色
10
+ x-set-theme-with-color($color)
11
+ --hue: hue($color)
12
+ --sat: saturation($color)
13
+ --light: lightness($color)
14
+ --alpha: alpha($color)
15
+ --theme: x-theme-alpha(1)
16
+ --theme-a20: x-theme-alpha(0.2)
17
+ --theme-a30: x-theme-alpha(0.3)
18
+
19
+ // 设置链接颜色
20
+ x-set-link-with-color($color)
21
+ $hue = hue($color)
22
+ $sat = saturation($color)
23
+ $light = lightness($color)
24
+ --link: x-hsla($hue, $sat, $light, 1)
25
+ --link-a20: x-hsla($hue, $sat, $light, 0.2)
26
+
27
+ // 设置背景色
28
+ x-set-bg-colors($scheme)
29
+ $hue = $c-base-hue
30
+ $sat = 0%
31
+ $light = $scheme == 'dark' ? 0% : 100%
32
+ --bg-a20: x-hsla($hue, $sat, $light, 0.2)
33
+ --bg-a50: x-hsla($hue, $sat, $light, 0.5)
34
+ --bg-a60: x-hsla($hue, $sat, $light, 0.6)
35
+ --bg-a75: x-hsla($hue, $sat, $light, 0.75)
36
+ --bg-a100: x-hsla($hue, $sat, $light, 1)
37
+
38
+ // 设置文本及相关色
39
+ x-set-text-colors($scheme, $p0 = 1, $p1 = 0.8, $p2 = 0.7, $p3 = 0.5, $p4 = 0.4)
40
+ $hue = $c-base-hue
41
+ $sat = 0%
42
+ $light = $scheme == 'dark' ? 100% : 0%
43
+
44
+ --text: x-hsla($hue, $sat, $light, $p0)
45
+ --text-reverse: x-hsla($hue, $sat, $scheme == 'dark' ? 0% : 100%, $p0)
46
+ --text-p1: x-hsla($hue, $sat, $light, $p1)
47
+ --text-p2: x-hsla($hue, $sat, $light, $p2)
48
+ --text-p3: x-hsla($hue, $sat, $light, $p3)
49
+ --text-p4: x-hsla($hue, $sat, $light, $p4)
50
+
51
+ --text-meta: x-hsla($hue, $sat, $light, 0.2)
52
+ --text-code: x-hsla($hue, $sat, $light, 0.9)
53
+
54
+ --text-a10: x-hsla($hue, $sat, $light, 0.1)
55
+ --text-a20: x-hsla($hue, $sat, $light, 0.2)
56
+
57
+ $sat = $scheme == 'dark' ? 24% : 50%
58
+ $light = $scheme == 'dark' ? 72% : 12%
59
+ $alpha = $scheme == 'dark' ? 0.08 : 0.04
60
+ --block: x-hsla($hue, $sat, $light, $alpha)
61
+ --block-border: x-hsla($hue, $sat, $light, $alpha * 1.5)
62
+
63
+
64
+ // ---------------- apply theme ----------------
65
+ // 设置浅色模式
66
+ dynamic-theme-light()
67
+ $hue = $c-base-hue
68
+ --background: x-hsla($hue, 20%, 98%, 1)
69
+ --card: $site-background ? hsla(white, 0.5) : white
70
+
71
+ x-set-bg-colors('light')
72
+ x-set-text-colors('light')
73
+
74
+ // 设置深色模式
75
+ dynamic-theme-dark()
76
+ $hue = $c-base-hue
77
+ --background: x-hsla($hue, 8%, 12%, 1)
78
+ @media screen and (max-width: $device-mobile-max)
79
+ --background: black
80
+ --card: $site-background ? hsla(white, 0.25) : x-hsla($hue, 10%, 24%, 1)
81
+
82
+ x-set-bg-colors('dark')
83
+ x-set-text-colors('dark')
84
+ --text-code: x-hsla(20, 75, 60, 1)
85
+
86
+
87
+ :root
88
+ // 主题色
89
+ x-set-theme-with-color($c-theme)
90
+ // 强调色
91
+ --accent: $c-accent
92
+ // 链接
93
+ x-set-link-with-color(hsl(207deg, 90%, 54%))
94
+
95
+ // dynamic colors
96
+ dynamic-theme-light()
97
+ @media (prefers-color-scheme: dark)
98
+ dynamic-theme-dark()
99
+
100
+
101
+ :root[data-theme="light"]
102
+ dynamic-theme-light()
103
+ :root[data-theme="dark"]
104
+ dynamic-theme-dark()
105
+
@@ -0,0 +1,117 @@
1
+ // 多彩扩展(文字、链接、边框等都变成彩色)
2
+ x-set-theme-colorful($scheme = 'light', $color, $text = true)
3
+ $hue = hue($color)
4
+ x-set-theme-with-color($color)
5
+ x-set-link-with-color($color)
6
+ if $scheme == 'dark'
7
+ --theme-border: x-hsla($hue, 50%, 24%)
8
+ --theme-block: x-hsla($hue, 24%, 24%)
9
+ --theme-mark: x-hsla($hue, 24%, 24%)
10
+ --theme-codeblock: x-hsla($hue, 12%, 18%)
11
+ if text
12
+ --text: x-hsla($hue, 50%, 75%, 1)
13
+ --text-p1: x-hsla($hue, 50%, 75%, 0.8)
14
+ --text-p2: x-hsla($hue, 80%, 80%, 0.7)
15
+ --text-p3: x-hsla($hue, 80%, 80%, 0.5)
16
+ --text-p4: x-hsla($hue, 80%, 80%, 0.4)
17
+ --link: x-hsla($hue, 80%, 60%, 1)
18
+ --link-a20: x-hsla($hue, 80%, 60%, 0.2)
19
+ else
20
+ --theme-border: x-hsla($hue, 50%, 80%)
21
+ --theme-block: x-hsla($hue, 90%, 92%)
22
+ --theme-mark: x-hsla($hue, 95%, 80%)
23
+ --theme-codeblock: x-hsla($hue, 50%, 95%)
24
+ if text
25
+ --text: x-hsla($hue, 55%, 16%, 1)
26
+ --text-p1: x-hsla($hue, 55%, 16%, 0.8)
27
+ --text-p2: x-hsla($hue, 90%, 20%, 0.7)
28
+ --text-p3: x-hsla($hue, 90%, 20%, 0.5)
29
+ --text-p4: x-hsla($hue, 90%, 20%, 0.4)
30
+ --link: x-hsla($hue, 95%, 32%, 1)
31
+ --link-a20: x-hsla($hue, 95%, 32%, 0.2)
32
+
33
+ .tag-plugin
34
+ --theme-border: var(--block-border)
35
+ --theme-block: var(--block)
36
+ --theme-mark: var(--block)
37
+ --theme-codeblock: var(--block)
38
+
39
+ .colorful[color='red']
40
+ x-set-theme-colorful('light', $c-red)
41
+ .colorful[color='orange']
42
+ x-set-theme-colorful('light', $c-orange)
43
+ .colorful[color='amber']
44
+ x-set-theme-colorful('light', $c-amber)
45
+ .colorful[color='yellow']
46
+ x-set-theme-colorful('light', $c-yellow)
47
+ .colorful[color='green']
48
+ x-set-theme-colorful('light', $c-green)
49
+ .colorful[color='cyan']
50
+ x-set-theme-colorful('light', $c-cyan)
51
+ .colorful[color='blue']
52
+ x-set-theme-colorful('light', $c-blue)
53
+ .colorful[color='purple']
54
+ x-set-theme-colorful('light', $c-purple)
55
+ .colorful[color='theme']
56
+ x-set-theme-colorful('light', $c-theme)
57
+ .colorful[color='accent']
58
+ x-set-theme-colorful('light', $c-accent)
59
+
60
+ .colorful[color='light']
61
+ --theme: white
62
+ --theme-block: var(--theme)
63
+ --theme-mark: var(--theme)
64
+ --theme-codeblock: var(--theme)
65
+ dynamic-theme-light()
66
+
67
+ .colorful[color='dark']
68
+ dynamic-theme-dark()
69
+ --theme: #111
70
+ --theme-border: none
71
+ --theme-block: var(--theme)
72
+ --theme-mark: var(--theme)
73
+ --theme-codeblock: var(--theme)
74
+
75
+ .colorful[color='warning']
76
+ x-set-theme-colorful('light', $c-yellow, false)
77
+ dynamic-theme-light()
78
+ x-set-link-with-color($c-red)
79
+ --theme-border: none
80
+ --theme-block: var(--theme)
81
+ --text-code: var(--text-p1)
82
+
83
+ .colorful[color='error']
84
+ x-set-theme-colorful('dark', $c-red, false)
85
+ dynamic-theme-dark()
86
+ x-set-link-with-color($c-yellow)
87
+ --theme-border: none
88
+ --theme-block: var(--theme)
89
+ --text-code: var(--text-p1)
90
+
91
+ _dark_tags()
92
+ .tag-plugin.tag
93
+ x-set-theme-colorful('dark', $c-theme)
94
+ .colorful[color='red']
95
+ x-set-theme-colorful('dark', $c-red)
96
+ .colorful[color='orange']
97
+ x-set-theme-colorful('dark', $c-orange)
98
+ .colorful[color='amber']
99
+ x-set-theme-colorful('dark', $c-amber)
100
+ .colorful[color='yellow']
101
+ x-set-theme-colorful('dark', $c-yellow)
102
+ .colorful[color='green']
103
+ x-set-theme-colorful('dark', $c-green)
104
+ .colorful[color='cyan']
105
+ x-set-theme-colorful('dark', $c-cyan)
106
+ .colorful[color='blue']
107
+ x-set-theme-colorful('dark', $c-blue)
108
+ .colorful[color='purple']
109
+ x-set-theme-colorful('dark', $c-purple)
110
+
111
+
112
+ :root[data-theme="dark"]
113
+ _dark_tags()
114
+ :root:not([data-theme])
115
+ @media (prefers-color-scheme: dark)
116
+ _dark_tags()
117
+
@@ -7,11 +7,17 @@
7
7
  .atk-header,.atk-editor-user-wrap
8
8
  border-bottom: 1px dashed var(--block-border)
9
9
  padding: 0.5rem 1rem
10
+ margin: 0
10
11
  .atk-editor-user-wrap:empty
11
12
  visibility: hidden
12
13
  padding: 0
13
14
  >.atk-bottom
14
15
  padding: 8px
16
+ .atk-state-btn
17
+ height: 2rem
18
+ border-radius: 100px
19
+ .atk-cancel
20
+ background: none
15
21
  .atk-plug-btn
16
22
  border-radius: 32px
17
23
  height: 2rem
@@ -22,7 +28,7 @@
22
28
  min-width: 5em
23
29
  trans1 all
24
30
  &:hover
25
- --at-color-main: $color-hover
31
+ --at-color-main: var(--accent)
26
32
  &:empty
27
33
  display: none
28
34
  .atk-list-comments-wrap>.atk-comment-wrap
@@ -71,20 +77,31 @@
71
77
  --at-color-sub: var(--text-p3)
72
78
  --at-color-grey: var(--text-p4)
73
79
  --at-color-meta: var(--text-p4)
74
- --at-color-border: var(--block-border)
75
- --at-color-light: var(--theme-link)
80
+ if $site-background
81
+ --at-color-border: transparent
82
+ else
83
+ --at-color-border: var(--block-border)
84
+ --at-color-light: var(--link)
76
85
  --at-color-bg: var(--card)
77
- --at-color-bg-transl: var(--block-border)
86
+ --at-color-bg-transl: var(--card)
78
87
  --at-color-bg-grey: var(--block)
79
- --at-color-bg-grey-transl: orange
80
- --at-color-bg-light: rgba(29, 161, 242, 1)
81
- --at-color-main: $color-theme
88
+ --at-color-bg-grey-transl: var(--block-border)
89
+ --at-color-bg-light: var(--theme)
90
+ --at-color-main: var(--theme)
82
91
  --at-color-red: $c-red
83
92
  --at-color-green: $c-green
84
93
  --at-color-gradient: linear-gradient(180deg, transparent, var(--card), 50%, var(--card))
85
94
 
86
95
  .md-text .atk-comment>.atk-main>.atk-body
87
96
  overflow: visible
97
+ .md-text .artalk pre code, .atk-layer-wrap pre code
98
+ background: none
99
+ .md-text .atk-main-editor>.atk-textarea-wrap>.atk-textarea
100
+ background: none
101
+
102
+ .md-text .atk-notify-wrap .atk-notify
103
+ border-radius: $border-bar
104
+ margin: 8px
88
105
 
89
106
 
90
107
  // override
@@ -113,4 +130,4 @@
113
130
  p
114
131
  color: var(--text-p3)
115
132
  .atk-content a
116
- --at-color-main: var(--theme-link)
133
+ --at-color-main: var(--link)
@@ -1,5 +1,5 @@
1
1
  .cmt-body.twikoo
2
- --twikoo-theme: $color-theme
2
+ --twikoo-theme: var(--theme)
3
3
  margin-top: 1.5rem
4
4
 
5
5
  .tk-content
@@ -38,15 +38,15 @@
38
38
  .el-button:not(.el-button--primary):not(.el-button--text):focus,
39
39
  .el-button:not(.el-button--primary):not(.el-button--text):hover
40
40
  color: var(--twikoo-theme) !important
41
- border-color: var(--theme-link-opa) !important
41
+ border-color: var(--link-a20) !important
42
42
  background-color: var(--block) !important
43
43
  .el-button--primary.is-disabled:active,
44
44
  .el-button--primary.is-disabled:focus,
45
45
  .el-button--primary.is-disabled:hover
46
- background-color: var(--theme-link-opa) !important
46
+ background-color: var(--link-a20) !important
47
47
 
48
48
  .el-button:focus,.el-button:hover
49
- border-color: var(--theme-link-opa)
49
+ border-color: var(--link-a20)
50
50
  .el-button:active
51
51
  color: var(--twikoo-theme)
52
52
  border-color: var(--twikoo-theme)
@@ -58,8 +58,8 @@
58
58
  background-color: var(--twikoo-theme)
59
59
  border-color: var(--twikoo-theme) !important
60
60
  .el-button--primary:focus,.el-button--primary:hover
61
- background: $color-hover
62
- border-color: $color-hover !important
61
+ background: var(--accent)
62
+ border-color: var(--accent) !important
63
63
  .el-button--primary:active
64
64
  background: var(--twikoo-theme)
65
65
  border-color: var(--twikoo-theme)
@@ -70,11 +70,11 @@
70
70
  .el-button--primary.is-disabled:active,
71
71
  .el-button--primary.is-disabled:focus,
72
72
  .el-button--primary.is-disabled:hover
73
- background-color: var(--theme-link-opa) !important
74
- border-color: var(--theme-link-opa) !important
73
+ background-color: var(--link-a20) !important
74
+ border-color: var(--link-a20) !important
75
75
  .el-button--primary.is-plain
76
76
  color: var(--twikoo-theme) !important
77
- border-color: var(--theme-link-opa)
77
+ border-color: var(--link-a20)
78
78
  .el-button--primary.is-plain:focus,
79
79
  .el-button--primary.is-plain:hover
80
80
  background: var(--twikoo-theme) !important
@@ -111,7 +111,7 @@
111
111
  border: none
112
112
  padding: 6px 2rem
113
113
  border-radius: $border-card
114
- background: var(--block-border)
114
+ background: var(--block)
115
115
  color: var(--text-p1)
116
116
  line-height: 2
117
117
  font-size: 14px
@@ -146,7 +146,7 @@
146
146
 
147
147
  .tk-tag-green
148
148
  border: none
149
- background-color: var(--theme-link-opa)
149
+ background-color: var(--link-a20)
150
150
  color: var(--twikoo-theme)
151
151
 
152
152
  .tk-comments-title .tk-comments-count
@@ -9,8 +9,8 @@
9
9
  --waline-light-grey: #999;
10
10
  --waline-dark-grey: #666;
11
11
  /* 主题色 */
12
- --waline-theme-color: $color-theme;
13
- --waline-active-color: $color-hover;
12
+ --waline-theme-color: var(--theme);
13
+ --waline-active-color: var(--accent);
14
14
  /* 布局颜色 */
15
15
  --waline-color: #444;
16
16
  --waline-bgcolor: #fff;
@@ -1,8 +1,7 @@
1
+ @import 'lazyload'
1
2
  @import 'aplayer'
2
3
 
3
4
  // 根据主题配置加载
4
- if hexo-config('plugins.lazyload.enable')
5
- @import 'lazyload'
6
5
  if hexo-config('plugins.swiper.enable')
7
6
  @import 'swiper'
8
7
  if hexo-config('plugins.scrollreveal.enable')
@@ -1,63 +1,53 @@
1
1
  $lazyTransitionType = hexo-config('plugins.lazyload.transition')
2
- $loadingImage = hexo-config('plugins.lazyload.loading_image.src')
3
- $loadingImageSize = convert(hexo-config('plugins.lazyload.loading_image.size'))
4
-
5
- img.lazy
2
+ $loadingImageSize = 2rem
3
+
4
+ .lazy-box
5
+ position: relative
6
+ overflow: hidden
7
+ &.async // 通过 data-service 异步创建的懒加载元素,没办法知道宽高
8
+ background: var(--block)
9
+ min-height: 4rem
10
+
11
+ // 懒加载
12
+ img[data-ll-status]
13
+ z-index: 1
6
14
  &:not(.loaded)
7
15
  opacity: 0
8
16
  &.loaded,&.error
9
17
  opacity: 1
10
18
  if $lazyTransitionType == 'blur'
11
- trans1 all 0.75s
19
+ trans1 all 0.5s
12
20
  &:not(.loaded)
13
- filter blur(50px)
14
- -webkit-filter blur(50px)
21
+ filter blur(20px)
22
+ -webkit-filter blur(20px)
15
23
  &.loaded,&.error
16
24
  filter none
17
25
  -webkit-filter none
18
26
  else
19
27
  trans1 all 0.38s
20
28
 
21
-
22
- @keyframes fadeIn
23
- from { opacity: 0; }
24
- to { opacity: 1; }
25
-
26
- @keyframes blurIn
27
- from
28
- opacity: 0
29
- filter: blur(50px)
30
- -webkit-filter: blur(50px)
31
- to
32
- opacity: 1
33
- filter: blur(0px)
34
- -webkit-filter: blur(0px)
35
-
36
- article img.lazy
37
- &:not(.loaded)
38
- opacity: 1
39
- border-radius: 4px
40
- filter none
41
- transition: none
42
- if $loadingImage
43
- &.loading
44
- background: url($loadingImage) center center / $loadingImageSize no-repeat
45
- else
46
- &.loading
47
- background: url($loadingIcon) center center / $loadingImageSize no-repeat
48
- min-width: $loadingImageSize
49
- min-height: $loadingImageSize
50
-
51
- &.loaded
52
- animation: fadeIn 0.38s ease-out
53
- if $loadingImage
54
- background: none
55
- if $lazyTransitionType == 'blur'
56
- &.loaded
57
- animation: blurIn .75s ease-out
58
-
59
- &.error
60
- background: none
61
- min-width: $loadingImageSize
62
- min-height: $loadingImageSize
63
-
29
+ // 加载占位动画
30
+ img[data-ll-status]+.lazy-icon
31
+ position: absolute
32
+ width: $loadingImageSize
33
+ height: $loadingImageSize
34
+ max-width: 100%
35
+ max-height: 100%
36
+ top: 50%
37
+ left: 50%
38
+ transform: translateX(-50%) translateY(-50%)
39
+ background-size: contain
40
+ background-repeat: no-repeat
41
+ background-position: center
42
+
43
+ // 加载完成
44
+ img[data-ll-status].loaded
45
+ &+.lazy-icon
46
+ display: none
47
+
48
+ // 加载失败
49
+ img[data-ll-status].error
50
+ min-width: $loadingImageSize
51
+ min-height: $loadingImageSize
52
+ &+.lazy-icon
53
+ display: none
@@ -9,7 +9,7 @@ pre.mermaid
9
9
 
10
10
  .mermaid .edgeLabel
11
11
  padding: 4px
12
- background-color: var(--site-bg) !important
12
+ background-color: var(--background) !important
13
13
 
14
14
  .mermaid rect.basic.label-container
15
15
  stroke: var(--block-border) !important
@@ -1,5 +1,5 @@
1
1
  :root
2
- --swiper-theme-color: $color-theme !important
2
+ --swiper-theme-color: var(--theme) !important
3
3
  .swiper
4
4
  width: 100%
5
5
  border-radius: 4px
@@ -47,7 +47,7 @@ div.swiper-slide
47
47
  color: var(--swiper-theme-color)
48
48
  &:hover
49
49
  background: white !important
50
- --swiper-theme-color: $color-hover !important
50
+ --swiper-theme-color: var(--accent) !important
51
51
 
52
52
  .swiper-button-prev:after
53
53
  transform: translateX(-1px)
@@ -1,7 +1,7 @@
1
1
  :root
2
2
  --ai-font-color var(--text-p2)
3
3
  --ai-post-bg var(--block)
4
- --ai-content-bg var(--site-bg)
4
+ --ai-content-bg var(--background)
5
5
  --ai-content-border 1px solid var(--block-border)
6
6
  --ai-border 1px solid var(--block-border)
7
7
  --ai-tag-bg var(--card)
@@ -100,7 +100,7 @@
100
100
  cursor pointer
101
101
 
102
102
  #post-ai .ai-btn-item:hover
103
- background var(--theme-link)
103
+ background var(--link)
104
104
 
105
105
  #post-ai .ai-recommend
106
106
  display flex
@@ -112,9 +112,9 @@
112
112
  margin-top 2px
113
113
 
114
114
  #post-ai .ai-recommend-item a
115
- border-bottom 2px solid var(--theme-link)
115
+ border-bottom 2px solid var(--link)
116
116
  padding 0 .2em
117
- color var(--theme-link)
117
+ color var(--link)
118
118
  font-weight 700
119
119
  text-decoration none
120
120
  transition all 0.3s
@@ -124,8 +124,8 @@
124
124
  -o-transition all 0.3s
125
125
 
126
126
  #post-ai .ai-recommend-item a:hover
127
- background-color var(--theme-link)
128
- border-bottom 2px solid var(--theme-link)
127
+ background-color var(--link)
128
+ border-bottom 2px solid var(--link)
129
129
  color #fff
130
130
  border-radius 5px
131
131
 
@@ -159,7 +159,7 @@
159
159
  opacity 0
160
160
 
161
161
  #post-ai .ai-Toggle:hover
162
- background $color-theme
162
+ background var(--theme)
163
163
 
164
164
  #post-ai .ai-speech-box
165
165
  width 21px
@@ -193,7 +193,7 @@
193
193
  transition .3s
194
194
 
195
195
  #post-ai .ai-speech-box:hover .ai-speech-content
196
- background $color-theme
196
+ background var(--theme)
197
197
 
198
198
  @keyframes ai_breathe
199
199
  0%
@@ -5,7 +5,8 @@
5
5
  @import '_custom'
6
6
 
7
7
  // 含自定义参数的常量以及函数
8
- @import '_defines/theme'
8
+ @import '_defines/theme_base'
9
+ @import '_defines/theme_colorful'
9
10
  @import '_defines/func'
10
11
 
11
12
  // 通用组件
@@ -26,6 +26,7 @@ utils.jq(() => {
26
26
  cell += `</div>`;
27
27
  $(el).find('.grid-box').append(cell);
28
28
  }
29
+ window.wrapLazyloadImages(el);
29
30
  });
30
31
  }
31
32
  });
@@ -52,6 +52,7 @@ utils.jq(() => {
52
52
  cell += `</div>`;
53
53
  $(el).find('.grid-box').append(cell);
54
54
  }
55
+ window.wrapLazyloadImages(el);
55
56
  });
56
57
  }
57
58
  });
@@ -36,6 +36,7 @@ utils.jq(() => {
36
36
  cell += `</div>`;
37
37
  $(el).find('.grid-box').append(cell);
38
38
  }
39
+ window.wrapLazyloadImages(el);
39
40
  });
40
41
  }
41
42
  });
@@ -101,6 +101,7 @@ utils.jq(() => {
101
101
  cell += '</div>';
102
102
  $(el).append(cell);
103
103
  });
104
+ window.wrapLazyloadImages(el);
104
105
  });
105
106
  }
106
107
  });
@@ -1,21 +0,0 @@
1
- <script defer src="<%- conf.js %>"></script>
2
- <script>
3
- // https://www.npmjs.com/package/vanilla-lazyload
4
- // Set the options globally
5
- // to make LazyLoad self-initialize
6
- window.lazyLoadOptions = {
7
- elements_selector: ".lazy",
8
- };
9
- // Listen to the initialization event
10
- // and get the instance of LazyLoad
11
- window.addEventListener(
12
- "LazyLoad::Initialized",
13
- function (event) {
14
- window.lazyLoadInstance = event.detail.instance;
15
- },
16
- false
17
- );
18
- document.addEventListener('DOMContentLoaded', function () {
19
- window.lazyLoadInstance?.update();
20
- });
21
- </script>