HomeView.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="home">
  3. <transition name="fade-out">
  4. <StartUp
  5. v-show="!store.state.haveShownStartUp"
  6. class="start-up"
  7. />
  8. </transition>
  9. <transition name="fade-in-out">
  10. <div
  11. v-if="hoveringEntryIdx === 0"
  12. class="bg-default"
  13. >
  14. <img
  15. class="bg-default"
  16. src="@/assets/images/home-bg-default.jpg"
  17. alt=""
  18. draggable="false"
  19. >
  20. <img
  21. class="title"
  22. src="@/assets/images/home-title.png"
  23. alt=""
  24. draggable="false"
  25. >
  26. </div>
  27. </transition>
  28. <transition name="fade-in-out">
  29. <div
  30. v-if="hoveringEntryIdx === 1"
  31. class="scene-preview scene-preview-1"
  32. >
  33. <img
  34. class="bg"
  35. src="@/assets/images/scene-1-preview.jpg"
  36. alt=""
  37. draggable="false"
  38. >
  39. <img
  40. class="title"
  41. src="@/assets/images/scene-preview-title-1.png"
  42. alt=""
  43. draggable="false"
  44. >
  45. </div>
  46. </transition>
  47. <transition name="fade-in-out">
  48. <div
  49. v-if="hoveringEntryIdx === 2"
  50. class="scene-preview scene-preview-2"
  51. >
  52. <img
  53. class="bg"
  54. src="@/assets/images/scene-2-preview.jpg"
  55. alt=""
  56. draggable="false"
  57. >
  58. <img
  59. class="title"
  60. src="@/assets/images/scene-preview-title-2.png"
  61. alt=""
  62. draggable="false"
  63. >
  64. </div>
  65. </transition>
  66. <transition name="fade-in-out">
  67. <div
  68. v-if="hoveringEntryIdx === 3"
  69. class="scene-preview scene-preview-3"
  70. >
  71. <img
  72. class="bg"
  73. src="@/assets/images/scene-3-preview.jpg"
  74. alt=""
  75. draggable="false"
  76. >
  77. <img
  78. class="title"
  79. src="@/assets/images/scene-preview-title-3.png"
  80. alt=""
  81. draggable="false"
  82. >
  83. </div>
  84. </transition>
  85. <button
  86. class="logo"
  87. @click="onClickLogo"
  88. >
  89. <img
  90. src="@/assets/images/logo-bright.png"
  91. alt=""
  92. draggable="false"
  93. >
  94. </button>
  95. <div class="btn-group">
  96. <button
  97. class="scene-entry entry-1"
  98. @mouseenter="hoveringEntryIdx = 1"
  99. @mouseleave="hoveringEntryIdx = 0"
  100. @click="router.push({
  101. name: 'PanoView',
  102. query: {
  103. sceneIdx: 0,
  104. cameraIdx: 0,
  105. }
  106. })"
  107. />
  108. <button
  109. class="scene-entry entry-2"
  110. @mouseenter="hoveringEntryIdx = 2"
  111. @mouseleave="hoveringEntryIdx = 0"
  112. @click="router.push({
  113. name: 'PanoView',
  114. query: {
  115. sceneIdx: 1,
  116. cameraIdx: 0,
  117. }
  118. })"
  119. />
  120. <button
  121. class="scene-entry entry-3"
  122. @mouseenter="hoveringEntryIdx = 3"
  123. @mouseleave="hoveringEntryIdx = 0"
  124. @click="router.push({
  125. name: 'PanoView',
  126. query: {
  127. sceneIdx: 2,
  128. cameraIdx: 0,
  129. }
  130. })"
  131. />
  132. </div>
  133. </div>
  134. </template>
  135. <script setup>
  136. import { ref, computed, watch, onMounted } from "vue"
  137. import { useRoute, useRouter } from "vue-router"
  138. import { useStore } from "vuex"
  139. import StartUp from '@/components/StartUp.vue'
  140. const {
  141. windowSizeInCssForRef,
  142. windowSizeWhenDesignForRef,
  143. } = useSizeAdapt()
  144. const route = useRoute()
  145. const router = useRouter()
  146. const store = useStore()
  147. const canStart = computed(() => {
  148. return store.state.canStart
  149. })
  150. const hoveringEntryIdx = ref(0)
  151. function onClickLogo() {
  152. store.commit('setHaveShownStartUp', false)
  153. }
  154. </script>
  155. <style lang="less" scoped>
  156. .home{
  157. height: 100%;
  158. background-image: url(@/assets/images/home-bg-bg.jpg);
  159. background-size: cover;
  160. background-repeat: no-repeat;
  161. background-position: center center;
  162. >.start-up{
  163. z-index: 3;
  164. }
  165. >.bg-default{
  166. position: absolute;
  167. left: 0;
  168. top: 0;
  169. width: 100%;
  170. height: 100%;
  171. >img.bg-default{
  172. position: absolute;
  173. width: 100%;
  174. height: calc(891 / 1080 * 100vh);
  175. left: 0;
  176. top: 0;
  177. object-fit: cover;
  178. }
  179. >img.title{
  180. position: absolute;
  181. left: 50%;
  182. top: 30%;
  183. transform: translate(-50%, -50%);
  184. width: calc(1102 / 1920 * 100vw);
  185. }
  186. }
  187. >.scene-preview{
  188. position: absolute;
  189. width: 100%;
  190. height: calc(891 / 1080 * 100vh);
  191. left: 0;
  192. top: 0;
  193. >img.bg{
  194. position: absolute;
  195. left: 0;
  196. top: 0;
  197. width: 100%;
  198. height: 100%;
  199. object-fit: cover;
  200. }
  201. >img.title{
  202. position: absolute;
  203. }
  204. }
  205. >.scene-preview-1{
  206. >img.title{
  207. top: calc(87 / 1080 * 100vh);
  208. left: calc(130 / 1920 *100vw);
  209. height: calc(274 / 1080 * 100vh);
  210. }
  211. }
  212. >.scene-preview-2{
  213. >img.title{
  214. top: calc(95 / 1080 * 100vh);
  215. right: calc(60 / 1920 *100vw);
  216. height: calc(312 / 1080 * 100vh);
  217. }
  218. }
  219. >.scene-preview-3{
  220. >img.title{
  221. top: calc(95 / 1080 * 100vh);
  222. left: calc(900 / 1920 *100vw);
  223. height: calc(390 / 1080 * 100vh);
  224. }
  225. }
  226. >button.logo{
  227. position: absolute;
  228. left: 50px;
  229. top: 30px;
  230. width: 252px;
  231. height: 55px;
  232. >img{
  233. position: absolute;
  234. left: 0;
  235. top: 0;
  236. width: 100%;
  237. height: 100%;
  238. }
  239. }
  240. >.btn-group{
  241. position: absolute;
  242. width: 100%;
  243. bottom: 100px;
  244. display: flex;
  245. >button.scene-entry.entry-1{
  246. position: absolute;
  247. left: 20%;
  248. transform: translate(-50%);
  249. bottom: 0;
  250. background-image: url(@/assets/images/scene-entry-1.png);
  251. background-size: cover;
  252. background-repeat: no-repeat;
  253. background-position: center center;
  254. width: calc(489 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  255. height: calc(245 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  256. &:hover{
  257. background-image: url(@/assets/images/scene-entry-1-active.png);
  258. width: calc(507 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  259. height: calc(259 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  260. transform: translate(calc(-50% - (10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'))), calc(12 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  261. &::after{
  262. position: absolute;
  263. content: '';
  264. left: calc(30 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  265. bottom: calc(10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  266. width: calc(143 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  267. height: calc(380 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  268. background-image: url(@/assets/images/scene-entry-active-deco.png);
  269. background-size: cover;
  270. background-repeat: no-repeat;
  271. background-position: center center;
  272. }
  273. }
  274. }
  275. >button.scene-entry.entry-2{
  276. position: absolute;
  277. left: 50%;
  278. transform: translate(-50%);
  279. bottom: 0;
  280. background-image: url(@/assets/images/scene-entry-2.png);
  281. background-size: cover;
  282. background-repeat: no-repeat;
  283. background-position: center center;
  284. width: calc(548 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  285. height: calc(369 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  286. &:hover{
  287. background-image: url(@/assets/images/scene-entry-2-active.png);
  288. transform: translate(calc(-20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')), calc(0 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  289. width: calc(579 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  290. height: calc(393 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  291. transform: translate(calc(-50% - (15 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'))), calc(0 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  292. &::after{
  293. position: absolute;
  294. content: '';
  295. right: calc(100 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  296. bottom: calc(10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  297. width: calc(143 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  298. height: calc(380 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  299. background-image: url(@/assets/images/scene-entry-active-deco.png);
  300. background-size: cover;
  301. background-repeat: no-repeat;
  302. background-position: center center;
  303. }
  304. }
  305. }
  306. >button.scene-entry.entry-3{
  307. position: absolute;
  308. left: 80%;
  309. transform: translate(-50%);
  310. bottom: 0;
  311. background-image: url(@/assets/images/scene-entry-3.png);
  312. background-size: cover;
  313. background-repeat: no-repeat;
  314. background-position: center center;
  315. width: calc(386 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  316. height: calc(319 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  317. &:hover{
  318. background-image: url(@/assets/images/scene-entry-3-active.png);
  319. transform: translate(calc(-20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')), calc(0 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  320. width: calc(416 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  321. height: calc(343 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  322. transform: translate(calc(-50% - (15 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'))), calc(0 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  323. &::after{
  324. position: absolute;
  325. content: '';
  326. left: calc(10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  327. bottom: calc(10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  328. width: calc(143 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  329. height: calc(380 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  330. background-image: url(@/assets/images/scene-entry-active-deco.png);
  331. background-size: cover;
  332. background-repeat: no-repeat;
  333. background-position: center center;
  334. }
  335. }
  336. }
  337. }
  338. }
  339. </style>