123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- a{
- text-decoration: none;
- color: #fff;
- &:hover{
- color: rgb(197,196,196);
- }
- }
- // 导航条的外部容器
- .top-bar-wrapper{
- background-color: #000;
- }
- .top-bar{
- max-width: 1200px;
- margin: 0 auto;
- height: 48px;
- padding: 0 14px;
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- }
- // 设置左侧的导航图标
- .left-menu{
- &:active{
- // 显示隐藏的菜单
- .nav{
- display: block;
- }
- }
- // position: relative;
- // 设置菜单
- .nav{
- display: none;
- position: absolute;
- top: 48px;
- left: 0;
- bottom: 0;
- right: 0;
- // 设置背景颜色
- background-color: #000;
- padding-top: 60px;
- li{
- width: 80%;
- margin: 0 auto;
- border-bottom: 1px solid #1f1f1f;
- a{
- display: block;
- line-height: 44px;
- font-size: 14px;
- }
- &:last-child a{
- display: inline-block;
- margin-right: 6px;
- }
- span{
- color: #fff;
- font-size: 14px;
- }
- }
- }
- // 图标
- .menu-icon{
- width: 18px;
- height: 48px;
- position: relative;
- // 导航的线
- li{
- width: 18px;
- height: 1px;
- background-color: #fff;
- position: absolute;
- // 修改变形的原点
- transform-origin: left center;
- transition: 0.5s;
- }
- li:nth-child(1){
- top: 18px;
- }
- li:nth-child(2){
- top: 24px;
- }
- li:nth-child(3){
- top: 30px;
- }
- // 鼠标移入以后的效果,正常项目时,效果需要通过js来实现
- &:active{
- li:nth-child(1){
- top: 18px;
-
- // 向下旋转
- transform: rotateZ(40deg);
- }
-
- li:nth-child(2){
- top: 24px;
-
- // 隐藏
- opacity: 0;
- }
-
- li:nth-child(3){
- top: 30px;
-
- transform: rotateZ(-40deg);
- }
- }
- }
- }
- // 设置logo
- .logo{
- a{
- text-indent: -9999px;
- display: block;
- width: 122px;
- height: 32px;
- background-image: url('../img/dff63979.sprites-index@2x.png');
- background-size: 400px 400px;
- }
- }
- // 设置媒体查询
- @media only screen{
- // 断点
- @media(min-width:768px){
- .left-menu{
- order: 2;
- flex:auto;
- // 显示菜单
- .nav{
- display: flex;
- position: static;
- padding: 0;
-
- justify-content: space-around;
- li{
- width: auto;
- border-bottom: none;
- margin: 0;
- a{
- line-height: 48px;
- }
- span{
- display: none;
- }
- }
- }
- // 隐藏菜单图标
- .menu-icon{
- display: none;
- }
- }
- .logo{
- order: 1;
- }
- .user-info{
- order: 3;
- }
- }
- }
|