mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
feat: toc 間隔調整, 直接子元素增加豎線辨識 closed #723
fix: 修復 toc 在小設備上顯示出屏幕外的 bug fix: 修復在打賞按鈕周圍也會觸發打賞彈窗的 bug fix: Waline 最近評論的時間只顯示 "剛剛" 的問題 (以docker的方式執行) #730 fix: 修復點擊右下角顯示按鈕時,按鈕沒有出現的 bug remove: 移除 button 的 hover 效果
This commit is contained in:
12
_config.yml
12
_config.yml
@@ -163,6 +163,10 @@ index_post_content:
|
|||||||
method: 3
|
method: 3
|
||||||
length: 500 # if you set method to 2 or 3, the length need to config
|
length: 500 # if you set method to 2 or 3, the length need to config
|
||||||
|
|
||||||
|
# anchor
|
||||||
|
# when you scroll in post, the URL will update according to header id.
|
||||||
|
anchor: false
|
||||||
|
|
||||||
# Post
|
# Post
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
@@ -215,10 +219,6 @@ photofigcaption: false
|
|||||||
# false: disable pagination
|
# false: disable pagination
|
||||||
post_pagination: 1
|
post_pagination: 1
|
||||||
|
|
||||||
# anchor
|
|
||||||
# when you scroll in post, the URL will update according to header id.
|
|
||||||
anchor: false
|
|
||||||
|
|
||||||
# Displays outdated notice for a post (文章過期提醒)
|
# Displays outdated notice for a post (文章過期提醒)
|
||||||
noticeOutdate:
|
noticeOutdate:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -560,8 +560,8 @@ display_mode: light
|
|||||||
beautify:
|
beautify:
|
||||||
enable: false
|
enable: false
|
||||||
field: post # site/post
|
field: post # site/post
|
||||||
title-prefix-icon: '\f0c1'
|
title-prefix-icon: # '\f0c1'
|
||||||
title-prefix-icon-color: '#F47466'
|
title-prefix-icon-color: # '#F47466'
|
||||||
|
|
||||||
# Global font settings
|
# Global font settings
|
||||||
# Don't modify the following settings unless you know how they work (非必要不要修改)
|
# Don't modify the following settings unless you know how they work (非必要不要修改)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.post-reward
|
.post-reward
|
||||||
.reward-button.button--animated
|
.reward-button
|
||||||
i.fas.fa-qrcode
|
i.fas.fa-qrcode
|
||||||
= ' ' + _p('donate')
|
= ' ' + _p('donate')
|
||||||
.reward-main
|
.reward-main
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if theme.aside.card_author.enable
|
|||||||
.length-num= site.categories.length
|
.length-num= site.categories.length
|
||||||
|
|
||||||
if theme.aside.card_author.button.enable
|
if theme.aside.card_author.button.enable
|
||||||
a#card-info-btn.button--animated(href=theme.aside.card_author.button.link)
|
a#card-info-btn(href=theme.aside.card_author.button.link)
|
||||||
i(class=theme.aside.card_author.button.icon)
|
i(class=theme.aside.card_author.button.icon)
|
||||||
span=theme.aside.card_author.button.text
|
span=theme.aside.card_author.button.text
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function btn (args) {
|
|||||||
icon = icon.trim()
|
icon = icon.trim()
|
||||||
option = option.trim()
|
option = option.trim()
|
||||||
|
|
||||||
return `<a class="btn-beautify button--animated ${option}" href="${urlFor(url)}"
|
return `<a class="btn-beautify ${option}" href="${urlFor(url)}"
|
||||||
title="${text}">${icon.length ? `<i class="${icon}"></i>` : ''}${text.length ? `<span>${text}</span>` : ''}</a>`
|
title="${text}">${icon.length ? `<i class="${icon}"></i>` : ''}${text.length ? `<span>${text}</span>` : ''}</a>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ function hideInline (args) {
|
|||||||
if (color) group += `color: ${color}`
|
if (color) group += `color: ${color}`
|
||||||
group += '"'
|
group += '"'
|
||||||
|
|
||||||
return `<span class="hide-inline"><button type="button" class="hide-button button--animated" ${group}>${display}
|
return `<span class="hide-inline"><button type="button" class="hide-button" ${group}>${display}
|
||||||
</button><span class="hide-content">${content}</span></span>`
|
</button><span class="hide-content">${content}</span></span>`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ function hideBlock (args, content) {
|
|||||||
if (color) group += `color: ${color}`
|
if (color) group += `color: ${color}`
|
||||||
group += '"'
|
group += '"'
|
||||||
|
|
||||||
return `<div class="hide-block"><button type="button" class="hide-button button--animated" ${group}>${display}
|
return `<div class="hide-block"><button type="button" class="hide-button" ${group}>${display}
|
||||||
</button><div class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' })}</div></div>`
|
</button><div class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' })}</div></div>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
--btn-bg: $button-bg
|
--btn-bg: $button-bg
|
||||||
--text-bg-hover: rgba($text-bg-hover, .7)
|
--text-bg-hover: rgba($text-bg-hover, .7)
|
||||||
--light-grey: $light-grey
|
--light-grey: $light-grey
|
||||||
|
--dark-grey: $dark-grey
|
||||||
--white: $white
|
--white: $white
|
||||||
--text-highlight-color: $text-highlight-color
|
--text-highlight-color: $text-highlight-color
|
||||||
--blockquote-color: $blockquote-color
|
--blockquote-color: $blockquote-color
|
||||||
@@ -33,6 +34,7 @@
|
|||||||
--timeline-border-color: $timeline-border-color
|
--timeline-border-color: $timeline-border-color
|
||||||
--pseudo-hover: $pseudo-hover
|
--pseudo-hover: $pseudo-hover
|
||||||
--headline-presudo: #a0a0a0
|
--headline-presudo: #a0a0a0
|
||||||
|
--scrollbar-color: $scrollbar-color
|
||||||
|
|
||||||
body
|
body
|
||||||
position: relative
|
position: relative
|
||||||
@@ -52,7 +54,7 @@ body
|
|||||||
height: 8px
|
height: 8px
|
||||||
|
|
||||||
*::-webkit-scrollbar-thumb
|
*::-webkit-scrollbar-thumb
|
||||||
background: var(--btn-bg)
|
background: var(--scrollbar-color)
|
||||||
|
|
||||||
*::-webkit-scrollbar-track
|
*::-webkit-scrollbar-track
|
||||||
background-color: transparent
|
background-color: transparent
|
||||||
@@ -176,29 +178,6 @@ if $site-name-font
|
|||||||
.pull-right
|
.pull-right
|
||||||
float: right
|
float: right
|
||||||
|
|
||||||
.button--animated
|
|
||||||
position: relative
|
|
||||||
z-index: 1
|
|
||||||
transition: color 1s
|
|
||||||
|
|
||||||
&:before
|
|
||||||
position: absolute
|
|
||||||
top: 0
|
|
||||||
right: 0
|
|
||||||
bottom: 0
|
|
||||||
left: 0
|
|
||||||
z-index: -1
|
|
||||||
background: var(--btn-hover-color)
|
|
||||||
content: ''
|
|
||||||
transition: transform .5s ease-out
|
|
||||||
transform: scaleX(0)
|
|
||||||
transform-origin: 0 50%
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
&:before
|
|
||||||
transition-timing-function: cubic-bezier(.45, 1.64, .47, .66)
|
|
||||||
transform: scaleX(1)
|
|
||||||
|
|
||||||
img
|
img
|
||||||
&[src=''],
|
&[src=''],
|
||||||
&:not([src])
|
&:not([src])
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#aside-content
|
#aside-content
|
||||||
width: 25%
|
width: 26%
|
||||||
|
|
||||||
+minWidth900()
|
+minWidth900()
|
||||||
if hexo-config('aside.position') == 'right'
|
if hexo-config('aside.position') == 'right'
|
||||||
@@ -79,6 +79,9 @@
|
|||||||
text-align: center
|
text-align: center
|
||||||
line-height: 2.4
|
line-height: 2.4
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color: var(--btn-hover-color)
|
||||||
|
|
||||||
span
|
span
|
||||||
padding-left: 10px
|
padding-left: 10px
|
||||||
|
|
||||||
@@ -243,6 +246,7 @@
|
|||||||
right: -100%
|
right: -100%
|
||||||
bottom: 30px
|
bottom: 30px
|
||||||
z-index: 100
|
z-index: 100
|
||||||
|
max-width: $toc-mobile-maxWidth
|
||||||
max-height: calc(100% - 60px)
|
max-height: calc(100% - 60px)
|
||||||
width: $toc-mobile-width
|
width: $toc-mobile-width
|
||||||
opacity: 0
|
opacity: 0
|
||||||
@@ -257,14 +261,22 @@
|
|||||||
font-size: 140%
|
font-size: 140%
|
||||||
|
|
||||||
.toc-content
|
.toc-content
|
||||||
clear: both
|
|
||||||
overflow-y: scroll
|
overflow-y: scroll
|
||||||
overflow-y: overlay
|
overflow-y: overlay
|
||||||
|
margin: 0 -24px
|
||||||
max-height: calc(100vh - 120px)
|
max-height: calc(100vh - 120px)
|
||||||
|
|
||||||
+maxWidth900()
|
+maxWidth900()
|
||||||
max-height: calc(100vh - 140px)
|
max-height: calc(100vh - 140px)
|
||||||
|
|
||||||
|
& > .toc
|
||||||
|
margin: 0 20px
|
||||||
|
|
||||||
|
& > .toc-item > .toc-child
|
||||||
|
margin-left: 10px
|
||||||
|
padding-left: 10px
|
||||||
|
border-left: 1px solid var(--dark-grey)
|
||||||
|
|
||||||
&:not(.is-expand)
|
&:not(.is-expand)
|
||||||
.toc-child
|
.toc-child
|
||||||
display: none
|
display: none
|
||||||
@@ -286,18 +298,19 @@
|
|||||||
|
|
||||||
ol
|
ol
|
||||||
margin: 0
|
margin: 0
|
||||||
padding-left: 15px
|
padding-left: 18px
|
||||||
|
|
||||||
.toc-link
|
.toc-link
|
||||||
display: block
|
display: block
|
||||||
padding-right: 8px
|
margin: 4px 0
|
||||||
padding-left: 6px
|
padding: 1px 6px
|
||||||
border-left: 3px solid transparent
|
|
||||||
color: var(--toc-link-color)
|
color: var(--toc-link-color)
|
||||||
transition: all .2s ease-in-out
|
transition: all .2s ease-in-out
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
color: $theme-color
|
||||||
|
|
||||||
&.active
|
&.active
|
||||||
border-left-color: darken($theme-toc-color, 20%)
|
|
||||||
background: $theme-toc-color
|
background: $theme-toc-color
|
||||||
color: $toc-active-color
|
color: $toc-active-color
|
||||||
|
|
||||||
|
|||||||
@@ -304,6 +304,7 @@
|
|||||||
background-color: var(--sidebar-bg)
|
background-color: var(--sidebar-bg)
|
||||||
box-shadow: 0 5px 20px -4px rgba($dark-black, .5)
|
box-shadow: 0 5px 20px -4px rgba($dark-black, .5)
|
||||||
animation: sub_menus .3s .1s ease both
|
animation: sub_menus .3s .1s ease both
|
||||||
|
border-radius: 5px
|
||||||
|
|
||||||
&:before
|
&:before
|
||||||
position: absolute
|
position: absolute
|
||||||
@@ -319,9 +320,13 @@
|
|||||||
&:hover
|
&:hover
|
||||||
background: var(--text-bg-hover)
|
background: var(--text-bg-hover)
|
||||||
|
|
||||||
|
&:first-child
|
||||||
|
border-radius: 5px 5px 0 0
|
||||||
|
&:last-child
|
||||||
|
border-radius: 0 0 5px 5px
|
||||||
a
|
a
|
||||||
display: inline-block
|
display: inline-block
|
||||||
padding: 6px 14px
|
padding: 8px 16px
|
||||||
width: 100%
|
width: 100%
|
||||||
color: var(--font-color) !important
|
color: var(--font-color) !important
|
||||||
text-shadow: none !important
|
text-shadow: none !important
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
margin-top: 80px
|
margin-top: 80px
|
||||||
width: 100%
|
width: 100%
|
||||||
text-align: center
|
text-align: center
|
||||||
|
pointer-events: none
|
||||||
|
|
||||||
|
& > *
|
||||||
|
pointer-events: auto
|
||||||
|
|
||||||
.reward-button
|
.reward-button
|
||||||
display: inline-block
|
display: inline-block
|
||||||
@@ -10,9 +14,11 @@
|
|||||||
background: var(--btn-bg)
|
background: var(--btn-bg)
|
||||||
color: var(--btn-color)
|
color: var(--btn-color)
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
transition: all .4s
|
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
|
.reward-button
|
||||||
|
background: var(--btn-hover-color)
|
||||||
|
|
||||||
& > .reward-main
|
& > .reward-main
|
||||||
display: block
|
display: block
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,19 @@
|
|||||||
transition: all .5s
|
transition: all .5s
|
||||||
|
|
||||||
#rightside-config-hide
|
#rightside-config-hide
|
||||||
display: none
|
height: 0
|
||||||
|
opacity: 0
|
||||||
|
transition: transform .4s
|
||||||
|
transform: translate(45px, 0)
|
||||||
|
|
||||||
|
&.show
|
||||||
|
height: auto
|
||||||
|
opacity: 1
|
||||||
|
transform: translate(0, 0)
|
||||||
|
|
||||||
|
&.status
|
||||||
|
height: auto
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
& > div
|
& > div
|
||||||
& > button,
|
& > button,
|
||||||
@@ -35,19 +47,3 @@
|
|||||||
+maxWidth900()
|
+maxWidth900()
|
||||||
#hide-aside-btn
|
#hide-aside-btn
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
@keyframes rightside-item-in
|
|
||||||
0%
|
|
||||||
transform: translate(48px, 0)
|
|
||||||
|
|
||||||
100%
|
|
||||||
transform: translate(0, 0)
|
|
||||||
|
|
||||||
@keyframes rightside-item-out
|
|
||||||
0%
|
|
||||||
display: block
|
|
||||||
transform: translate(0, 0)
|
|
||||||
|
|
||||||
100%
|
|
||||||
display: none
|
|
||||||
transform: translate(48px, 0)
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark'
|
|||||||
--btn-bg: lighten(#121212, 5)
|
--btn-bg: lighten(#121212, 5)
|
||||||
--text-bg-hover: lighten(#121212, 15)
|
--text-bg-hover: lighten(#121212, 15)
|
||||||
--light-grey: alpha(#FFFFFF, .7)
|
--light-grey: alpha(#FFFFFF, .7)
|
||||||
|
--dark-grey: alpha(#FFFFFF, .2)
|
||||||
--white: alpha(#FFFFFF, .9)
|
--white: alpha(#FFFFFF, .9)
|
||||||
--text-highlight-color: alpha(#FFFFFF, .9)
|
--text-highlight-color: alpha(#FFFFFF, .9)
|
||||||
--blockquote-color: alpha(#FFFFFF, .7)
|
--blockquote-color: alpha(#FFFFFF, .7)
|
||||||
@@ -36,6 +37,7 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark'
|
|||||||
--hlscrollbar-bg: lighten(#121212, 5)
|
--hlscrollbar-bg: lighten(#121212, 5)
|
||||||
--hlexpand-bg: linear-gradient(180deg, rgba(lighten(#121212, 2), .6), rgba(lighten(#121212, 2), .9))
|
--hlexpand-bg: linear-gradient(180deg, rgba(lighten(#121212, 2), .6), rgba(lighten(#121212, 2), .9))
|
||||||
--timeline-bg: lighten(#121212, 5)
|
--timeline-bg: lighten(#121212, 5)
|
||||||
|
--scrollbar-color: lighten(#121212, 5)
|
||||||
|
|
||||||
#web_bg:before,
|
#web_bg:before,
|
||||||
#footer:before,
|
#footer:before,
|
||||||
|
|||||||
@@ -187,9 +187,6 @@ if hexo-config('readmode')
|
|||||||
background: var(--readmode-light-color) !important
|
background: var(--readmode-light-color) !important
|
||||||
color: var(--font-color) !important
|
color: var(--font-color) !important
|
||||||
|
|
||||||
.button--animated:before
|
|
||||||
background: var(--readmode-light-color) !important
|
|
||||||
|
|
||||||
.note
|
.note
|
||||||
border: 2px solid var(--gray)
|
border: 2px solid var(--gray)
|
||||||
border-left-color: var(--gray) !important
|
border-left-color: var(--gray) !important
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
padding: 36px 14px
|
padding: 36px 14px
|
||||||
|
|
||||||
& > div:first-child
|
& > div:first-child
|
||||||
width: 75%
|
width: 74%
|
||||||
transition: all .3s
|
transition: all .3s
|
||||||
|
|
||||||
+maxWidth900()
|
+maxWidth900()
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
color: $btn-color
|
color: $btn-color
|
||||||
line-height: 2
|
line-height: 2
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color: var(--btn-hover-color)
|
||||||
|
|
||||||
i + span
|
i + span
|
||||||
margin-left: 6px
|
margin-left: 6px
|
||||||
|
|
||||||
@@ -39,15 +42,17 @@
|
|||||||
&.{$type}
|
&.{$type}
|
||||||
background-color: lookup('$tagsP-' + $type + '-color')
|
background-color: lookup('$tagsP-' + $type + '-color')
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color: var(--btn-hover-color)
|
||||||
|
|
||||||
&.outline
|
&.outline
|
||||||
border: 1px solid transparent
|
border: 1px solid transparent
|
||||||
border-color: $btn-default-color
|
border-color: $btn-default-color
|
||||||
background-color: transparent
|
background-color: transparent
|
||||||
color: $btn-default-color
|
color: $btn-default-color
|
||||||
transition: all .3s
|
|
||||||
|
|
||||||
&.button--animated:before
|
&:hover
|
||||||
background: $btn-default-color
|
background-color: $btn-default-color
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color: white !important
|
color: white !important
|
||||||
@@ -57,5 +62,5 @@
|
|||||||
border-color: lookup('$tagsP-' + $type + '-color')
|
border-color: lookup('$tagsP-' + $type + '-color')
|
||||||
color: lookup('$tagsP-' + $type + '-color')
|
color: lookup('$tagsP-' + $type + '-color')
|
||||||
|
|
||||||
&.button--animated:before
|
&:hover
|
||||||
background: lookup('$tagsP-' + $type + '-color')
|
background-color: lookup('$tagsP-' + $type + '-color')
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
background: $tag-hide-bg
|
background: $tag-hide-bg
|
||||||
color: var(--white)
|
color: var(--white)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color: var(--btn-hover-color)
|
||||||
|
|
||||||
&.open
|
&.open
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ $hr-icon = $hrEnable && hexo-config('hr_icon.icon') ? hexo-config('hr_icon.icon'
|
|||||||
$hr-icon-top = $hrEnable && hexo-config('hr_icon.icon-top') ? convert(hexo-config('hr_icon.icon-top')) : -10px
|
$hr-icon-top = $hrEnable && hexo-config('hr_icon.icon-top') ? convert(hexo-config('hr_icon.icon-top')) : -10px
|
||||||
// page beatutify
|
// page beatutify
|
||||||
$beautifyEnable = hexo-config('beautify.enable')
|
$beautifyEnable = hexo-config('beautify.enable')
|
||||||
$title-prefix-icon = $beautifyEnable ? hexo-config('beautify.title-prefix-icon') : '\f0c1'
|
$title-prefix-icon = $beautifyEnable && hexo-config('beautify.title-prefix-icon') ? hexo-config('beautify.title-prefix-icon') : '\f0c1'
|
||||||
$title-prefix-icon-color = $beautifyEnable ? convert(hexo-config('beautify.title-prefix-icon-color')) : $light-red
|
$title-prefix-icon-color = $beautifyEnable && hexo-config('beautify.title-prefix-icon-color') ? convert(hexo-config('beautify.title-prefix-icon-color')) : $light-red
|
||||||
// Global Variables
|
// Global Variables
|
||||||
$font-size = hexo-config('font.global-font-size') ? convert(hexo-config('font.global-font-size')) : 14px
|
$font-size = hexo-config('font.global-font-size') ? convert(hexo-config('font.global-font-size')) : 14px
|
||||||
$code-font-size = hexo-config('font.code-font-size') ? convert(hexo-config('font.code-font-size')) : var(--global-font-size)
|
$code-font-size = hexo-config('font.code-font-size') ? convert(hexo-config('font.code-font-size')) : var(--global-font-size)
|
||||||
@@ -39,6 +39,7 @@ $light-blue = $theme-color
|
|||||||
$dark-black = #000000
|
$dark-black = #000000
|
||||||
$light-grey = #EEEEEE
|
$light-grey = #EEEEEE
|
||||||
$grey = #858585
|
$grey = #858585
|
||||||
|
$dark-grey = #cacaca
|
||||||
$white = #FFFFFF
|
$white = #FFFFFF
|
||||||
$whitesmoke = #f5f5f5
|
$whitesmoke = #f5f5f5
|
||||||
$font-black = #4C4948
|
$font-black = #4C4948
|
||||||
@@ -61,13 +62,16 @@ $sidebar-background = #f6f8fa
|
|||||||
$sidebar-width = 300px
|
$sidebar-width = 300px
|
||||||
// aside
|
// aside
|
||||||
$toc-link-color = #666261
|
$toc-link-color = #666261
|
||||||
$toc-mobile-width = 300px
|
$toc-mobile-width = calc(100% - 80px)
|
||||||
|
$toc-mobile-maxWidth = 380px
|
||||||
$toc-active-color = #fff
|
$toc-active-color = #fff
|
||||||
// Button
|
// Button
|
||||||
$button-color = #fff
|
$button-color = #fff
|
||||||
$button-hover-color = $themeColorEnable && hexo-config('theme_color.button_hover') ? convert(hexo-config('theme_color.button_hover')) : $light-orange
|
$button-hover-color = $themeColorEnable && hexo-config('theme_color.button_hover') ? convert(hexo-config('theme_color.button_hover')) : $light-orange
|
||||||
$button-bg = $theme-color
|
$button-bg = $theme-color
|
||||||
$pseudo-hover = $button-hover-color
|
$pseudo-hover = $button-hover-color
|
||||||
|
// scrollbar
|
||||||
|
$scrollbar-color= $themeColorEnable && hexo-config('theme_color.scrollbar_color') ? convert(hexo-config('theme_color.scrollbar_color')) : $theme-color
|
||||||
// table
|
// table
|
||||||
$table-thead-bg = #99a9bf
|
$table-thead-bg = #99a9bf
|
||||||
// reward
|
// reward
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
}
|
}
|
||||||
$header.classList.add('nav-fixed')
|
$header.classList.add('nav-fixed')
|
||||||
if (window.getComputedStyle($rightside).getPropertyValue('opacity') === '0') {
|
if (window.getComputedStyle($rightside).getPropertyValue('opacity') === '0') {
|
||||||
$rightside.style.cssText = 'opacity: 0.7; transform: translateX(-58px)'
|
$rightside.style.cssText = 'opacity: 0.8; transform: translateX(-58px)'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (currentTop === 0) {
|
if (currentTop === 0) {
|
||||||
@@ -306,7 +306,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (document.body.scrollHeight <= innerHeight) {
|
if (document.body.scrollHeight <= innerHeight) {
|
||||||
$rightside.style.cssText = 'opacity: 0.7; transform: translateX(-58px)'
|
$rightside.style.cssText = 'opacity: 0.8; transform: translateX(-58px)'
|
||||||
}
|
}
|
||||||
}, 200)()
|
}, 200)()
|
||||||
}
|
}
|
||||||
@@ -478,15 +478,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
window.DISQUS && document.getElementById('disqus_thread').children.length && setTimeout(() => window.disqusReset(), 200)
|
window.DISQUS && document.getElementById('disqus_thread').children.length && setTimeout(() => window.disqusReset(), 200)
|
||||||
typeof runMermaid === 'function' && window.runMermaid()
|
typeof runMermaid === 'function' && window.runMermaid()
|
||||||
},
|
},
|
||||||
showOrHideBtn: () => { // rightside 點擊設置 按鈕 展開
|
showOrHideBtn: (e) => { // rightside 點擊設置 按鈕 展開
|
||||||
const target = document.getElementById('rightside-config-hide')
|
const rightsideHideClassList = document.getElementById('rightside-config-hide').classList
|
||||||
if (window.rightSideIn) {
|
rightsideHideClassList.toggle('show')
|
||||||
window.rightSideIn = false
|
if (e.classList.contains('show')) {
|
||||||
btf.animateOut(target, 'rightside-item-out 0.5s')
|
rightsideHideClassList.add('status')
|
||||||
} else {
|
setTimeout(() => {
|
||||||
window.rightSideIn = true
|
rightsideHideClassList.remove('status')
|
||||||
btf.animateIn(target, 'rightside-item-in 0.5s')
|
}, 300)
|
||||||
}
|
}
|
||||||
|
e.classList.toggle('show')
|
||||||
},
|
},
|
||||||
scrollToTop: () => { // Back to top
|
scrollToTop: () => { // Back to top
|
||||||
btf.scrollToDest(0, 500)
|
btf.scrollToDest(0, 500)
|
||||||
@@ -506,13 +507,13 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('rightside').addEventListener('click', function (e) {
|
document.getElementById('rightside').addEventListener('click', function (e) {
|
||||||
const $target = e.target.id || e.target.parentNode.id
|
const $target = e.target.id ? e.target : e.target.parentNode
|
||||||
switch ($target) {
|
switch ($target.id) {
|
||||||
case 'go-up':
|
case 'go-up':
|
||||||
rightSideFn.scrollToTop()
|
rightSideFn.scrollToTop()
|
||||||
break
|
break
|
||||||
case 'rightside_config':
|
case 'rightside_config':
|
||||||
rightSideFn.showOrHideBtn()
|
rightSideFn.showOrHideBtn($target)
|
||||||
break
|
break
|
||||||
case 'mobile-toc-button':
|
case 'mobile-toc-button':
|
||||||
rightSideFn.runMobileToc()
|
rightSideFn.runMobileToc()
|
||||||
@@ -534,7 +535,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
/**
|
/**
|
||||||
* menu
|
* menu
|
||||||
* 側邊欄sub-menu 展開/收縮
|
* 側邊欄sub-menu 展開/收縮
|
||||||
* 解決menus在觸摸屏下,滑動屏幕menus_item_child不消失的問題(手機hover的bug)
|
|
||||||
*/
|
*/
|
||||||
const clickFnOfSubMenu = () => {
|
const clickFnOfSubMenu = () => {
|
||||||
document.querySelectorAll('#sidebar-menus .site-page.group').forEach(function (item) {
|
document.querySelectorAll('#sidebar-menus .site-page.group').forEach(function (item) {
|
||||||
@@ -594,7 +594,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
/**
|
/**
|
||||||
* table overflow
|
* table overflow
|
||||||
*/
|
*/
|
||||||
const addTableWrap = function () {
|
const addTableWrap = () => {
|
||||||
const $table = document.querySelectorAll('#article-container :not(.highlight) > table, #article-container > table')
|
const $table = document.querySelectorAll('#article-container :not(.highlight) > table, #article-container > table')
|
||||||
if ($table.length) {
|
if ($table.length) {
|
||||||
$table.forEach(item => {
|
$table.forEach(item => {
|
||||||
|
|||||||
Reference in New Issue
Block a user