You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
311 lines
6.5 KiB
311 lines
6.5 KiB
.l_header { |
|
@iconW: 32px; |
|
@iconMargin: 4px; |
|
position: fixed; |
|
z-index: 9999; |
|
top: 0; |
|
overflow: hidden; |
|
width: 100%; |
|
font-size: @fontsize_base; |
|
line-height: @height_navbar; |
|
height: @height_navbar; |
|
overflow: hidden; |
|
font-family: @fontfamily_base; |
|
padding: 0 @gap; |
|
margin-bottom: @gap; |
|
box-shadow: @boxshadow_card_normal; |
|
.wrapper{ |
|
padding: auto @gap; |
|
max-width: @width_container; |
|
margin: auto; |
|
.enable-trans(); |
|
a.logo { |
|
color: @color_text_header; |
|
} |
|
} |
|
&.no_sidebar{ |
|
.wrapper{ |
|
max-width: @on_pad; |
|
margin: auto; |
|
} |
|
} |
|
.wrapper.sub{ |
|
.enable-trans(); |
|
transform: translateY(-@height_navbar); |
|
.logo{ |
|
// padding-left: 0; |
|
@media(max-width: @on_phone){ |
|
.enable-trans(); |
|
padding-left: @gap; |
|
padding-right: 0; |
|
font-size: @fontsize_base; |
|
} |
|
} |
|
} |
|
.nav--main,.nav-sub{ |
|
height: @height_navbar; |
|
} |
|
background: @theme_cardbg; |
|
&.hide{ |
|
transform: translateY(100px) scale(0); |
|
} |
|
&.show{ |
|
transform: translateY(0) scale(1); |
|
} |
|
&, a{ |
|
.txt-ellipsis; |
|
height: @height_navbar; |
|
line-height: @height_navbar; |
|
color: @theme_main; |
|
} |
|
&:extend(.z-depth-nav); // 适合深色导航栏背景 |
|
|
|
.enable-trans(); |
|
&:hover { |
|
// &:extend(.z-depth-nav-raised); |
|
} |
|
&:active { |
|
|
|
} |
|
.logo { |
|
padding: 0 @gap*1.5; |
|
font-size: @fontsize_logo; |
|
font-family: @fontfamily_logo; |
|
@media(max-width: @on_phone){ |
|
padding: 0 @gap; |
|
} |
|
&.img{ |
|
padding: 0 @gap 0 0; |
|
} |
|
img{ |
|
height: 100%; |
|
} |
|
letter-spacing: 0; |
|
} |
|
img.logo { |
|
padding: 4px 0; |
|
} |
|
|
|
.nav-sub{ |
|
.logo { |
|
padding: 0 @gap*1.5; |
|
font-size: @fontsize_base; |
|
font-family: @fontfamily_base; |
|
@media(max-width: @on_phone){ |
|
letter-spacing: -0.5px; |
|
padding-top: 1px; |
|
} |
|
|
|
} |
|
} |
|
.menu{ |
|
position:relative; |
|
flex: 1 0 auto; |
|
height: @height_navbar; |
|
.enable-trans(); |
|
margin: 0 @gap 0 0; |
|
ul > li > a{ |
|
.enable-trans(); |
|
display: block; |
|
padding: 0 8px; |
|
color: fade(@color_text_main, 85%); |
|
&.current{ |
|
border-bottom: @loading_height solid fade(@theme_main, 80%); |
|
} |
|
&:hover{ |
|
color: @theme_main; |
|
border-bottom: @loading_height solid @theme_main; |
|
background: fade(@theme_main, 10%); |
|
} |
|
&:active,&.active{ |
|
color: @theme_main; |
|
border-bottom: @loading_height solid @theme_main; |
|
} |
|
} |
|
@media(max-width: @on_phone){ |
|
display:none; |
|
} |
|
} |
|
.switcher{ |
|
display: none; |
|
font-size: @fontsize_base; |
|
line-height: @height_navbar; |
|
.s-toc { |
|
display: none; |
|
} |
|
@media(max-width: @on_pad){ |
|
.s-toc { |
|
display: block; |
|
} |
|
} |
|
& > li{ |
|
height: @height_navbar - @gap; |
|
.enable-trans(); |
|
margin: 2px; |
|
@height: @height_navbar - @gap; |
|
@media(max-width: @on_phone){ |
|
margin: 0; |
|
height: @height; |
|
} |
|
a{ |
|
display: flex; |
|
justify-content: center; |
|
align-items: center; |
|
width: @height; |
|
height: @height; |
|
border-radius: 100px; |
|
.enable-trans(); |
|
&:hover { |
|
background: fade(@theme_main, 15%); |
|
} |
|
@media(max-width: @on_phone){ |
|
width: @iconW; |
|
height: @height; |
|
} |
|
} |
|
} |
|
@media(max-width: @on_phone){ |
|
display: flex; |
|
padding-left: @gap/2; |
|
padding-right: @gap - 6px; |
|
} |
|
} |
|
.nav-sub .switcher{ |
|
display: flex; |
|
} |
|
.m_search { |
|
position: relative; |
|
display: flex; |
|
width: @width_sidebar; |
|
height: @height_navbar; |
|
@media(max-width: @on_desktop){ |
|
width: @width_sidebar_m; |
|
} |
|
.form { |
|
position: relative; |
|
display: flex; |
|
width: 100%; |
|
margin: auto; |
|
justify-content: flex-start; |
|
align-items: center; |
|
} |
|
.icon,.input{ |
|
.enable-trans(.3s); |
|
} |
|
.icon { |
|
position: absolute; |
|
width: @iconW; |
|
left: @iconMargin+1px; |
|
font-size: @fontsize_small; |
|
color: fade(@color_text_main, 70%); |
|
} |
|
.input { |
|
display: block; |
|
font-size: @fontsize_small; |
|
padding-top: 8px; |
|
padding-bottom: 8px; |
|
width: 100%; |
|
color: @color_text_main; |
|
background: fade(darken(@theme_cardbg, 5%), 75%); |
|
box-shadow: none; |
|
box-sizing: border-box; |
|
padding-left: @iconW + @iconMargin; |
|
@media(max-width: @on_phone){ |
|
padding-left: @iconW + @iconMargin; |
|
} |
|
border-radius: @border_radius_searchbar; |
|
border: 1px dashed transparent; |
|
.set-placeholder({ |
|
color: fade(@color_text_main, 50%); |
|
}); |
|
&:hover{ |
|
color: @color_text_in_header; |
|
~.icon{ |
|
color: fade(@theme_main, 80%); |
|
} |
|
border: 1px solid fade(@theme_main, 60%); |
|
} |
|
&:focus { |
|
~.icon{ |
|
color: @theme_main; |
|
} |
|
color: @color_text_main; |
|
background: fade(@theme_main, 15%); |
|
border: 1px solid @theme_main; |
|
} |
|
} |
|
} |
|
@media (max-width: @on_phone) { |
|
padding: 0; |
|
.m_search{ |
|
width:0; |
|
overflow: hidden; |
|
position: absolute; |
|
.enable-trans(); |
|
margin: 0 @gap/2; |
|
} |
|
&.z_search-open{ |
|
.logo{ |
|
opacity:0; |
|
} |
|
.m_search{ |
|
width: ~"calc(100vw - 2*@{gap} - 2*@{iconW})"; |
|
} |
|
} |
|
} |
|
} |
|
|
|
.menu-phone{ |
|
.header{ |
|
border-top-left-radius: @border_radius; |
|
border-top-right-radius: @border_radius; |
|
background-color: fade(@color_bg_navbar,90%); |
|
color: @color_text_in_header; |
|
font-size: @fontsize_base; |
|
line-height: 1.8em; |
|
padding: 8px @gap+6px; |
|
} |
|
position: fixed; |
|
top: @height_navbar + @gap; |
|
right: 0; |
|
z-index:9999 + 1; |
|
line-height: 2 * @gap; |
|
border-right: 0; |
|
box-shadow: @boxshadow_card_raised; |
|
border-radius: @border_radius; |
|
transform: translate3d(-40px, -40px, 0) scale(0,0); |
|
transform-origin: right top; |
|
.enable-trans(); |
|
&:hover { |
|
box-shadow: @boxshadow_card_raised; |
|
} |
|
&:active { |
|
box-shadow: @boxshadow_card_normal; |
|
} |
|
nav { |
|
padding: @gap/2 0px; |
|
.nav { |
|
height: @height_cell; |
|
line-height: @height_cell; |
|
position: relative; |
|
display: block; |
|
color: @black; |
|
padding: 2px 20px; |
|
border-left: 4px solid transparent; |
|
border-right: 4px solid transparent; |
|
&:hover,&.active{ |
|
border-left: 4px solid @theme_main; |
|
background: fade(@theme_main, 10%); |
|
} |
|
} |
|
} |
|
} |
|
.cover-wrapper{ |
|
.l_header{ |
|
.enable-trans(0.5s); |
|
transform: translateY(-1.5*@height_navbar); |
|
&.show{ |
|
transform: translateY(0); |
|
} |
|
} |
|
}
|
|
|