_mainmenu.less 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. #main-menu-btn {
  2. display: block;
  3. float: left;
  4. height: @panel-height;
  5. line-height: @panel-height;
  6. padding: 0 30px 0 15px;
  7. z-index: 11;
  8. background-color: @main-menu-theme-color;
  9. &:hover {
  10. background-color: lighten(@main-menu-theme-color, 5%) !important;
  11. }
  12. &:active {
  13. background-color: darken(@main-menu-theme-color, 5%) !important;
  14. }
  15. .fui-label {
  16. height: @panel-height;
  17. line-height: @panel-height;
  18. font-size: 14px;
  19. color: white;
  20. }
  21. &:after {
  22. content: ' ';
  23. display: block;
  24. position: absolute;
  25. width: 0;
  26. height: 0;
  27. line-height: 0;
  28. font-size: 0;
  29. border: 6px solid;
  30. border-color: white transparent transparent transparent;
  31. right: 12px;
  32. top: @panel-height / 2 - 4;
  33. }
  34. }
  35. #main-menu {
  36. @left-width: 150px;
  37. background: white;
  38. .dock;
  39. overflow: hidden;
  40. transform: translate3d(0, -100%, 0);
  41. transform-origin: 0 0;
  42. opacity: 0;
  43. -webkit-transition: opacity .2s ease, -webkit-transform .2s ease;
  44. transition: opacity .2s ease, transform .2s ease;
  45. z-index: 100;
  46. &.show {
  47. opacity: 1;
  48. transform: translate3d(0, 0, 0);
  49. }
  50. .slide-in() {
  51. transform: translateX(-(@left-width)) translateZ(0);
  52. -webkit-transition: -webkit-transform .7s ease, opacity .5s ease;
  53. transition: transform .7s ease, opacity .5s ease;
  54. .show& {
  55. transform: translateX(0) translateZ(0);
  56. -webkit-transition: -webkit-transform .7s ease, opacity .5s ease;
  57. transition: transform .7s ease, opacity .5s ease;
  58. }
  59. }
  60. &:before {
  61. content: ' ';
  62. display: block;
  63. position: absolute;
  64. top: 0;
  65. left: @left-width;
  66. right: -1000px;
  67. bottom: 10px;
  68. box-shadow: 0 -3px 8px rgba(0,0,0,.15);
  69. z-index: 1;
  70. .slide-in;
  71. }
  72. .main-menu- {
  73. &header {
  74. background: white;
  75. height: @panel-height;
  76. }
  77. &back-panel {
  78. background-color: @main-menu-theme-color;
  79. float: left;
  80. width: @left-width;
  81. height: @panel-height;
  82. .main-menu-back-button {
  83. .fui-label {
  84. display: inline-block;
  85. color: white;
  86. margin-left: 10px;
  87. font-size: 14px;
  88. display: none;
  89. }
  90. .fui-icon {
  91. display: inline-block;
  92. width: 25px;
  93. height: 25px;
  94. line-height: 25px;
  95. border-radius: 100%;
  96. border: 2px solid white;
  97. background: url(../images/icons.png) -1px -370px;
  98. vertical-align: middle;
  99. }
  100. width: @left-width - 10px;
  101. height: @panel-height - 10px;
  102. padding: 5px;
  103. &:hover {
  104. background: -moz-linear-gradient(left, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
  105. background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0.3)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
  106. background: -webkit-linear-gradient(left, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
  107. background: -o-linear-gradient(left, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
  108. background: -ms-linear-gradient(left, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
  109. background: linear-gradient(to right, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%); /* W3C */
  110. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4dffffff', endColorstr='#00ffffff',GradientType=1 ); /* IE6-9 */
  111. }
  112. &:active {
  113. background: darken(@main-menu-theme-color, 10%);
  114. }
  115. }
  116. }
  117. &title {
  118. margin-left: @left-width;
  119. height: @panel-height;
  120. display: block;
  121. background: white;
  122. z-index: 2;
  123. text-align: center;
  124. font-size: 12px;
  125. font-weight: normal;
  126. line-height: @panel-height;
  127. color: #999;
  128. .slide-in;
  129. }
  130. &level1 {
  131. position: absolute;
  132. left: 0;
  133. right: 0;
  134. bottom: 0;
  135. top: @panel-height;
  136. & > .fui-tabs- {
  137. &button-wrap {
  138. .dock(0, auto, 0, 0);
  139. width: @left-width;
  140. position: absolute;
  141. background-color: @main-menu-theme-color;
  142. .fui-button {
  143. display: block;
  144. text-align: right;
  145. height: 50px;
  146. .fui-label {
  147. height: 50px;
  148. line-height: 50px;
  149. color: white;
  150. padding-right: 20px;
  151. font-size: 16px;
  152. }
  153. &:hover {
  154. background: darken(@main-menu-theme-color, 5%);
  155. }
  156. &:active {
  157. background: darken(@main-menu-theme-color, 10%);
  158. }
  159. &.fui-selected {
  160. background: lighten(@main-menu-theme-color, 10%);
  161. }
  162. }
  163. }
  164. /* 二级菜单区域 */
  165. &panel-wrap {
  166. .dock(0, 0, 0, @left-width);
  167. background-color: white;
  168. z-index: 2;
  169. .slide-in;
  170. /* 每个二级菜单的面板 */
  171. & > .fui-panel {
  172. .dock(0, @panel-height);
  173. /* 面板内容 */
  174. & > .fui-panel-content {
  175. .dock;
  176. /* 二级菜单大标题 */
  177. & > h2 {
  178. font-size: 24px;
  179. font-weight: normal;
  180. margin-top: 0;
  181. margin-bottom: 20px;
  182. color: @main-menu-fore-color;
  183. }
  184. /* 二级菜单导航 */
  185. & > .fui-tabs {
  186. .dock;
  187. /* 二级导航菜单区域 */
  188. & > .fui-tabs-button-wrap {
  189. .dock(60px, auto, 30px, 0);
  190. display: block;
  191. width: 180px;
  192. border-right: 1px solid lighten(@tab-active, 50%);
  193. & > .fui-button {
  194. display: block;
  195. height: 50px;
  196. line-height: 50px;
  197. text-align: right;
  198. padding-right: 20px;
  199. & > .fui-label {
  200. font-size: 14px;
  201. line-height: 50px;
  202. color: @main-menu-fore-color;
  203. }
  204. &:hover {
  205. background-color: lighten(@tab-hover, 40%);
  206. & > .fui-label {
  207. }
  208. }
  209. &.fui-selected {
  210. background-color: lighten(@tab-active, 20%);
  211. & > .fui-label {
  212. color: white;
  213. }
  214. }
  215. }
  216. }
  217. /* 二级菜单内容区域 */
  218. & > .fui-tabs-panel-wrap {
  219. .dock(60px, 0, 30px, 200px);
  220. & > .fui-panel {
  221. display: block;
  222. .dock;
  223. & > .fui-panel-content {
  224. .dock;
  225. display: block;
  226. h2 {
  227. padding-bottom: 10px;
  228. height: 30px;
  229. line-height: 30px;
  230. border-bottom: 1px solid hsl(0, 0%, 93%);
  231. font-size: 18px;
  232. font-weight: normal;
  233. margin: 0;
  234. padding-left: 38px;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. }
  241. animation: slideRight 0.3s ease;
  242. animation-fill-mode: backward;
  243. animation-direction: reverse;
  244. &.fui-hide {
  245. animation-fill-mode: forward;
  246. animation-direction: normal;
  247. }
  248. }
  249. }
  250. }
  251. }
  252. }
  253. }
  254. @keyframes slideLeft {
  255. }
  256. @keyframes slideRight {
  257. 0% {
  258. transform: translate(0, 0);
  259. opacity: 1;
  260. display: block !important;
  261. }
  262. 100% {
  263. transform: translate(50px, 0);
  264. opacity: 0;
  265. display: none !important;
  266. }
  267. }