hexo-theme-stellar 1.18.1 → 1.18.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 +17 -3
- package/layout/404.ejs +1 -1
- package/layout/_partial/cover/wiki_cover.ejs +1 -1
- package/package.json +1 -1
- package/scripts/tags/lib/tabs.js +2 -2
- package/source/css/_common/base.styl +2 -2
- package/source/css/_common/blockquote.styl +2 -2
- package/source/css/_common/button.styl +38 -2
- package/source/css/_common/highlight.styl +11 -10
- package/source/css/_custom.styl +17 -8
- package/source/css/_defines/func.styl +1 -1
- package/source/css/_defines/theme.styl +1 -3
- package/source/css/_layout/list.styl +0 -1
- package/source/css/_layout/md.styl +5 -3
- package/source/css/_layout/pages/archives.styl +1 -1
- package/source/css/_layout/pages/error.styl +0 -1
- package/source/css/_layout/partial/related.styl +1 -1
- package/source/css/_layout/sidebar/header.styl +1 -1
- package/source/css/_layout/sidebar/sidebar.styl +2 -1
- package/source/css/_layout/tag-plugins/checkbox.styl +3 -4
- package/source/css/_layout/tag-plugins/common.styl +6 -6
- package/source/css/_layout/tag-plugins/copy.styl +1 -1
- package/source/css/_layout/tag-plugins/folders.styl +1 -1
- package/source/css/_layout/tag-plugins/folding.styl +5 -4
- package/source/css/_layout/tag-plugins/grid.styl +4 -1
- package/source/css/_layout/tag-plugins/link.styl +1 -1
- package/source/css/_layout/tag-plugins/note.styl +9 -10
- package/source/css/_layout/tag-plugins/quot.styl +3 -1
- package/source/css/_layout/tag-plugins/tabs.styl +2 -2
- package/source/css/_layout/tag-plugins/timeline.styl +1 -5
- package/source/css/_layout/tag-plugins/toc.styl +1 -1
- package/source/css/_layout/widgets/search.styl +27 -18
- package/source/css/_layout/widgets/toc_wiki.styl +1 -1
- package/source/css/_plugins/swiper.styl +10 -3
- package/source/js/main.js +24 -2
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.18.
|
|
3
|
+
version: '1.18.2'
|
|
4
4
|
homepage: 'https://xaoxuu.com/wiki/stellar/'
|
|
5
5
|
repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
|
|
6
6
|
cdn_css: # Use cdn links instead of /css/main.css
|
|
@@ -197,9 +197,10 @@ footer:
|
|
|
197
197
|
|
|
198
198
|
######## Tag Plugins ########
|
|
199
199
|
tag_plugins:
|
|
200
|
-
# {%
|
|
200
|
+
# {% ablock %} / {% note %}
|
|
201
201
|
note:
|
|
202
202
|
default_color: '' # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
|
|
203
|
+
border: true # true / false
|
|
203
204
|
# {% checkbox %}
|
|
204
205
|
checkbox:
|
|
205
206
|
interactive: false # enable interactive for user
|
|
@@ -319,12 +320,22 @@ plugins:
|
|
|
319
320
|
style:
|
|
320
321
|
darkmode: auto # auto / always / false
|
|
321
322
|
smooth_scroll: true # true / false
|
|
322
|
-
font-size:
|
|
323
|
+
font-size:
|
|
324
|
+
root: 16px
|
|
325
|
+
body: .9375rem # 15px
|
|
326
|
+
code: 85% # 14px
|
|
327
|
+
codeblock: 0.8125rem # 13px
|
|
323
328
|
font-family:
|
|
324
329
|
logo: 'system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif'
|
|
325
330
|
body: 'system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif'
|
|
326
331
|
code: 'Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif'
|
|
332
|
+
codeblock: 'Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif'
|
|
327
333
|
text-align: left
|
|
334
|
+
border-radius:
|
|
335
|
+
card: 12px
|
|
336
|
+
block: 12px
|
|
337
|
+
bar: 6px
|
|
338
|
+
image: 6px
|
|
328
339
|
color:
|
|
329
340
|
# 动态颜色(会根据明暗主题重设明度值,只用关心色相和饱和度即可)
|
|
330
341
|
background: 'hsl(212 16% 98%)' # 浅色背景颜色
|
|
@@ -346,6 +357,9 @@ style:
|
|
|
346
357
|
loading:
|
|
347
358
|
loading: 正在加载
|
|
348
359
|
error: 加载失败,请稍后重试。
|
|
360
|
+
gradient: # https://webgradients.com/
|
|
361
|
+
start: 'linear-gradient(to right, #92fe9d 0%, #00c9ff 50%, #92fe9d 100%)'
|
|
362
|
+
search: 'linear-gradient(to right, #04F3FF, #08FFC6, #DDF730, #FFBD19, #FF1FE0, #C418FF, #04F3FF)'
|
|
349
363
|
|
|
350
364
|
default:
|
|
351
365
|
avatar: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg
|
package/layout/404.ejs
CHANGED
|
@@ -16,6 +16,6 @@ page.robots = 'none';
|
|
|
16
16
|
<%- __('page.error.why') %>
|
|
17
17
|
</p>
|
|
18
18
|
<br><br>
|
|
19
|
-
<a class='button
|
|
19
|
+
<a class='button' id='back' href="<%- config.root %>"><%- __('page.error.action') %></a>
|
|
20
20
|
</article>
|
|
21
21
|
<%- partial('_partial/plugins/comments/layout') %>
|
|
@@ -39,7 +39,7 @@ function layoutWikiCover() {
|
|
|
39
39
|
el += '<div class="description">' + desc + '</div>';
|
|
40
40
|
}
|
|
41
41
|
el += '<div class="start-wrap">';
|
|
42
|
-
el += '<a class="button
|
|
42
|
+
el += '<a class="button start gradient" href="#start">' + (proj.start || __('btn.getting_started')) + '</a>';
|
|
43
43
|
el += '</div>';
|
|
44
44
|
el += '</article>';
|
|
45
45
|
el += '</div>';
|
package/package.json
CHANGED
package/scripts/tags/lib/tabs.js
CHANGED
|
@@ -39,11 +39,11 @@ module.exports = ctx => function(args, content = '') {
|
|
|
39
39
|
const abbr = tabName + ' ' + ++tabId
|
|
40
40
|
const href = abbr.toLowerCase().split(' ').join('-')
|
|
41
41
|
const isActive = (tabActive > 0 && tabActive === tabId) || (tabActive === 0 && tabId === 1) ? ' active' : ''
|
|
42
|
-
tabNav += `<
|
|
42
|
+
tabNav += `<div class="tab${isActive}"><a href="#${href}">${tab.header || abbr}</a></div>`
|
|
43
43
|
tabContent += `<div class="tab-pane${isActive}" id="${href}">${content}</div>`
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
tabNav = `<
|
|
46
|
+
tabNav = `<div class="nav-tabs">${tabNav}</div>`
|
|
47
47
|
tabContent = `<div class="tab-content">${tabContent}</div>`
|
|
48
48
|
|
|
49
49
|
var el = ''
|
|
@@ -2,9 +2,9 @@ blockquote
|
|
|
2
2
|
display: block
|
|
3
3
|
margin-left: 0
|
|
4
4
|
margin-right: 0
|
|
5
|
-
padding: 0.
|
|
5
|
+
padding: 0.25rem 0.75rem
|
|
6
6
|
background: var(--block)
|
|
7
7
|
$bd-left = 4px
|
|
8
8
|
border-left: $bd-left solid var(--text-meta)
|
|
9
|
-
border-radius: $bd-left $border-
|
|
9
|
+
border-radius: $bd-left $border-bar $border-bar $bd-left
|
|
10
10
|
color: var(--text-p2)
|
|
@@ -9,14 +9,50 @@ a.button
|
|
|
9
9
|
font-weight: 500
|
|
10
10
|
line-height: 1
|
|
11
11
|
padding: 0.75rem 2rem
|
|
12
|
-
border-radius:
|
|
13
|
-
trans1: background
|
|
12
|
+
border-radius: $border-button
|
|
14
13
|
font-size: $fs-15
|
|
14
|
+
user-select: none
|
|
15
15
|
&.theme
|
|
16
16
|
background: $color-theme
|
|
17
17
|
color: var(--card)
|
|
18
18
|
&:hover
|
|
19
19
|
background: $color-hover
|
|
20
|
+
&.start
|
|
21
|
+
border-radius: 100px
|
|
22
|
+
background: var(--text-p1)
|
|
23
|
+
color: var(--card)
|
|
20
24
|
|
|
21
25
|
a[onclick]:hover
|
|
22
26
|
cursor: pointer
|
|
27
|
+
|
|
28
|
+
a.button.start.gradient
|
|
29
|
+
transition: 0.38s ease-out
|
|
30
|
+
position relative
|
|
31
|
+
z-index: 0
|
|
32
|
+
background: convert(hexo-config('style.gradient.start'))
|
|
33
|
+
background-size: 1000%
|
|
34
|
+
color: white
|
|
35
|
+
animation: glow 60s linear infinite
|
|
36
|
+
@keyframes glow {
|
|
37
|
+
from {
|
|
38
|
+
background-position: 0%
|
|
39
|
+
}
|
|
40
|
+
to {
|
|
41
|
+
background-position: 1000%
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
&:after
|
|
45
|
+
content: ''
|
|
46
|
+
position absolute
|
|
47
|
+
left: 0
|
|
48
|
+
right: 0
|
|
49
|
+
top: 0
|
|
50
|
+
bottom: 0
|
|
51
|
+
border-radius: 100px
|
|
52
|
+
background: inherit
|
|
53
|
+
z-index -1
|
|
54
|
+
filter: blur(36px)
|
|
55
|
+
transition: 0.38s ease-out
|
|
56
|
+
opacity 0
|
|
57
|
+
&:hover:after
|
|
58
|
+
opacity 1
|
|
@@ -4,7 +4,7 @@ code
|
|
|
4
4
|
font-family: $ff-code
|
|
5
5
|
|
|
6
6
|
p>code:not([class]),li>code:not([class])
|
|
7
|
-
font-size:
|
|
7
|
+
font-size: $fs-code
|
|
8
8
|
background: var(--block)
|
|
9
9
|
padding: .2em
|
|
10
10
|
border-radius: 4px
|
|
@@ -16,7 +16,7 @@ p>code:not([class]),li>code:not([class])
|
|
|
16
16
|
overflow: hidden
|
|
17
17
|
background: var(--block)
|
|
18
18
|
line-height: 1.5
|
|
19
|
-
font-family: $ff-
|
|
19
|
+
font-family: $ff-codeblock
|
|
20
20
|
box-sizing: border-box
|
|
21
21
|
@media screen and (min-width: $device-mobile)
|
|
22
22
|
min-width: 180px
|
|
@@ -27,15 +27,16 @@ p>code:not([class]),li>code:not([class])
|
|
|
27
27
|
display: block
|
|
28
28
|
figcaption
|
|
29
29
|
color: var(--text-p2)
|
|
30
|
-
font-size: $fs-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
background: var(--block-hover)
|
|
35
|
-
border-top-left-radius: "calc(%s - 1px)" % $border-block
|
|
36
|
-
border-top-right-radius: "calc(%s - 1px)" % $border-block
|
|
30
|
+
font-size: $fs-codeblock
|
|
31
|
+
font-weight: 500
|
|
32
|
+
margin-left: 0.5rem
|
|
33
|
+
display: inline-block
|
|
37
34
|
span
|
|
38
|
-
|
|
35
|
+
padding: 4px 0.5rem
|
|
36
|
+
display: block
|
|
37
|
+
border-bottom-left-radius: $border-bar
|
|
38
|
+
border-bottom-right-radius: $border-bar
|
|
39
|
+
background: var(--block-hover)
|
|
39
40
|
>table
|
|
40
41
|
overflow: auto
|
|
41
42
|
display: block
|
package/source/css/_custom.styl
CHANGED
|
@@ -20,7 +20,8 @@ $color-text = convert(hexo-config('style.color.text'))
|
|
|
20
20
|
// font-style: normal
|
|
21
21
|
|
|
22
22
|
$ff-body = system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif
|
|
23
|
-
$ff-
|
|
23
|
+
$ff-codeblock = Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif
|
|
24
|
+
$ff-code = $ff-codeblock
|
|
24
25
|
$ff-logo = $ff-body
|
|
25
26
|
|
|
26
27
|
if hexo-config('style.font-family.body')
|
|
@@ -29,12 +30,15 @@ if hexo-config('style.font-family.body')
|
|
|
29
30
|
if hexo-config('style.font-family.code')
|
|
30
31
|
$ff-code = convert(hexo-config('style.font-family.code'))
|
|
31
32
|
|
|
33
|
+
if hexo-config('style.font-family.codeblock')
|
|
34
|
+
$ff-codeblock = convert(hexo-config('style.font-family.codeblock'))
|
|
35
|
+
|
|
32
36
|
if hexo-config('style.font-family.logo')
|
|
33
37
|
$ff-logo = convert(hexo-config('style.font-family.logo'))
|
|
34
38
|
|
|
35
39
|
|
|
36
40
|
// font size
|
|
37
|
-
$fs-root = convert(hexo-config('style.font-size'))
|
|
41
|
+
$fs-root = convert(hexo-config('style.font-size.root'))
|
|
38
42
|
$fs-15 = .9375rem
|
|
39
43
|
$fs-14 = .875rem
|
|
40
44
|
$fs-13 = .8125rem
|
|
@@ -46,19 +50,24 @@ $fs-h3 = 1.375rem // 22px
|
|
|
46
50
|
$fs-h4 = 1.125rem // 18px
|
|
47
51
|
$fs-h5 = $fs-15
|
|
48
52
|
$fs-h6 = $fs-12
|
|
49
|
-
$fs-p =
|
|
50
|
-
$fs-code =
|
|
53
|
+
$fs-p = convert(hexo-config('style.font-size.body'))
|
|
54
|
+
$fs-code = convert(hexo-config('style.font-size.code'))
|
|
55
|
+
$fs-codeblock = convert(hexo-config('style.font-size.codeblock'))
|
|
56
|
+
|
|
51
57
|
|
|
52
|
-
$border-card =
|
|
53
|
-
$border-block =
|
|
54
|
-
$border-
|
|
58
|
+
$border-card = convert(hexo-config('style.border-radius.card'))
|
|
59
|
+
$border-block = convert(hexo-config('style.border-radius.block'))
|
|
60
|
+
$border-bar = convert(hexo-config('style.border-radius.bar'))
|
|
61
|
+
$border-image = convert(hexo-config('style.border-radius.image'))
|
|
62
|
+
$border-button = 4px
|
|
55
63
|
|
|
56
64
|
// 可以动态变化的属性
|
|
57
65
|
:root
|
|
58
66
|
--width-left: 288px
|
|
59
67
|
--width-main: 720px
|
|
60
68
|
--gap-l: 16px
|
|
61
|
-
--gap-p:
|
|
69
|
+
--gap-p: 1rem // gap for paragraph
|
|
70
|
+
--gap-p-compact: 0.75rem
|
|
62
71
|
// desktop 2k or larger
|
|
63
72
|
@media screen and (min-width: $device-2k)
|
|
64
73
|
--gap-l: 32px
|
|
@@ -38,7 +38,6 @@ set_text_light()
|
|
|
38
38
|
--block: hsl($color-block-h, $color-block-s, 95)
|
|
39
39
|
--block-border: hsl($color-block-h, $color-block-s, 90)
|
|
40
40
|
--block-hover: hsl($color-block-h, $color-block-s, 92)
|
|
41
|
-
--block-lighten: hsl($color-block-h, $color-block-s, 100)
|
|
42
41
|
set_text_dark()
|
|
43
42
|
--theme-bg2: $color-theme
|
|
44
43
|
--theme-link: $color-link
|
|
@@ -46,11 +45,10 @@ set_text_light()
|
|
|
46
45
|
set_darkmode()
|
|
47
46
|
:root
|
|
48
47
|
--site-bg: hsl($color-background-h, $color-background-s * 0.5, (100 - $color-background-l) * 2 + 8)
|
|
49
|
-
--card: hsl($color-block-h, $color-block-s * 1.
|
|
48
|
+
--card: hsl($color-block-h, $color-block-s * 1.2, 24)
|
|
50
49
|
--block: hsl($color-block-h, $color-block-s, 16)
|
|
51
50
|
--block-border: hsl($color-block-h, $color-block-s, 24)
|
|
52
51
|
--block-hover: hsl($color-block-h, $color-block-s, 20)
|
|
53
|
-
--block-lighten: hsl($color-block-h, $color-block-s, 32)
|
|
54
52
|
set_text_light()
|
|
55
53
|
@media screen and (max-width: $device-mobile-max)
|
|
56
54
|
--site-bg: black
|
|
@@ -36,8 +36,6 @@ h1.article-title
|
|
|
36
36
|
margin-top: 0
|
|
37
37
|
h1:not(:first-child)
|
|
38
38
|
margin-top: 2em
|
|
39
|
-
h2:first-child
|
|
40
|
-
margin-top: 0
|
|
41
39
|
h2
|
|
42
40
|
margin-bottom: 1rem
|
|
43
41
|
h3,h4,h5,h6
|
|
@@ -62,9 +60,13 @@ h1.article-title
|
|
|
62
60
|
p,ul,ol
|
|
63
61
|
font-size: $fs-14
|
|
64
62
|
line-height: 1.5
|
|
63
|
+
code
|
|
64
|
+
font-size: inherit
|
|
65
|
+
padding: 0
|
|
66
|
+
background: none
|
|
65
67
|
p,blockquote,.tag-plugin,ul,ol,.highlight,table
|
|
66
68
|
*
|
|
67
|
-
--gap-p:
|
|
69
|
+
--gap-p: var(--gap-p-compact)
|
|
68
70
|
p,ul,ol
|
|
69
71
|
margin-top: 'calc(%s - 4px)' % var(--gap-p)
|
|
70
72
|
margin-bottom: 'calc(%s - 4px)' % var(--gap-p)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
.md-text .checkbox
|
|
1
|
+
.md-text .tag-plugin.checkbox
|
|
2
2
|
display: flex
|
|
3
|
+
align-items: center
|
|
3
4
|
font-size: $fs-15
|
|
4
5
|
line-height: 1.2
|
|
5
|
-
--gap-p:
|
|
6
|
+
--gap-p: 'calc(%s / 2)' % var(--gap-p-compact)
|
|
6
7
|
input
|
|
7
8
|
-webkit-appearance: none
|
|
8
9
|
-moz-appearance: none
|
|
@@ -20,8 +21,6 @@
|
|
|
20
21
|
margin-right: 8px
|
|
21
22
|
if hexo-config('tag_plugins.checkbox.interactive') != true
|
|
22
23
|
pointer-events: none
|
|
23
|
-
span
|
|
24
|
-
margin-top: 1px
|
|
25
24
|
/* Checkbox */
|
|
26
25
|
input[type=checkbox]
|
|
27
26
|
&:before, &:after
|
|
@@ -16,8 +16,8 @@ set_dynamic_color($theme)
|
|
|
16
16
|
--theme-bg1: hsl(hue($theme), 90, 90)
|
|
17
17
|
--theme-bg2: hsl(hue($theme), 80, 95)
|
|
18
18
|
--theme-border: hsl(hue($theme), 50, 80)
|
|
19
|
-
--text-p0: hsl(hue($theme),
|
|
20
|
-
--text-p1: hsl(hue($theme),
|
|
19
|
+
--text-p0: hsl(hue($theme), 55, 16)
|
|
20
|
+
--text-p1: hsl(hue($theme), 55, 20)
|
|
21
21
|
--text-p2: hsl(hue($theme), 90, 24)
|
|
22
22
|
|
|
23
23
|
.tag-plugin
|
|
@@ -69,11 +69,11 @@ set_dynamic_color($theme)
|
|
|
69
69
|
set_darkmode_tags()
|
|
70
70
|
set_dynamic_color($theme)
|
|
71
71
|
--theme: $theme
|
|
72
|
-
--theme-bg1: hsl(hue($theme),
|
|
73
|
-
--theme-bg2: hsl(hue($theme),
|
|
72
|
+
--theme-bg1: hsl(hue($theme), 50, 16)
|
|
73
|
+
--theme-bg2: hsl(hue($theme), 32, 16)
|
|
74
74
|
--theme-border: hsl(hue($theme), 50, 24)
|
|
75
|
-
--text-p0: hsl(hue($theme),
|
|
76
|
-
--text-p1: hsl(hue($theme),
|
|
75
|
+
--text-p0: hsl(hue($theme), 100, 85)
|
|
76
|
+
--text-p1: hsl(hue($theme), 50, 75)
|
|
77
77
|
--text-p2: hsl(hue($theme), 80, 72)
|
|
78
78
|
.tag-plugin.tag
|
|
79
79
|
set_dynamic_color($color-theme)
|
|
@@ -2,7 +2,7 @@ details.folding
|
|
|
2
2
|
display: block
|
|
3
3
|
padding: 1rem
|
|
4
4
|
margin: 1rem 0
|
|
5
|
-
border-radius: $border-
|
|
5
|
+
border-radius: $border-bar
|
|
6
6
|
font-size: $fs-14
|
|
7
7
|
background: var(--theme-bg2)
|
|
8
8
|
border: 1px solid var(--theme-border)
|
|
@@ -10,7 +10,7 @@ details.folding
|
|
|
10
10
|
cursor: pointer
|
|
11
11
|
padding: .75rem 1rem
|
|
12
12
|
margin: 0 - 1rem
|
|
13
|
-
border-radius: $border-
|
|
13
|
+
border-radius: $border-bar
|
|
14
14
|
color: var(--text-p2)
|
|
15
15
|
font-weight: 500
|
|
16
16
|
position: relative
|
|
@@ -29,6 +29,7 @@ details.folding
|
|
|
29
29
|
top: 50%
|
|
30
30
|
transform: translateY(-50%)
|
|
31
31
|
right: 1rem
|
|
32
|
+
line-height: 1
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
details.folding[open]
|
|
@@ -47,8 +48,8 @@ details.folding[open]
|
|
|
47
48
|
margin: 0 - 1rem
|
|
48
49
|
margin-top: 0
|
|
49
50
|
background: var(--card)
|
|
50
|
-
border-bottom-left-radius: 'calc(%s - 1px)' % $border-
|
|
51
|
-
border-bottom-right-radius: 'calc(%s - 1px)' % $border-
|
|
51
|
+
border-bottom-left-radius: 'calc(%s - 1px)' % $border-bar
|
|
52
|
+
border-bottom-right-radius: 'calc(%s - 1px)' % $border-bar
|
|
52
53
|
font-size: $fs-15
|
|
53
54
|
>:first-child
|
|
54
55
|
margin-top: 0
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
.md-text .tag-plugin.note
|
|
2
2
|
position: relative
|
|
3
|
-
|
|
4
|
-
margin-bottom: 1rem
|
|
5
|
-
padding: 0 1rem
|
|
3
|
+
padding: 0.25rem 1rem
|
|
6
4
|
border-radius: $border-block
|
|
7
5
|
background: var(--theme-bg2)
|
|
8
|
-
|
|
6
|
+
overflow: hidden
|
|
7
|
+
if hexo-config('tag_plugins.note.border') == true
|
|
8
|
+
border: 1px solid var(--theme-border)
|
|
9
9
|
color: var(--text-p1)
|
|
10
10
|
>.title
|
|
11
11
|
font-size: $fs-15
|
|
12
|
-
line-height: 1.
|
|
13
|
-
margin-top:
|
|
12
|
+
line-height: 1.5
|
|
13
|
+
margin-top: var(--gap-p-compact)
|
|
14
14
|
font-weight: 500
|
|
15
15
|
color: var(--text-p0)
|
|
16
16
|
>.body
|
|
17
17
|
&,p
|
|
18
18
|
font-size: $fs-14
|
|
19
19
|
line-height: 1.5
|
|
20
|
-
margin-top:
|
|
21
|
-
margin-bottom:
|
|
20
|
+
margin-top: var(--gap-p-compact)
|
|
21
|
+
margin-bottom: var(--gap-p-compact)
|
|
22
22
|
>.body:only-child
|
|
23
|
-
margin:
|
|
23
|
+
margin: 'calc(%s - 0.25rem)' % var(--gap-p) 0
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
.md-text .tag-plugin.note[color]
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
margin-top: .5rem
|
|
48
48
|
|
|
49
49
|
.md-text .tag-plugin.note[child=iframe]
|
|
50
|
-
overflow: hidden
|
|
51
50
|
padding: 0
|
|
52
51
|
>.body
|
|
53
52
|
margin: 0
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
max-width 400px
|
|
21
21
|
position: relative
|
|
22
22
|
// override
|
|
23
|
-
.tag-plugin.quot
|
|
23
|
+
.md-text.content .tag-plugin.quot
|
|
24
24
|
h1
|
|
25
25
|
font-size: $fs-h1
|
|
26
26
|
font-weight: 900
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
padding: 20px 24px 12px
|
|
30
30
|
h2,h3,h4,h5,h6
|
|
31
31
|
font-size: $fs-h3
|
|
32
|
+
margin-top: 1em
|
|
33
|
+
margin-bottom: 0
|
|
32
34
|
p
|
|
33
35
|
font-size: $fs-h4
|
|
34
36
|
color: var(--text-p0)
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
align-self: flex-end
|
|
17
17
|
|
|
18
18
|
.tag-plugin.tabs
|
|
19
|
-
|
|
19
|
+
.nav-tabs
|
|
20
20
|
display: flex
|
|
21
21
|
align-self: center
|
|
22
22
|
overflow: scroll visible
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
bottom: 0
|
|
37
37
|
left: 0
|
|
38
38
|
border-radius: 2px
|
|
39
|
-
|
|
39
|
+
.tab
|
|
40
40
|
list-style-type: none
|
|
41
41
|
a
|
|
42
42
|
display: block
|
|
@@ -99,15 +99,11 @@
|
|
|
99
99
|
|
|
100
100
|
.tag-plugin.timeline .body
|
|
101
101
|
background: var(--card)
|
|
102
|
-
border-radius:
|
|
102
|
+
border-radius: $border-card
|
|
103
103
|
border-top-left-radius: 2px
|
|
104
104
|
padding: 0.5rem 1rem
|
|
105
105
|
margin-top: 4px
|
|
106
106
|
box-shadow: $boxshadow-block
|
|
107
|
-
trans2: transform box-shadow
|
|
108
|
-
&:hover
|
|
109
|
-
transform: translateY(-1px)
|
|
110
|
-
box-shadow: $boxshadow-card-float
|
|
111
107
|
p
|
|
112
108
|
font-size: $fs-14
|
|
113
109
|
img
|
|
@@ -10,23 +10,36 @@
|
|
|
10
10
|
display: flex
|
|
11
11
|
flex-direction: row
|
|
12
12
|
align-items: center
|
|
13
|
+
transition: 0.38s ease-out
|
|
14
|
+
z-index: 0
|
|
15
|
+
&:after
|
|
16
|
+
content: ''
|
|
17
|
+
position absolute
|
|
18
|
+
left: 0
|
|
19
|
+
right: 0
|
|
20
|
+
bottom: 0
|
|
21
|
+
height: 2px
|
|
22
|
+
border-radius: 4px
|
|
23
|
+
background: convert(hexo-config('style.gradient.search'))
|
|
24
|
+
background-size: 200%
|
|
25
|
+
animation: glow 10s linear infinite
|
|
26
|
+
@keyframes glow {
|
|
27
|
+
from {
|
|
28
|
+
background-position: 0%
|
|
29
|
+
}
|
|
30
|
+
to {
|
|
31
|
+
background-position: 200%
|
|
32
|
+
}
|
|
33
|
+
}
|
|
13
34
|
.search-input
|
|
14
35
|
width: 100%
|
|
15
|
-
padding: 0.5rem
|
|
36
|
+
padding: 0.5rem 0
|
|
16
37
|
line-height: 1
|
|
17
38
|
box-sizing: border-box
|
|
18
39
|
font-family: $ff-body
|
|
19
|
-
border-radius: $border-block
|
|
20
|
-
background-color: var(--card)
|
|
21
40
|
color: var(--text-p0)
|
|
22
|
-
border: 1px solid var(--block-border)
|
|
23
|
-
&:focus
|
|
24
|
-
trans1 border-color
|
|
25
41
|
|
|
26
|
-
&.noresult
|
|
27
|
-
.search-input
|
|
28
|
-
&:focus
|
|
29
|
-
border: 1px solid $c-red
|
|
42
|
+
&.noresult
|
|
30
43
|
.search-icon
|
|
31
44
|
color: $c-red
|
|
32
45
|
|
|
@@ -38,7 +51,7 @@
|
|
|
38
51
|
font-size: $fs-14
|
|
39
52
|
padding: 2rem
|
|
40
53
|
background: var(--block)
|
|
41
|
-
border-radius: $border-
|
|
54
|
+
border-radius: $border-bar
|
|
42
55
|
|
|
43
56
|
#search-result
|
|
44
57
|
ul.search-result-list
|
|
@@ -84,20 +97,16 @@
|
|
|
84
97
|
top: 0
|
|
85
98
|
background: var(--site-bg)
|
|
86
99
|
.search-input
|
|
87
|
-
|
|
88
|
-
margin-bottom: -1rem
|
|
89
|
-
padding-left: 1.75rem
|
|
100
|
+
padding-left: 1.5rem
|
|
90
101
|
.search-icon
|
|
91
|
-
margin-top: 1rem
|
|
92
|
-
margin-bottom: -1rem
|
|
93
102
|
position: absolute
|
|
94
|
-
margin-left: 0.
|
|
103
|
+
margin-left: 0.25rem
|
|
95
104
|
left: 0
|
|
96
105
|
pointer-events: none
|
|
97
106
|
color: var(--text-p2)
|
|
98
107
|
|
|
99
108
|
#search-result,.search-no-result
|
|
100
|
-
margin-top:
|
|
109
|
+
margin-top: 1rem
|
|
101
110
|
|
|
102
111
|
.widget-wrapper:not(:first-child)
|
|
103
112
|
.search-wrapper
|
|
@@ -35,15 +35,22 @@ div.swiper-slide
|
|
|
35
35
|
max-width: 75%
|
|
36
36
|
|
|
37
37
|
.swiper-button-prev,.swiper-button-next
|
|
38
|
-
padding: 1rem 0.
|
|
38
|
+
padding: 1rem 0.25rem
|
|
39
39
|
margin-top: -2rem !important
|
|
40
|
-
border-radius:
|
|
40
|
+
border-radius: 40px
|
|
41
41
|
background: alpha(white, 0.25)
|
|
42
42
|
trans1 background
|
|
43
|
-
--swiper-theme-color:
|
|
43
|
+
--swiper-theme-color: var(--text-p0) !important
|
|
44
44
|
&:after
|
|
45
45
|
font-size: 1.2rem !important
|
|
46
46
|
font-weight: 700 !important
|
|
47
|
+
color: var(--swiper-theme-color)
|
|
47
48
|
&:hover
|
|
48
49
|
background: white !important
|
|
49
50
|
--swiper-theme-color: $color-hover !important
|
|
51
|
+
|
|
52
|
+
.swiper-button-prev:after
|
|
53
|
+
transform: translateX(-1px)
|
|
54
|
+
|
|
55
|
+
.swiper-button-next:after
|
|
56
|
+
transform: translateX(1px)
|
package/source/js/main.js
CHANGED
|
@@ -95,6 +95,13 @@ const init = {
|
|
|
95
95
|
$("article.md-text :header").each(function (idx, node) {
|
|
96
96
|
segs.push(node)
|
|
97
97
|
});
|
|
98
|
+
// 定位到激活的目录树(不如pjax体验好)
|
|
99
|
+
// const widgets = document.querySelector('.widgets')
|
|
100
|
+
// const e1 = document.querySelector('.doc-tree-link.active')
|
|
101
|
+
// const offsetTop = e1.getBoundingClientRect().top - widgets.getBoundingClientRect().top - 100
|
|
102
|
+
// if (offsetTop > 0) {
|
|
103
|
+
// widgets.scrollBy({top: offsetTop, behavior: 'smooth'})
|
|
104
|
+
// }
|
|
98
105
|
// 滚动
|
|
99
106
|
$(document, window).scroll(function (e) {
|
|
100
107
|
var scrollTop = $(this).scrollTop();
|
|
@@ -114,7 +121,19 @@ const init = {
|
|
|
114
121
|
$("#data-toc a.toc-link").removeClass("active")
|
|
115
122
|
var link = "#" + topSeg.attr("id")
|
|
116
123
|
if (link != '#undefined') {
|
|
117
|
-
$('#data-toc a.toc-link[href="' + encodeURI(link) + '"]')
|
|
124
|
+
const highlightItem = $('#data-toc a.toc-link[href="' + encodeURI(link) + '"]')
|
|
125
|
+
if (highlightItem.length > 0) {
|
|
126
|
+
highlightItem.addClass("active")
|
|
127
|
+
const e0 = document.querySelector('.widgets')
|
|
128
|
+
const e1 = document.querySelector('#data-toc a.toc-link[href="' + encodeURI(link) + '"]')
|
|
129
|
+
const offsetBottom = e1.getBoundingClientRect().bottom - e0.getBoundingClientRect().bottom + 100
|
|
130
|
+
const offsetTop = e1.getBoundingClientRect().top - e0.getBoundingClientRect().top - 80
|
|
131
|
+
if (offsetTop < 0) {
|
|
132
|
+
e0.scrollBy(0, offsetTop)
|
|
133
|
+
} else if (offsetBottom > 0) {
|
|
134
|
+
e0.scrollBy(0, offsetBottom)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
118
137
|
} else {
|
|
119
138
|
$('#data-toc a.toc-link:first').addClass("active")
|
|
120
139
|
}
|
|
@@ -144,7 +163,7 @@ const init = {
|
|
|
144
163
|
*/
|
|
145
164
|
registerTabsTag: function () {
|
|
146
165
|
// Binding `nav-tabs` & `tab-content` by real time permalink changing.
|
|
147
|
-
document.querySelectorAll('.tabs
|
|
166
|
+
document.querySelectorAll('.tabs .nav-tabs .tab').forEach(element => {
|
|
148
167
|
element.addEventListener('click', event => {
|
|
149
168
|
event.preventDefault();
|
|
150
169
|
// Prevent selected tab to select again.
|
|
@@ -309,6 +328,9 @@ if (stellar.search.service) {
|
|
|
309
328
|
stellar.jQuery(() => {
|
|
310
329
|
stellar.loadScript('/js/search/local-search.js', { defer: true }).then(function () {
|
|
311
330
|
var $inputArea = $("input#search-input");
|
|
331
|
+
if ($inputArea.length == 0) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
312
334
|
var $resultArea = document.querySelector("div#search-result");
|
|
313
335
|
$inputArea.focus(function() {
|
|
314
336
|
var path = stellar.search[stellar.search.service]?.path || '/search.json';
|