index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="birdview" :style="{ backgroundImage: `url(${require(`@/assets/images/proj2022/pc/birdviewbg.jpg`)})` }">
  3. <img v-if="!hideClose" class="close" @click="close" :src="require('@/assets/images/proj2022/pc/cancel.png')" alt="" />
  4. <div class="tag" v-for="(item, i) in themes" :key="i" :class="item.id">
  5. <img @click="onClick(item)" :src="require(`@/assets/images/proj2022/bird_view/${item.id}.png`)" alt="" />
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import { region } from "@/data/raw.js";
  11. export default {
  12. data() {
  13. return {
  14. show: true,
  15. hideClose: false,
  16. themescene: "",
  17. };
  18. },
  19. methods: {
  20. close() {
  21. this.$hideBirdView();
  22. },
  23. onClick(data) {
  24. let fn = () => {
  25. let currentRegion = region.find((item) => item.id == data.id);
  26. let { x, y, z, w } = currentRegion.firstView.panoQuaternion;
  27. window.player.blackToPano({
  28. pano: window.player.model.panos.index[currentRegion.firstView.panoId],
  29. quaternion: new window.THREE.Quaternion(x, y, z, w),
  30. });
  31. };
  32. if (window.player.mode != "panorama") {
  33. window.player.director.changeMode("panorama").then(()=>{
  34. fn();
  35. setTimeout(() => {
  36. this.close();
  37. }, 300);
  38. });
  39. } else {
  40. setTimeout(() => {
  41. fn();
  42. this.close();
  43. }, 300);
  44. }
  45. },
  46. },
  47. };
  48. </script>
  49. <style lang="less" scoped>
  50. .birdview {
  51. position: fixed;
  52. left: 0;
  53. top: 0;
  54. width: 100%;
  55. height: 100%;
  56. z-index: 99999;
  57. background-size: cover;
  58. background-position: center;
  59. background-repeat: no-repeat;
  60. .close {
  61. position: absolute;
  62. right: 30px;
  63. top: 30px;
  64. cursor: pointer;
  65. z-index: 99;
  66. }
  67. .tag {
  68. position: absolute;
  69. max-width: 10%;
  70. cursor: pointer;
  71. display: inline-block;
  72. &::after {
  73. pointer-events: none;
  74. animation: highlight-move 3s infinite;
  75. background: linear-gradient(90deg, hsla(0, 0%, 100%, 0) 0, hsla(0, 0%, 100%, 0.3) 50%, hsla(0, 0%, 100%, 0));
  76. content: "";
  77. height: 88%;
  78. left: 0%;
  79. position: absolute;
  80. top: 0;
  81. transform: skewX(-45deg);
  82. width: 40%;
  83. }
  84. > img {
  85. width: 100%;
  86. }
  87. }
  88. .one {
  89. top: 48%;
  90. left: 49%;
  91. }
  92. .two {
  93. top: 38%;
  94. left: 55%;
  95. }
  96. .three {
  97. top: 30%;
  98. left: 62%;
  99. }
  100. .four {
  101. top: 15%;
  102. left: 47%;
  103. }
  104. .five {
  105. top: 23%;
  106. left: 37%;
  107. }
  108. .xuting {
  109. top: 53%;
  110. left: 38%;
  111. }
  112. .weiting {
  113. top: 33%;
  114. left: 30%;
  115. }
  116. }
  117. @keyframes highlight-move {
  118. 0% {
  119. left: 0%;
  120. }
  121. 100% {
  122. left: 70%;
  123. }
  124. }
  125. </style>