<template>
  <div class="birdview">
    <img :src="require(`@/assets/images/resource/map/map.jpg`)" alt="" />
    <div class="tag" @click="onBack" :style="{
      top: tagData?.top,
      left: tagData?.left,
    }">
      <img :src="require(`@/assets/images/resource/map/ico_address_active.png`)" alt="" />
    </div>
    <img class="close" @click="onBack" :src="require(`@/assets/images/resource/map/btn_back.png`)" alt="" />
    <div class="shoqi" @click="isAside = true">
      <img :src="require(`@/assets/images/resource/map/ico_up.png`)" alt="" />
    </div>
    <div class="raside" :class="{ show: isAside }">
      <raside @close="isAside = false" />
    </div>
</div>
</template>

<script setup>


import { onMounted, computed, inject, ref, nextTick } from "vue";
import { useRouter, useRoute } from "vue-router";
import { scene,tag_position } from "@/data";
import raside from "./raside.vue";

const router = useRouter();

let isAside = ref(true)

let tags = ref(scene);


const route = useRoute();
const tagData = computed(() => tag_position[route.params.id])


let onBack = (data) => {
  router.replace({ name: 'scene',params:{id:route.params.id} })
};


</script>

<style lang="scss" scoped>
$w: 8px;

.birdview {
  width: 100%;
  height: 100%;
  z-index: 400;
  display: flex;
  justify-content: center;
  position: relative;

  >img {
    height: 100%;
  }

  .close {
    width: 60px;
    height: 60px;
    position: absolute;
    top: 28px;
    left: 20px;
    cursor: pointer;
    z-index: 99;
  }

  .shoqi {
    width: 60px;
    height: 60px;
    position: absolute;
    top: 28px;
    right: 40px;
    cursor: pointer;
    z-index: 99;
    border-radius: 50%;
    background: rgba(229, 220, 203, 0.3);
    backdrop-filter: blur(46px);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;

    >img {
      width: 24px;
    }
  }

  .tag {
    position: absolute;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    top: 50%;
    left: 50%;
    width: 40px;

    // background: #000;
    >img {
      width: 100%;
      display: inline-block;
      position: absolute;
      left: 50%;
      transform: translate(-50%, 0);
      top: 45%;
    }

  }

  .raside {
    position: absolute;
    right: -368px;
    top: 0;
    z-index: 101;
    width: 368px;
    height: 100%;
    background: rgba(229, 220, 203, 0.3);
    backdrop-filter: blur(46px);
    transition: ease 0.3s all;

    &.show {
      right: 0;
    }
  }
}


@keyframes upanddown {
  0% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, -16px);
  }

  100% {
    transform: translate(-50%, 0);
  }
}
</style>
