var cc_data = cc_data || {};



new Vue({
    el: '#app',
    data: {
        select: false,
        screen: 0,
    },
    created: function () {
        var that = this;
        document.addEventListener('keydown', function () {
            if (that.screen == 1) { that.runupdate(); }
            else if (that.screen == 4) {
                that.playpause();
            } 
        })
    },
    mounted: function () {
      
        
    },
    methods: {
        playpause: function () {
            let video = document.getElementById('vid');
                 if (video.paused) {
              video.currentTime = 0;
              video.play();
              
           } else {
              video.pause();
              
           }
        },
        runupdate: function () {
          var that = this;
          this.screen = 2;
          setTimeout(function () { 
              if (that.screen == 2 ) { 
              that.screen = 3; 
              }
          }, 8000);
        },
        showvideo: function () {
            var that = this;
          this.select = true;
          setTimeout(function () { that.screen = 4; that.select = false; }, 500);
          setTimeout(function () { document.getElementById('vid').play(); }, 800);
        },
        init: function () {

        },
        stopPropagation: function (e) {
            e.stopPropagation();
        }
    }
})