<template>
  <div class="features">
    <div class="container">
      <div class="top clearfix">
        <div class="title">
          <p>Five major features</p>
          <h2>五大特点</h2>
        </div>
      </div>
      <ul class="content clearfix list-unstyled">
        <li v-for="(data, index) in featureData" :class="{'moveTop': isTop}"
            @mouseenter="isTop = true"
            @mouseleave="isTop = false">
            <div>
              <p>{{data.illustrationF}}</p>
              <p class="illustration">{{data.illustrationS}}</p>
            </div>
         </li>
      </ul>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'FiveFeature',
    data () {
      return {
        featureData: [{
          illustrationF: '颠覆传统ERP及',
          illustrationS: '管理软件市场模式'
        }, {
          illustrationF: '平台用户的链式',
          illustrationS: '反应式发展'
        }, {
          illustrationF: '企业信息化',
          illustrationS: '全面解决方案'
        }, {
          illustrationF: '全过程的移动',
          illustrationS: '互联解决方案'
        }, {
          illustrationF: ' 全智能的',
          illustrationS: '交易平台'
        }, {
          illustrationF: '平台用户的链式',
          illustrationS: '反应式发展'
        }],
        timerIndex: 0,
        isTop: false
      }
    }
//    mounted () {
//      this.$nextTick(() => {
//        this.changeInterval(true)
//      })
//    },
//    methods: {
//      changeInterval: function (flag) {
//        if (flag) {
//          this.timer = setInterval(() => {
//            this.timerIndex ++
//            if (this.timerIndex % 2 === 0) {
//              this.isTop = true
//              this.isBottom = false
//            } else {
//              this.isTop = false
//              this.isBottom = true
//            }
//          }, 3000)
//        } else {
//          clearInterval(this.timer)
//        }
//      }
//    }
  }
</script>

<style type="text/scss" lang="scss" scoped>
  @keyframes featureTop {
    0%{transform: translate3d(0, 0px, 0);}
    50%{transform: translate3d(0, 40px, 0);}
    100%{transform: translate3d(0, 0px, 0);}
  }
  @-webkit-keyframes featureTop {
    0%{transform: translate3d(0, 0px, 0);}
    50%{transform: translate3d(0, 40px, 0);}
    100%{transform: translate3d(0, 0px, 0);}
  }
  @-moz-keyframes featureTop {
    0%{transform: translate3d(0, 0px, 0);}
    50%{transform: translate3d(0, 40px, 0);}
    100%{transform: translate3d(0, 0px, 0);}
  }
  @-o-keyframes featureTop {
    0%{transform: translate3d(0, 0px, 0);}
    50%{transform: translate3d(0, 40px, 0);}
    100%{transform: translate3d(0, 0px, 0);}
  }


  @keyframes featureBottom {
    0%{transform: translate3d(0, 40px, 0);}
    50%{transform: translate3d(0, 0px, 0);}
    100%{transform: translate3d(0, 40px, 0);}
  }
  @-webkit-keyframes featureBottom {
    0%{transform: translate3d(0, 40px, 0);}
    50%{transform: translate3d(0, 0px, 0);}
    100%{transform: translate3d(0, 40px, 0);}
  }
  @-moz-keyframes featureBottom {
    0%{transform: translate3d(0, 40px, 0);}
    50%{transform: translate3d(0, 0px, 0);}
    100%{transform: translate3d(0, 40px, 0);}
  }
  @-o-keyframes featureBottom {
    0%{transform: translate3d(0, 40px, 0);}
    50%{transform: translate3d(0, 0px, 0);}
    100%{transform: translate3d(0, 40px, 0);}
  }
  .features{
    width: 100%;
    min-width: 1190px;
    height: 464px;
    background-color: #f7f7f7;
    .container{
      width: 1190px;
      margin: 0 auto;
      .top{
        padding-top:30px;
        margin-bottom:50px;
        .title{
          margin: 0 auto;
          text-align: center;
          width:215px;
          border-bottom:1px solid #ff7070;
          p{
            margin:0;
            font-size: 14px;
            color: #666;
          }
          h2{
            font-size: 32px;
            margin:0;
            line-height: 46px;
            color: #333;
          }
          &::before{
            content: '';
            display:block;
            position:relative;
            left:55px;
            top:61px;
            width:105px;
            height:1px;
            background: #00caff;
          }
          &::after{
            content: '';
            display:block;
            position:relative;
            left:55px;
            top:4px;
            width:105px;
            height:1px;
            background: #4391f7;
          }
        }

      }
      .content{
        width: 1140px;
        height: 228px;
        margin: 0 auto;
        padding-left: 3px;
        li{
          float: left;
          height: 228px;
          width: 165px;
          margin-right: 29px;
          &:nth-child(6){
            margin-right: 0px;
          }
          &:nth-child(2), &:nth-child(4), &:nth-child(6){
            div{
              top: 0px;
              transform: translate3d(0, 40px, 0);
              animation: featureTop 15s linear infinite;
              -moz-animation: featureTop 15s linear infinite;
              -o-animation: featureTop 15s linear infinite;
              -webkit-animation: featureTop 15s linear infinite;
            }

          }
          &:nth-child(1), &:nth-child(3), &:nth-child(5){
            div{
              top: 0px;
              transform: translate3d(0, 0px, 0);
              -webkit-transform-style: preserve-3d;
              -webkit-backface-visibility: hidden;
              animation: featureBottom 15s linear infinite;
              -moz-animation: featureBottom 15s linear infinite;
              -o-animation: featureBottom 15s linear infinite;
              -webkit-animation: featureBottom 15s linear infinite;
            }
          }
          div{
            width: 163px;
            height: 186px;
            padding-top:80px;
            position: relative;
            background: url('/images/btbBusiness/feature-bg0.png') no-repeat center;
            &:hover{
              cursor: pointer;
              background: url('/images/btbBusiness/feature-bg1.png') no-repeat center;
              p{
                color: #2d84fd;
              }
            }
            p {
              margin: 0px;
              font-size: 18px;
              text-align: center;
              width: 100%;
              color: #fff;
              &:last-child{
                font-weight: bold;
              }
            }
          }
        }
        .moveTop {
          &:nth-child(2), &:nth-child(4), &:nth-child(6) {
            div {
              animation-play-state: paused;
              -webkit-animation-play-state: paused;
              transform: translateZ(0);
            }

          }
          &:nth-child(1), &:nth-child(3), &:nth-child(5) {
            div {
              animation-play-state: paused;
              -webkit-animation-play-state: paused;
              transform: translateZ(0);
            }
          }
        }
       /* .move{
          &:nth-child(2), &:nth-child(4), &:nth-child(6){
            div{
              top: 40px;
              animation: featureTop 3s linear infinite;
              -moz-animation: featureTop 3s linear infinite;
              -o-animation: featureTop 3s linear infinite;
              -webkit-animation: featureTop 3s linear infinite;
            }
          }
          &:nth-child(1), &:nth-child(3), &:nth-child(5){
            div{
              top: 0px;
              animation: featureBottom 3s linear infinite;
              -moz-animation: featureBottom 3s linear infinite;
              -o-animation: featureBottom 3s linear infinite;
              -webkit-animation: featureBottom 3s linear infinite;

            }
          }
        }*/
       /* .moveBottom {
            &:nth-child(2), &:nth-child(4), &:nth-child(6) {
              div {
                top: 0px;
              }
            }
            &:nth-child(1), &:nth-child(3), &:nth-child(5) {
              div {
                top: 40px;
              }
            }
        }
        .moveTop{
           &:nth-child(2), &:nth-child(4), &:nth-child(6){
             div{
               top: 40px;
             }
           }
           &:nth-child(1), &:nth-child(3), &:nth-child(5){
             div{
               top: 0px;
             }
           }
       }*/
      }
    }
  }
</style>
