aside.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <div class="shoula">
  3. <ul>
  4. <li
  5. @click="handleChange(item)"
  6. :style="{ '--bgColor': item.theme }"
  7. :class="{ active: item.id == $route.params.type }"
  8. v-for="(item, i) in themes"
  9. :key="i"
  10. >
  11. <img :src="require(`@/assets/images/proj2022/pc/diwen.png`)" alt="" />
  12. <div class="arrow" >
  13. <img :src="require(`@/assets/images/proj2022/pc/enter_1.png`)" alt="" />
  14. </div>
  15. <div class="txtcon">
  16. <span class="tag">{{ item.short }}</span>
  17. <span class="text" :title="item.desc || item.name">{{ item.desc || item.name }}</span>
  18. </div>
  19. </li>
  20. </ul>
  21. <img v-if="ishowzbtn" class="zhankai" @click="zhankai" :src="require(`@/assets/images/proj2022/pc/zhankai.png`)" alt="" />
  22. </div>
  23. </template>
  24. <script>
  25. import panodata from "@/components/mapsvg/pano.js";
  26. import { Booth } from "@/data/raw.js";
  27. export default {
  28. props: ["currentPanoid"],
  29. mounted() {
  30. this.$bus.$on("isShowAside", (data) => {
  31. this.isShow = data;
  32. });
  33. this.$bus.$on("toggleShowZX", (data) => {
  34. this.ishowzbtn = !data;
  35. });
  36. },
  37. data() {
  38. return {
  39. isShow: true,
  40. panodata,
  41. showMap: false,
  42. hoverName: "",
  43. booth: Booth,
  44. ishowzbtn: false,
  45. };
  46. },
  47. computed: {
  48. cp() {
  49. return "v" + this.$route.params.type;
  50. },
  51. currentItem() {
  52. return this.themes.find((item) => item.id == this.theme);
  53. },
  54. currentPano() {
  55. return Booth.find((item) => item.panoId == this.currentPanoid) || {};
  56. },
  57. },
  58. watch: {
  59. isShow(newVal) {
  60. this.$bus.$emit("closehotspot", newVal);
  61. },
  62. currentPano(newVal) {
  63. this.$emit("currentPano", newVal);
  64. },
  65. },
  66. methods: {
  67. zhankai() {
  68. this.$bus.$emit("toggleShowZX", true);
  69. },
  70. handleChange(item) {
  71. this.$router.push({ params: { type: item.id, isjump: "yes" } });
  72. },
  73. handleHover(data) {
  74. this.hoverName = data.name;
  75. },
  76. openMap() {
  77. this.showMap = true;
  78. this.isShow = false;
  79. },
  80. },
  81. };
  82. </script>
  83. <style lang="less" scoped>
  84. @conW: 220px;
  85. @gap: 20px;
  86. @lgap: 8px;
  87. .shoula {
  88. position: fixed;
  89. bottom: 120px;
  90. width: @conW;
  91. z-index: 999;
  92. > ul {
  93. margin: 0 auto;
  94. width: 100%;
  95. > li {
  96. width: 50%;
  97. height: 71px;
  98. display: block;
  99. margin-top: 10px;
  100. cursor: pointer;
  101. position: relative;
  102. overflow: hidden;
  103. font-size: 0;
  104. backdrop-filter: blur(15px) brightness(60%);
  105. transition: all ease 0.3s;
  106. clip-path: polygon(
  107. 0 0,
  108. 20px 0,
  109. 10px 8px,
  110. 10px + @lgap 8px,
  111. 20px + @lgap 0,
  112. 20px + 2 * @lgap 0,
  113. 10px + 2 * @lgap 8px,
  114. 10px + 3 * @lgap 8px,
  115. 20px + 3 * @lgap 0,
  116. 20px + 4 * @lgap 0,
  117. 10px + 4 * @lgap 8px,
  118. 10px + 5 * @lgap 8px,
  119. 20px + 5 * @lgap 0,
  120. 100% 0,
  121. 100% calc(100% - @gap),
  122. calc(100% - @gap) 100%,
  123. 0 100%
  124. );
  125. border-top-right-radius: 2px;
  126. &::before,
  127. &::after {
  128. background: linear-gradient(186deg, var(--bgColor) 0%, var(--bgColor) 40%, rgba(0, 144, 255, 0) 100%);
  129. content: "";
  130. width: 60%;
  131. height: 4px;
  132. position: absolute;
  133. top: 0;
  134. right: 0;
  135. }
  136. &::after {
  137. content: "";
  138. top: 4px;
  139. height: 50%;
  140. width: 4px;
  141. }
  142. > img {
  143. width: 100%;
  144. opacity: 0;
  145. }
  146. .arrow{
  147. opacity: 0;
  148. }
  149. .txtcon {
  150. position: absolute;
  151. top: 50%;
  152. transform: translateY(-50%);
  153. left: 22px;
  154. color: rgba(255, 255, 255, 0.8);
  155. max-width: 180px;
  156. .tag {
  157. font-size: 24px;
  158. display: block;
  159. font-family: "pangmen";
  160. }
  161. .text {
  162. display: inline-block;
  163. overflow: hidden;
  164. text-overflow: ellipsis;
  165. white-space: nowrap;
  166. margin-top: 4px;
  167. padding-left: 10px;
  168. font-size: 14px;
  169. position: relative;
  170. line-height: 1;
  171. vertical-align: middle;
  172. transition: all ease 0.3s;
  173. width: 0;
  174. height: 0;
  175. &::before {
  176. position: absolute;
  177. display: none;
  178. content: "";
  179. width: 2px;
  180. height: 14px;
  181. left: 0;
  182. top: 50%;
  183. transform: translateY(-50%);
  184. background: rgba(255, 255, 255, 0.8);
  185. }
  186. }
  187. }
  188. &:hover {
  189. width: 100% !important;
  190. >img{
  191. opacity: 0.2;
  192. }
  193. .txtcon {
  194. .text {
  195. width: 100%;
  196. height: auto;
  197. &::before {
  198. position: absolute;
  199. display: inline-block;
  200. content: "";
  201. }
  202. }
  203. }
  204. }
  205. &.active {
  206. color: var(--bgColor);
  207. backdrop-filter: blur(15px) brightness(100%);
  208. background: linear-gradient(269deg, #FFFFFF 0%, rgba(255, 255, 255, 0.51) 100%);
  209. width: 54%;
  210. >img{
  211. opacity: 0;
  212. }
  213. .txtcon {
  214. color: var(--bgColor);
  215. .text {
  216. &::before {
  217. position: absolute;
  218. content: "";
  219. width: 2px;
  220. height: 14px;
  221. left: 0;
  222. top: 50%;
  223. transform: translateY(-50%);
  224. background: rgba(0, 0, 0, 0.2);
  225. }
  226. }
  227. }
  228. .arrow {
  229. width: 12px;
  230. position: absolute;
  231. opacity: 1;
  232. right: 14px;
  233. top: 50%;
  234. transform: translateY(-50%);
  235. z-index: 999;
  236. text-indent: -12px;
  237. overflow: hidden;
  238. >img{
  239. width: 100%;
  240. filter: drop-shadow(12px 0px var(--bgColor));
  241. }
  242. }
  243. }
  244. }
  245. }
  246. .zhankai {
  247. position: fixed;
  248. bottom: 65px;
  249. left: 20px;
  250. cursor: pointer;
  251. }
  252. }
  253. </style>