tab.less 2.98 KB
.m-nav{
	width: 100%;
	font-size: 14px;
	color: #999;
	overflow: hidden;
	box-sizing: border-box;
	a{
		color: #999;
    padding: 0 10px;
    min-width: 70px;
		display: block;
	}
	li{
		float: left;
		line-height: 40px;
		text-align: center;
		position: relative;
		&:last-child{
			padding-right: 0;
		}
	}
	.on{
		a{
			color: #FFF;
      background-color: #23ac38;
			display: block;
			position: relative;
		}
	}
}


.m-tab{
	width: 100%;
	background-color: #FFF;
	font-size: 14px;
	color: #999;
	// border: 1px solid #ddd;
	border-width: 1px 0;
	overflow: hidden;
	box-sizing: border-box;
	margin-bottom: 10px;
	a{
		display: block;
		color: #999;
		padding: 0 10px;
    min-width: 70px;
	}
	li{
		float: left;
		line-height: 45px;
		text-align: center;
		position: relative;
		&:last-child{
			padding-right: 0;
		}
	}
	.on{
		a{
			color: #23ac38;
			display: block;
			position: relative;
			&:after{
				content: '';
				position: absolute;
				bottom: 0;
				left: 0;
				right: 0;
				height: 2px;
				background-color: #23ac38;
			}
		}
	}
  &.hasright {
    position: relative;
    &:before {
      content: ' ';
      display: block;
      position: absolute;
      top: 18px;
      left: 94%;
      width: 0;
      height: 0;
      border-style: solid;
      border-width: 5px 0 5px 5px;
      border-color: transparent transparent transparent #23ac38;
      transform: scaleY(1);
      animation: movehint 1.2s linear 3; 
      -webkit-animation: movehint 1.2s linear 3; 
      transition: all .3s;
      -webkit-transition: all .3s;
      opacity: 0;
    }
    &:after {
      content: ' ';
      display: block;
      position: absolute;
      top: 18px;
      left: 96%;
      width: 0;
      height: 0;
      border-style: solid;
      border-width: 5px 0 5px 5px;
      border-color: transparent transparent transparent #23ac38;
      transform: scaleY(1);
      animation: movehint 1.2s linear 3; 
      -webkit-animation: movehint 1.2s linear 3; 
      transition: all .3s;
      -webkit-transition: all .3s;
      opacity: 0;
    }
  }
}
@keyframes movehint {
  0%, 20%, 53%, 80%, 100% {
    -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
            transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    -webkit-transform: translate3d(0,0,0);
            transform: translate3d(0,0,0);
    opacity: 1;
  }

  40%, 43% {
    -webkit-transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
            transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    -webkit-transform: translate3d(-20px, 0, 0);
            transform: translate3d(-20px, 0, 0);
  }

  70% {
    -webkit-transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
            transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    -webkit-transform: translate3d(-10px, 0, 0);
            transform: translate3d(-10px, 0, 0);
  }

  90% {
    -webkit-transform: translate3d(-4px, 0, 0);
            transform: translate3d(-4px, 0, 0);
  }
}