<template>
  <div>
    <div
      :style="{
        background: `#fff url(${info && info.icon}) center / cover no-repeat`
      }"
      :class="['app_icon']"
    ></div>
    <div :class="['app_name']">{{ info && info.name }}</div>
    <div class="app_menu">
      <div
        v-for="(item, index) in info.subMenu"
        :key="index"
        class="menu"
        :style="{ background: `url(${item.icon}) center/cover no-repeat` }"
      ></div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    info: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {};
  }
};
</script>
<style lang="less" scoped>
.app_icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  bottom: -20px;
  transition: all 0.3s;
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1);
  -webkit-app-region: no-drag;
  z-index: 2;
}
.app_name {
  color: #666;
  font-size: 12px;
  text-align: center;
  margin-top: 10px;
  opacity: 0;
  transition: all 0.3s;
}
.app_menu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s;
  z-index: 1;
  opacity: 0;
  .menu {
    transition: all 0.3s;
    width: 52px;
    height: 52px;
    line-height: 52px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
    box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    &:nth-child(1) {
      transition-delay: 0;
    }
    &:nth-child(2) {
      transition-delay: 0.1s;
    }
    &:nth-child(3) {
      transition-delay: 0.15s;
    }
  }
}
</style>
