<template>
    <div id="box1" :style="{
      top: position[0]-300+'px',
      left: position[1]+ 'px'
    }">
      <div class="wrap">
        <!--  边框  -->
        <div class="border" style="top: 0px;width: 208px;height: 1px;margin-left: 42px"></div>
        <div class="border" style="bottom: 50px;width: 208px;height: 1px;"></div>
        <div class="border" style="bottom: 50px;width: 1px;height: 208px;"></div>
        <div class="border" style="top: 0px;width: 1px;height: 208px;right: 0px"></div>
        <div class="border" style="top: 0px;left: 50px;transform: rotate(45deg) translate(8px, -20px);height: 58px;width: 1px"></div>
        <div class="border" style="bottom: 50px;right: 0px;transform: rotate(45deg) translate(-8px, 20px);height: 58px;width: 1px;"></div>
        <!--  标题      -->
        <div style="height: 10px"></div>
        <div class="title center">
          {{title}}
        </div>
        <div style="width: 220px;margin-left: 30px;height: 1px;background: #29baf1;margin-top: 5px;box-shadow: 0 0 10px 2px #29baf1;"></div>

      <!--  内容   -->
        <div v-if="data.length>0" style="width: 230px;height: 190px;margin: auto;color: #ffffff;overflow: hidden">
            <div v-for="(item,index) of data" :key="item" style="width: 100%;height: 40px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis" class="center">
              <div class="lable center" style="width: 35%;height: 100%;">{{item.label}}</div>
              <div class="content center" style="width: 65%;height: 100%;justify-content: left">{{item.value}}</div>
            </div>
        </div>

        <div v-else style="width: 230px;height: 190px;margin: auto;color: #ffffff;overflow: hidden">
          <div  style="width: 100%;height: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis" class="center">
             暂无数据
          </div>
        </div>
      </div>
      <div class="line"></div>
      <div class="" style="position: absolute;bottom: 0;left: 0;width: 10px;height: 10px;border-radius: 50%;background: radial-gradient(#00ffff,#004480,#02004a)"></div>
    </div>
</template>

<script>
export default {
  name: "box1",
  props: {
    title: {
      type: "String",
      default: '建筑'
    },
    data: {
      type: "Array",
      default: []  //[ {label: '姓名' , value: '梁汉强'}]
    },
    position: {
      type: "Array",
      default: [0,0]
    }
  }
}
</script>

<style scoped>
.full{
  width: 100%;
  height: 100%;
}
#box1{
  /*background: #ef1717;*/
  width: 300px;
  height: 300px;
  position: absolute;
  /*background: #ffffff;*/
}
.wrap{
  width: 250px;
  height: 250px;
  margin-left: 50px;
  background-image:
    linear-gradient(135deg, transparent 30px, #28abf06c 30px, #28abf06c 50%, transparent 50%),
    linear-gradient(-45deg, transparent 30px, #28abf06c 30px, #28abf06c 50.1%, transparent 50%);
}
.line{
  height: 70px;
  width: 1px;
  background: linear-gradient(to top, #00bdff, #11bcf8);
  transform: rotate(45deg) translate(10px, -25px);
}
.center{
  display: flex;
  justify-content: center;
  align-items: center;
}
.border{
  position: absolute;
  background-color: #29baf1;
  box-shadow: 0 0 10px 2px #29baf1;
}
.title{
  letter-spacing: 5px;
  color: white;
  font-weight: bold;
  width: 220px;
  height: 40px;
  margin-left: 30px;
  background-image: linear-gradient(135deg, transparent 25px, #2299c4 25px);
}
.changColor{
  animation: color 0.2s linear infinite;
}
@keyframes color {
  from{
    background: radial-gradient(red, #ff00e5)
  }
  to{
    background: radial-gradient(blue,red)
  }
}
</style>
