<template>
  <div id="headBtn">
    <div v-for="item,index in data" :key="index" class="btnRound" @click="handleClick(index)">
      <span class="top-left border-span"></span>
      <span class="bottom-right border-span"></span>
      {{item.name}}
    </div>
  </div>
</template>

<script>
  import {fullscreenToggel} from "../../../util/util.js";
  export default{
    data(){
      return{
       data:[{
         name:'返回'
       },{
         name:'全屏'
       },{
         name:'退出'
       }]
      }
    },
    methods:{
      handleClick(index){
        if(index==2){
          this.$router.push({
            path:'index'
          })
        }else if(index==0){
          this.$router.back(-1)
        }else if(index==1){
          fullscreenToggel();
        }
      }
    }
  }
</script>

<style lang="less" scoped="scoped">
  #headBtn{
    display: flex;
    position: absolute;
    top: .4rem;
    left: .2rem;
    .btnRound{
      box-sizing: border-box;
      font-size: 12px;
      padding: 1px 10px;
      margin-right: 10px;
      color: #fff;
      cursor: pointer;
      position: relative;
      transition: all 0.5s linear;
      box-shadow: inset 0 0 50px rgba(255,255,255,.1), 0 0 5px rgba(0,0,0,.3);
    }
    .btnRound:hover{
      transition: all 0.5s linear;
      .top-left{
        top: -2px;
            left: -2px;
            border-top: 2px solid #fff;
            border-left: 2px solid #fff;
      }
      .bottom-right{
        bottom: -2px;
            right: -2px;
            border-bottom: 2px solid #fff;
            border-right: 2px solid #fff;
      }
    }
    .border-span{
          display: block;
          position: absolute;
          width: 8px;
          height: 8px;
          opacity: .5;
    }
    .top-left{
      top: -2px;
          left: -2px;
          border-top: 2px solid #54dcf2;
          border-left: 2px solid #54dcf2;
    }
    .top-right{
      top: -2px;
          right: -2px;
          border-top: 2px solid #54dcf2;
          border-right: 2px solid #54dcf2;
    }
    .bottom-left{
      bottom: -2px;
          left: -2px;
          border-bottom: 2px solid #54dcf2;
          border-left: 2px solid #54dcf2;
    }
    .bottom-right{
      bottom: -2px;
          right: -2px;
          border-bottom: 2px solid #54dcf2;
          border-right: 2px solid #54dcf2;
    }
  }
</style>
