2022-09-30 10:51:42 +08:00
|
|
|
$logo-title-font-size = 2rem
|
|
|
|
$pc-search-icon-font-size = 1.5rem
|
|
|
|
$menu-bar-line-height = 2.5px
|
|
|
|
$logo-image-box-width = 46px
|
2020-09-03 15:12:32 +08:00
|
|
|
|
2020-04-01 10:14:18 +08:00
|
|
|
.header-wrapper {
|
2022-09-30 10:51:42 +08:00
|
|
|
display flex
|
|
|
|
align-items center
|
|
|
|
justify-content center
|
|
|
|
box-sizing border-box
|
|
|
|
width 100%
|
|
|
|
height 100%
|
|
|
|
padding-top $scroll-progress-bar-height
|
2022-10-14 17:56:32 +08:00
|
|
|
background var(--background-color-1)
|
2022-09-26 17:52:38 +08:00
|
|
|
|
2022-09-30 10:51:42 +08:00
|
|
|
hover-style(false, 0, 0)
|
2020-04-24 22:49:10 +08:00
|
|
|
|
2020-04-01 10:14:18 +08:00
|
|
|
.header-content {
|
2022-09-30 10:51:42 +08:00
|
|
|
position relative
|
|
|
|
z-index $z-index-5
|
|
|
|
display flex
|
|
|
|
flex-direction row
|
|
|
|
align-items center
|
|
|
|
justify-content space-between
|
|
|
|
width $main-content-width
|
|
|
|
max-width $content-max-width
|
|
|
|
height 100%
|
2022-10-11 23:05:45 +08:00
|
|
|
transition-t("max-width, width", "0, 0", "0.1, 0.1", "ease, ease")
|
2021-01-21 16:47:13 +08:00
|
|
|
|
2020-12-25 17:50:22 +08:00
|
|
|
|
|
|
|
&.has-first-screen {
|
2022-10-11 16:27:04 +08:00
|
|
|
max-width $has-fs-content-max-width
|
|
|
|
}
|
|
|
|
|
|
|
|
.has-toc & {
|
|
|
|
max-width $has-toc-content-max-width
|
2020-12-25 17:50:22 +08:00
|
|
|
}
|
2020-09-03 16:47:52 +08:00
|
|
|
|
2020-11-20 12:02:22 +08:00
|
|
|
+keep-tablet() {
|
2022-09-30 10:51:42 +08:00
|
|
|
width $main-content-width-tablet
|
2020-09-03 16:47:52 +08:00
|
|
|
}
|
|
|
|
|
2020-11-20 12:02:22 +08:00
|
|
|
+keep-mobile() {
|
2022-09-30 10:51:42 +08:00
|
|
|
width $main-content-width-mobile
|
2020-09-03 16:47:52 +08:00
|
|
|
}
|
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.left {
|
2022-09-30 10:51:42 +08:00
|
|
|
display flex
|
|
|
|
align-items center
|
|
|
|
transition-t("transform", "0", "0.2", "linear")
|
2021-01-05 11:48:58 +08:00
|
|
|
|
|
|
|
.header-shrink & {
|
2022-09-30 10:51:42 +08:00
|
|
|
transform scale(0.72)
|
|
|
|
transform-origin left
|
2021-04-29 11:41:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-26 14:19:12 +08:00
|
|
|
if (hexo-config('base_info.logo_img') || hexo-config('style.logo')) {
|
2021-04-29 11:41:20 +08:00
|
|
|
.logo-image {
|
2022-09-30 10:51:42 +08:00
|
|
|
width $logo-image-box-width
|
|
|
|
height $logo-image-box-width
|
|
|
|
margin-right 8px
|
2021-04-29 11:41:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
+keep-tablet() {
|
2022-09-30 10:51:42 +08:00
|
|
|
width $logo-image-box-width * 0.9
|
|
|
|
height $logo-image-box-width * 0.9
|
2021-04-29 11:41:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
+keep-mobile() {
|
2022-09-30 10:51:42 +08:00
|
|
|
width $logo-image-box-width * 0.8
|
|
|
|
height $logo-image-box-width * 0.8
|
2021-04-29 11:41:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
img {
|
2022-09-30 10:51:42 +08:00
|
|
|
width 100%
|
|
|
|
border-radius 6px
|
2021-04-29 11:41:20 +08:00
|
|
|
}
|
|
|
|
}
|
2021-01-05 11:48:58 +08:00
|
|
|
}
|
2020-12-01 16:51:38 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.logo-title {
|
2022-10-14 17:56:32 +08:00
|
|
|
color var(--text-color-1)
|
2022-09-30 10:51:42 +08:00
|
|
|
font-weight bold
|
|
|
|
font-size $logo-title-font-size
|
|
|
|
line-height 1
|
|
|
|
letter-spacing 1px
|
2020-06-04 22:11:27 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
+keep-tablet() {
|
2022-09-30 10:51:42 +08:00
|
|
|
font-size $logo-title-font-size * 0.9
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
2020-06-04 22:11:27 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
+keep-mobile() {
|
2022-09-30 10:51:42 +08:00
|
|
|
font-size $logo-title-font-size * 0.8
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
2020-06-04 22:11:27 +08:00
|
|
|
}
|
2020-04-01 10:14:18 +08:00
|
|
|
}
|
|
|
|
|
2021-01-04 21:16:07 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.right {
|
2020-11-15 22:06:32 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.pc {
|
2021-01-05 11:48:58 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.menu-list {
|
2022-09-30 10:51:42 +08:00
|
|
|
display flex
|
|
|
|
align-items center
|
2020-04-01 10:14:18 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
+keep-tablet() {
|
2022-09-30 10:51:42 +08:00
|
|
|
display none
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
2020-09-03 16:47:52 +08:00
|
|
|
|
2020-12-01 16:51:38 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.menu-item {
|
2022-09-30 10:51:42 +08:00
|
|
|
position relative
|
|
|
|
float left
|
2022-09-30 11:36:38 +08:00
|
|
|
margin-left 2rem
|
2022-10-14 17:56:32 +08:00
|
|
|
color var(--text-color-3)
|
2022-09-30 10:51:42 +08:00
|
|
|
font-size 1rem
|
|
|
|
cursor pointer
|
2020-04-01 15:28:01 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
&:first-child {
|
2022-09-30 10:51:42 +08:00
|
|
|
margin-left 0
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
2020-04-01 15:28:01 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
|
2022-09-30 10:51:42 +08:00
|
|
|
a:hover
|
|
|
|
.active {
|
2020-12-24 21:16:31 +08:00
|
|
|
|
|
|
|
&::after {
|
2022-09-30 10:51:42 +08:00
|
|
|
position absolute
|
|
|
|
bottom -10px
|
|
|
|
left 50%
|
|
|
|
width 100%
|
|
|
|
height 2px
|
|
|
|
background var(--primary-color)
|
|
|
|
transform translateX(-50%)
|
|
|
|
content ''
|
|
|
|
transition-t("transform, bottom", "0, 0", "0.2, 0.2", "linear, linear")
|
2021-01-05 11:48:58 +08:00
|
|
|
|
|
|
|
.header-shrink & {
|
2022-09-30 10:51:42 +08:00
|
|
|
bottom -($header-shrink-height / 2 - 12)
|
2021-01-05 11:48:58 +08:00
|
|
|
}
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.search {
|
2022-09-30 10:51:42 +08:00
|
|
|
margin-left 26px
|
|
|
|
font-size $pc-search-icon-font-size
|
2021-01-21 16:47:13 +08:00
|
|
|
|
|
|
|
i {
|
2022-10-14 17:56:32 +08:00
|
|
|
color var(--text-color-3)
|
2021-01-21 16:47:13 +08:00
|
|
|
}
|
2020-04-01 15:28:01 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
2020-04-01 15:28:01 +08:00
|
|
|
|
2021-01-05 11:48:58 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.mobile {
|
2022-09-30 10:51:42 +08:00
|
|
|
display flex
|
|
|
|
align-items center
|
|
|
|
justify-content space-between
|
2020-12-24 21:16:31 +08:00
|
|
|
|
|
|
|
.icon-item {
|
2022-09-30 10:51:42 +08:00
|
|
|
position relative
|
|
|
|
display none
|
|
|
|
width 20px
|
|
|
|
height 20px
|
|
|
|
margin-left 12px
|
2022-10-14 17:56:32 +08:00
|
|
|
color var(--text-color-3)
|
2022-09-30 10:51:42 +08:00
|
|
|
font-size 18px
|
|
|
|
cursor pointer
|
2021-01-21 16:47:13 +08:00
|
|
|
|
|
|
|
i {
|
2022-10-14 17:56:32 +08:00
|
|
|
color var(--text-color-3)
|
2021-01-21 16:47:13 +08:00
|
|
|
}
|
2020-12-24 21:16:31 +08:00
|
|
|
|
|
|
|
&:first-child {
|
2022-09-30 10:51:42 +08:00
|
|
|
margin-left 0
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
2020-04-01 15:28:01 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
+keep-tablet() {
|
2022-09-30 10:51:42 +08:00
|
|
|
display flex
|
|
|
|
align-items center
|
|
|
|
justify-content center
|
2020-04-01 15:28:01 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.menu-bar {
|
2020-09-03 16:47:52 +08:00
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
.menu-bar-middle {
|
2022-09-30 10:51:42 +08:00
|
|
|
position relative
|
|
|
|
width 18px
|
|
|
|
height $menu-bar-line-height
|
2022-10-14 17:56:32 +08:00
|
|
|
background var(--text-color-3)
|
2020-04-01 22:42:24 +08:00
|
|
|
|
2021-01-05 11:48:58 +08:00
|
|
|
.header-drawer-show & {
|
2022-09-30 10:51:42 +08:00
|
|
|
background transparent
|
2021-01-05 11:48:58 +08:00
|
|
|
}
|
|
|
|
|
2021-01-21 16:47:13 +08:00
|
|
|
|
2022-09-30 10:51:42 +08:00
|
|
|
&::before
|
|
|
|
&::after {
|
|
|
|
position absolute
|
|
|
|
left 0
|
|
|
|
width 100%
|
|
|
|
height $menu-bar-line-height
|
2022-10-14 17:56:32 +08:00
|
|
|
background var(--text-color-3)
|
2022-09-30 10:51:42 +08:00
|
|
|
content ''
|
|
|
|
transition-t("transform", "0", "0.38", "ease")
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
|
|
|
|
2021-01-05 11:48:58 +08:00
|
|
|
|
|
|
|
&::before {
|
2022-09-30 10:51:42 +08:00
|
|
|
top -6px
|
2021-01-05 11:48:58 +08:00
|
|
|
|
|
|
|
.header-drawer-show & {
|
2022-09-30 10:51:42 +08:00
|
|
|
transform translateY(6px) rotate(45deg)
|
2021-01-05 11:48:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-24 21:16:31 +08:00
|
|
|
&::after {
|
2022-09-30 10:51:42 +08:00
|
|
|
bottom -6px
|
2021-01-05 11:48:58 +08:00
|
|
|
|
|
|
|
.header-drawer-show & {
|
2022-09-30 10:51:42 +08:00
|
|
|
transform translateY(-6px) rotate(-45deg)
|
2021-01-05 11:48:58 +08:00
|
|
|
}
|
2020-12-24 21:16:31 +08:00
|
|
|
}
|
|
|
|
}
|
2020-04-01 22:42:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-04-01 10:14:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-drawer {
|
2022-09-30 10:51:42 +08:00
|
|
|
position absolute
|
|
|
|
top 0
|
|
|
|
left 0
|
|
|
|
z-index $z-index-2
|
|
|
|
width 100%
|
|
|
|
padding $header-height 0 20px 0
|
2022-10-14 17:56:32 +08:00
|
|
|
background var(--background-color-1)
|
2022-09-30 10:51:42 +08:00
|
|
|
transform scaleY(0)
|
|
|
|
transform-origin top
|
|
|
|
transition-t("transform", "0", "0.38", "ease")
|
2020-12-01 16:51:38 +08:00
|
|
|
|
2021-01-05 11:48:58 +08:00
|
|
|
.header-drawer-show & {
|
2022-09-30 10:51:42 +08:00
|
|
|
transform scaleY(1)
|
2021-01-05 11:48:58 +08:00
|
|
|
}
|
|
|
|
|
2020-04-01 10:14:18 +08:00
|
|
|
.drawer-menu-list {
|
2022-09-30 10:51:42 +08:00
|
|
|
display flex
|
|
|
|
flex-direction column
|
|
|
|
align-items center
|
|
|
|
justify-content flex-start
|
2020-04-01 10:14:18 +08:00
|
|
|
|
|
|
|
.drawer-menu-item {
|
2022-09-30 10:51:42 +08:00
|
|
|
height 38px
|
|
|
|
margin 6px 0
|
|
|
|
font-size 1rem
|
2020-04-01 10:14:18 +08:00
|
|
|
|
2020-04-01 22:42:24 +08:00
|
|
|
a {
|
2022-09-30 10:51:42 +08:00
|
|
|
padding 6px 20px
|
2022-10-14 17:56:32 +08:00
|
|
|
color var(--text-color-3)
|
2022-09-30 10:51:42 +08:00
|
|
|
border-radius 20px
|
2020-04-01 22:42:24 +08:00
|
|
|
|
|
|
|
&:hover {
|
2022-10-14 17:56:32 +08:00
|
|
|
color var(--text-color-2)
|
|
|
|
border 1px solid var(--text-color-3)
|
2020-04-01 22:42:24 +08:00
|
|
|
}
|
|
|
|
|
2020-12-01 16:51:38 +08:00
|
|
|
|
|
|
|
&.active {
|
2022-10-14 17:56:32 +08:00
|
|
|
color var(--text-color-2)
|
|
|
|
border 1px solid var(--text-color-3)
|
2020-12-01 16:51:38 +08:00
|
|
|
}
|
2020-04-01 22:42:24 +08:00
|
|
|
}
|
2020-04-01 10:14:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.window-mask {
|
2022-09-30 10:51:42 +08:00
|
|
|
position absolute
|
|
|
|
top 0
|
|
|
|
z-index $z-index-1
|
|
|
|
width 100%
|
|
|
|
height 100vh
|
|
|
|
background rgba(0, 0, 0, 0.4)
|
|
|
|
visibility hidden
|
|
|
|
opacity 0
|
|
|
|
transition-t("transform, opacity", "0, 0", "0.38, 0.38", "ease, ease")
|
2020-04-01 10:14:18 +08:00
|
|
|
|
2021-01-05 11:48:58 +08:00
|
|
|
.header-drawer-show & {
|
2022-09-30 10:51:42 +08:00
|
|
|
visibility visible
|
|
|
|
opacity 1
|
2020-04-01 22:42:24 +08:00
|
|
|
}
|
2020-04-01 15:28:01 +08:00
|
|
|
}
|
2021-01-05 11:48:58 +08:00
|
|
|
}
|
2020-04-01 15:28:01 +08:00
|
|
|
|
2021-01-05 11:48:58 +08:00
|
|
|
.header-drawer-show {
|
2022-09-30 10:51:42 +08:00
|
|
|
overflow hidden
|
2020-07-09 18:25:20 +08:00
|
|
|
}
|