import {Device} from '../../base/Device';
import { WOW } from 'wowjs';
import {UAnimateContainer, UAnimate} from 'vue-wow';
import { Swipe, SwipeItem } from 'mint-ui';

/**
 * @author yeyuchao
 * @description elab是谁
 */
const screenHeight = window.screen.height;
const screenWidth = window.screen.width;
const videoWidth   = screenWidth/2;//calculate the video width;
const videoHeight  = screenHeight / 2;//calculate the video height;

export default {

  data() {
    return {
      screenHeight:screenHeight,
      screenWidth:screenWidth,
      showTimeLineComplete:false,
      slideImageList:[
        "https://dm.static.elab-plus.com/elabGuanWang/Slider/1.jpg",
        "https://dm.static.elab-plus.com/elabGuanWang/Slider/2.jpg",
        "https://dm.static.elab-plus.com/elabGuanWang/Slider/3.jpg",
        "https://dm.static.elab-plus.com/elabGuanWang/Slider/4.jpg",
        "https://dm.static.elab-plus.com/elabGuanWang/Slider/5.jpg",
        "https://dm.static.elab-plus.com/elabGuanWang/Slider/6.jpg",
        "https://dm.static.elab-plus.com/elabGuanWang/Slider/7.jpg",
        "https://dm.static.elab-plus.com/elabGuanWang/Slider/8.jpg",
      ],
      device:null,
      deviceMobile:false,
      leftMonthStyle:"",
      leftDescription:"",
      videoWidth:videoWidth,
      videoHeight:videoHeight,
      elabCreaterVideo:"http://yun-image.elab-plus.com/video/Elab%20Final%EF%BC%88%E8%94%A1%E6%80%BB%E5%88%9B%E4%B8%9ATED%E6%BC%94%E8%AE%B2%EF%BC%89.mp4",
      createrBg:"https://dm.static.elab-plus.com/elabGuanWang/CaiXueMeiPic.png",
      widthStyle:"",
      showCreateVideo:true,
    };
  },

  components: {
    UAnimateContainer,
    UAnimate
  },

  mounted() {
  },

  created() {
    window.itemType = 1;
    if(!window.loadComplete){
      this.$router.push('/');
      return
    }
    this.device = new Device();
    if(this.device.phone){
      this.deviceMobile = true;
      // https://dm.static.elab-plus.com/elabGuanWang/caixuemeiElab.png
      // https://dm.static.elab-plus.com/elabGuanWang/caixuemeiPhone.png
      this.createrBg = "https://dm.static.elab-plus.com/elabGuanWang/caixuemeiElab.png";
      this.widthStyle = "width:50%;display:inline-block;height: 15vh;font-size: 0px;vertical-align: middle;text-align:center;"
    }
    this.leftMonthStyle = 'left:'+this.deviceMobile?'-46vw;':'-44vw;'+'text-align:right;';
    this.leftDescription = 'left:'+this.deviceMobile?'-46vw;':'-44vw;'+'text-align:right;';

    window.onpopstate = () => {
      if(this.showCreateVideo){
        return
      }
    }

  },

  methods:{
    getTarget() {
      return this.$el;
    },
    /**
     * 查看创始人视频
     */
    checkCreatorVideo(){
      this.$refs.elabVideo.navigationToVideo();
    },
    /**
     * 查看创始人
     */
    checkCreator(){
      this.$router.push('/elabCreator');
    },
    /**
     * 查看更多
     */
    checkMore(){
      this.showTimeLineComplete = !this.showTimeLineComplete;
    },
    /**
     * 点击加入我们
     */
    clickJoin(){
      this.$router.push('/careers');
    }
  }

};
