_header.less 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. .l_header {
  2. position:fixed;
  3. z-index: 9999;
  4. top:0;
  5. left:0;
  6. width:100%;
  7. font-size: @header-font-size;
  8. line-height: @header-height;
  9. height: @header-height;
  10. overflow: hidden;
  11. .wrapper{
  12. transition: transform .2s ease-out;
  13. }
  14. .wrapper.sub{
  15. transform: translateY(-@header-height);
  16. }
  17. .nav--main,.nav-sub{
  18. height: @header-height;
  19. }
  20. background: @primary-color;
  21. padding: 0 @gap;
  22. &, a{
  23. color: @white;
  24. }
  25. &:extend(.z-depth-1);
  26. .logo {
  27. flex: none;
  28. padding: 0 @gap;
  29. font-size: @header-logo-font-size;
  30. }
  31. .menu{
  32. position:relative;
  33. flex: 1 0 auto;
  34. height: @header-height;
  35. .enable-trans();
  36. margin:0 28px;
  37. ul > li > a{
  38. .enable-trans();
  39. display: block;
  40. color: fade(@white,70%);
  41. padding: 0 @gap / 2;
  42. &:hover,&.active{
  43. color: @white;
  44. }
  45. }
  46. @media(max-width: @on-phone){
  47. display:none;
  48. }
  49. .underline{
  50. transition: all .15s ease-out;
  51. position: absolute;
  52. background: @white;
  53. left: 0;
  54. bottom: 0;
  55. width: 0;
  56. height: 2px;
  57. }
  58. }
  59. .switcher{
  60. display: none;
  61. font-size: @header-switcher-font-size;
  62. & > li{
  63. margin-left: @gap;
  64. .enable-trans();
  65. svg{
  66. margin-top:16px;
  67. }
  68. }
  69. // & > li.s-menu.active {
  70. // transform: rotate(90deg);
  71. // }
  72. @media(max-width: @on-phone){
  73. display: flex;
  74. }
  75. }
  76. .nav-sub .switcher{
  77. display: flex;
  78. }
  79. @media (max-width: @on-phone) {
  80. .m_search{
  81. width:0;
  82. overflow: hidden;
  83. position: absolute;
  84. .enable-trans();
  85. right: 0px;
  86. top:(@header-height - @search-height)/2;
  87. }
  88. &.z_search-open{
  89. .logo,.switcher{
  90. opacity:0;
  91. }
  92. .m_search{
  93. width: 100%;
  94. }
  95. }
  96. }
  97. }
  98. .m_search {
  99. position: relative;
  100. height: @search-height;
  101. width: @search-width;
  102. line-height: @search-height;
  103. vertical-align: middle;
  104. .form {
  105. position: relative;
  106. display: block;
  107. width: 100%;
  108. }
  109. .icon,.input{
  110. .enable-trans(.1s);
  111. }
  112. .icon {
  113. position: absolute;
  114. display:block;
  115. height: @search-height;
  116. width: @search-height;
  117. line-height: @search-height;
  118. top: 0;
  119. left: @gap/2;
  120. }
  121. .input {
  122. display:block;
  123. font-size: 14px;
  124. line-height: @search-height - 10px;
  125. margin: 0;
  126. width: 100%;
  127. color: @white;
  128. padding: 5px 10px 5px 40px;
  129. height: @search-height;
  130. line-height: @search-height;
  131. font-family: @base-font-family;
  132. border: none;
  133. border-radius: 3px;
  134. background:fade(@white,15%);
  135. box-sizing: border-box;
  136. -webkit-appearance: none;
  137. box-shadow: none;
  138. &:hover{
  139. background: fade(@white,35%);
  140. }
  141. &:focus {
  142. color:@black;
  143. background: @white;
  144. .set-placeholder({color: @black});
  145. }
  146. &:focus ~ .icon{
  147. color: @black;
  148. }
  149. .set-placeholder({color: @white});
  150. }
  151. }
  152. .menu-phone{
  153. position: fixed;
  154. top: 0;
  155. right: 0;
  156. width: 220px;
  157. z-index:9999;
  158. padding: @gap/2 0px;
  159. line-height: 2 * @gap;
  160. background: white;
  161. border: 1px solid #e6e7e6;
  162. border-right: 0;
  163. &:extend(.z-depth-1);
  164. transform: translate3d(280px, 0, 0);
  165. transition: all 0.24s ease;
  166. nav {
  167. .nav {
  168. position: relative;
  169. display: block;
  170. color: @black;
  171. font-size: 0.8125em;
  172. padding: 2px 20px;
  173. border-left: 3px solid transparent;
  174. &:hover {
  175. background: fade(lighten(#e1e2e3, 3%), 60%);
  176. border-color: @accent-color;
  177. }
  178. }
  179. }
  180. }