<template>
  <div class="grid-item-main">
    <div class="corlor-grid" :class="size">
      <div class="left-color" :style="{ background: item.leftColor }"></div>
      <div class="rigth-color">
        <div :style="{ background: item.rightTopColor }"></div>
        <div
          class="rigth-bottom"
          v-show="item.color == 'HF' || item.color == 'NF'"
        ></div>
      </div>
    </div>
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {},
    },
    size: {
      type: String,
      default: "medium",
    },
  },
  data() {
    return {};
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.grid-item-main {
  display: flex;
  align-items: center;
  justify-content: center;
  .medium {
    height: 20px;
    width: 48px;
  }
  .small {
    width: 35px;
    height: 15px;
  }
  .corlor-grid {
    position: relative;

    border: 1px solid white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    .left-color {
      flex: 1;
      height: 100%;
    }
    .rigth-color {
      flex: 1;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      border-left: 1px solid white;
      & > div {
        flex: 1;
        width: 100%;
      }
      .rigth-bottom {
        background: red;
        border-top: 1px solid white;
        // border-left: 1px solid white;
      }
    }
    .house_number {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      color: white;
      font-size: 0.23rem;
    }
    .grid-islable {
      position: absolute;
      top: -50%;
      left: 0;
      width: 120%;
      text-align: left;
      img {
        display: inline-block;
        width: 0.22rem;
        height: 0.22rem;
      }
    }
    .grid-point {
      position: absolute;
      right: -25%;
      height: 0.09rem;
      width: 0.09rem;
      border-radius: 50%;
      border: 0.03rem solid white;
    }
  }
}
</style>
