MoreContent.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <template>
  2. <div
  3. :class="`more-content`"
  4. >
  5. <div
  6. ref="scrollTarget"
  7. class="scroll-target"
  8. >
  9. <img
  10. class="bg"
  11. :style="{
  12. left: bgLeft + 'px',
  13. }"
  14. src="@/assets/images/fade-chapter-wood/bg-min.jpg"
  15. alt=""
  16. draggable="false"
  17. >
  18. <div
  19. class="layer-4"
  20. :style="{
  21. left: layer4Left + 'px',
  22. }"
  23. >
  24. <img
  25. class="bamboo"
  26. src="@/assets/images/fade-chapter-wood/4-min.png"
  27. alt=""
  28. draggable="false"
  29. >
  30. </div>
  31. <div
  32. class="layer-3"
  33. :style="{
  34. left: layer3Left + 'px',
  35. }"
  36. >
  37. <img
  38. class="bamboo"
  39. src="@/assets/images/fade-chapter-wood/3-min.png"
  40. alt=""
  41. draggable="false"
  42. >
  43. </div>
  44. <div
  45. class="layer-2"
  46. :style="{
  47. left: layer2Left + 'px',
  48. }"
  49. >
  50. <img
  51. class="bamboo"
  52. src="@/assets/images/fade-chapter-wood/2-min.png"
  53. alt=""
  54. draggable="false"
  55. >
  56. </div>
  57. <div
  58. class="layer-1"
  59. :style="{
  60. left: layer1Left + 'px',
  61. }"
  62. >
  63. <img
  64. class="bamboo"
  65. src="@/assets/images/fade-chapter-wood/1-min.png"
  66. alt=""
  67. draggable="false"
  68. >
  69. <HotspotComp
  70. class="hotspot"
  71. @click="
  72. router.replace({
  73. name: 'BambooHot',
  74. })
  75. "
  76. />
  77. <div class="shuang-gou-she-se-group">
  78. <div
  79. class="watch-detail animation-show-long-hide"
  80. @click="onClickShuangGouEntry"
  81. >
  82. 查看详情
  83. </div>
  84. <div class="group-title">
  85. 双钩设色
  86. <img
  87. class="deco"
  88. src="@/assets/images/more-content-deco.png"
  89. alt=""
  90. draggable="false"
  91. >
  92. </div>
  93. </div>
  94. <div class="mo-zhu-group">
  95. <div class="button-group">
  96. <div
  97. class="poem animation-show-long-hide"
  98. @click="onClickEntryAtMoZhu('PoemList')"
  99. >
  100. 人文
  101. </div>
  102. <div
  103. class="animation-show-long-hide"
  104. @click="onClickEntryAtMoZhu('PaintingList')"
  105. >
  106. 画作
  107. </div>
  108. <div
  109. class="animation-show-long-hide"
  110. @click="onClickEntryAtMoZhu('BambooBook')"
  111. >
  112. 竹谱
  113. </div>
  114. </div>
  115. <div class="group-title">
  116. 墨竹
  117. <img
  118. class="deco"
  119. src="@/assets/images/more-content-deco.png"
  120. alt=""
  121. draggable="false"
  122. >
  123. </div>
  124. </div>
  125. <div class="painting-creation-group">
  126. <div
  127. class="button-group"
  128. >
  129. <div
  130. class="poem animation-show-long-hide"
  131. @click="router.replace('/game')"
  132. >
  133. 开始体验
  134. </div>
  135. </div>
  136. <div class="group-title">
  137. 画作创作
  138. <img
  139. class="deco"
  140. src="@/assets/images/more-content-deco.png"
  141. alt=""
  142. draggable="false"
  143. >
  144. </div>
  145. </div>
  146. <div class="page-4-group">
  147. <img
  148. class="logo"
  149. src="@/assets/images/wu-jing-cang.png"
  150. alt=""
  151. draggable="false"
  152. >
  153. <div
  154. class="go-to-online-museum"
  155. @click="OpenScene()"
  156. >
  157. 线上展厅
  158. </div>
  159. <div
  160. class="restart"
  161. @click="() => {
  162. store.state.haveShownStartup = false;
  163. router.replace('/?back=1');
  164. }"
  165. >
  166. 重新开始
  167. </div>
  168. <div class="line-1 line">
  169. <span class="key">《无尽藏》展览策展人:</span><span class="value">庞鸥</span>
  170. </div>
  171. <div class="line-2 line">
  172. 线上策展团队:
  173. </div>
  174. <div class="line-3 line">
  175. 南京博物院:张莅坤 刘佳 李文彬 张晓婉
  176. </div>
  177. <div class="line-4 line">
  178. 珠海市四维时代网络科技有限公司
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. <!-- todo -->
  184. <BtnBack @click="router.replace('/?back=1')" />
  185. <OperationTip
  186. class="operation-tip"
  187. :text="'左右滑动'"
  188. :color="'green'"
  189. />
  190. <!-- 过渡视频 -->
  191. <Transition name="fade-in">
  192. <video
  193. v-if="isShowVideoFadeAtShuangGou"
  194. ref="videoFadeAtShuangGouEl"
  195. class="fade-to-other-page"
  196. src="@/assets/videos/fade-at-shuang-gou.mp4"
  197. playsinline
  198. webkit-playsinline="true"
  199. x5-video-player-type="h5"
  200. muted
  201. @ended="
  202. router.replace({
  203. name: 'ShuanggouDetail',
  204. })
  205. "
  206. />
  207. </Transition>
  208. <Transition name="fade-in">
  209. <div
  210. v-if="isShowVideoFadeAtMoZhu"
  211. :class="`RWbox`"
  212. >
  213. <video
  214. ref="videoFadeAtMoZhuEl"
  215. src="@/assets/videos/fade-at-mo-zhu.mp4"
  216. playsinline
  217. muted
  218. webkit-playsinline="true"
  219. x5-video-player-type="h5"
  220. />
  221. <img
  222. class="RWvideoTxt"
  223. src="@/assets/images/RW/titile_mozhu-min.png"
  224. alt=""
  225. >
  226. </div>
  227. </Transition>
  228. <Transition name="fade-in">
  229. <video
  230. v-if="isShowVideoFadeAtPage3"
  231. ref="videoFadeAtPage3El"
  232. class="fade-to-other-page"
  233. src="@/assets/videos/fade-from-more-content-to-game.mp4"
  234. playsinline
  235. muted
  236. webkit-playsinline="true"
  237. x5-video-player-type="h5"
  238. />
  239. </Transition>
  240. </div>
  241. </template>
  242. <script setup>
  243. import { ref, computed, watch, onBeforeMount, nextTick } from "vue"
  244. import { useRoute, useRouter } from "vue-router"
  245. import { useStore } from "vuex"
  246. import useSmoothSwipe from "@/useFunctions/useSmoothSwipe.js"
  247. import { useWindowSize } from "@vueuse/core"
  248. import OperationTip from "@/components/OperationTip.vue"
  249. import useSizeAdapt from "@/useFunctions/useSizeAdapt.js"
  250. const route = useRoute()
  251. const router = useRouter()
  252. const store = useStore()
  253. const windowWidthDesign = 4674
  254. const windowHeightDesign = 1080 - 71 - 37 // 设计稿里视口高度。注意要减去上下边栏
  255. const scrollTarget = ref(null)
  256. const { width: windowWidth, height: windowHeight } = useWindowSize()
  257. const maxTranslateLength = computed(() => {
  258. return (windowHeight.value * windowWidthDesign) / windowHeightDesign
  259. })
  260. const {
  261. translateLength,
  262. } = useSmoothSwipe({
  263. scrollTargetRef: scrollTarget,
  264. maxTranslateLength,
  265. viewportWidth: windowWidth,
  266. })
  267. // 背景位移
  268. const bgInitialLeft = 0
  269. const bgLeft = ref(bgInitialLeft)
  270. const bgSpeedFactor = 0.8 * 0.8 * 0.8 * 0.8
  271. // layer4Left位移
  272. const layer4SpeedFactor = 0.8 * 0.8 * 0.8
  273. const layer4InitialLeft = 0
  274. const layer4Left = ref(layer4InitialLeft)
  275. // layer3Left位移
  276. const layer3SpeedFactor = 0.8 * 0.8
  277. const layer3InitialLeft = 600 * windowHeight.value / windowHeightDesign
  278. const layer3Left = ref(layer3InitialLeft)
  279. // layer2Left位移
  280. const layer2SpeedFactor = 0.8
  281. const layer2InitialLeft = 0
  282. const layer2Left = ref(layer2InitialLeft)
  283. // layer1Left位移
  284. const layer1InitialLeft = 0
  285. const layer1Left = ref(layer1InitialLeft)
  286. watch(
  287. translateLength,
  288. (v) => {
  289. bgLeft.value = bgInitialLeft - v * bgSpeedFactor
  290. layer4Left.value = layer4InitialLeft - v * layer4SpeedFactor
  291. layer3Left.value = layer3InitialLeft - v * layer3SpeedFactor
  292. layer2Left.value = layer2InitialLeft - v * layer2SpeedFactor
  293. layer1Left.value = layer1InitialLeft - v
  294. },
  295. {
  296. immediate: true,
  297. }
  298. )
  299. const videoFadeAtShuangGouEl = ref(null)
  300. const isShowVideoFadeAtShuangGou = ref(false)
  301. function onClickShuangGouEntry() {
  302. isShowVideoFadeAtShuangGou.value = true
  303. nextTick(() => {
  304. videoFadeAtShuangGouEl.value.play()
  305. })
  306. }
  307. const videoFadeAtMoZhuEl = ref(null)
  308. const isShowVideoFadeAtMoZhu = ref(false)
  309. function onClickEntryAtMoZhu(pathName) {
  310. if (pathName === "PoemList") {
  311. isShowVideoFadeAtMoZhu.value = true
  312. nextTick(() => {
  313. videoFadeAtMoZhuEl.value.addEventListener("ended", () => {
  314. router.replace({
  315. name: pathName,
  316. })
  317. })
  318. videoFadeAtMoZhuEl.value.play()
  319. })
  320. } else {
  321. router.replace({
  322. name: pathName,
  323. })
  324. }
  325. }
  326. const videoFadeAtPage3El = ref(null)
  327. const isShowVideoFadeAtPage3 = ref(false)
  328. // 点击线上展厅
  329. const OpenScene = () => {
  330. const musicDom = document.getElementById("bg-music")
  331. musicDom.pause()
  332. router.replace('/scene')
  333. }
  334. </script>
  335. <style lang="less" scoped>
  336. .button-common-style {
  337. font-family: KaiTi;
  338. font-weight: 400;
  339. font-size: calc(16px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  340. writing-mode: vertical-lr;
  341. letter-spacing: 0.2em;
  342. white-space: pre;
  343. color: #b8ae7a;
  344. cursor: pointer;
  345. }
  346. .group-title-common-style {
  347. font-family: KingHwa_OldSong;
  348. font-weight: 400;
  349. font-size: calc(48px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  350. color: #474747;
  351. writing-mode: vertical-lr;
  352. letter-spacing: 0.2em;
  353. white-space: pre;
  354. }
  355. .more-content {
  356. background-color: #fefefe;
  357. position: absolute;
  358. left: 0;
  359. top: 0;
  360. width: 100%;
  361. height: 100%;
  362. user-select: none;
  363. > .scroll-target {
  364. height: 100%;
  365. width: 100%;
  366. display: flex;
  367. gap: 100px;
  368. overflow: hidden;
  369. > img.bg {
  370. position: absolute;
  371. height: 100%;
  372. }
  373. > .layer-4 {
  374. position: absolute;
  375. height: 100%;
  376. > .bamboo {
  377. height: 100%;
  378. }
  379. }
  380. > .layer-3 {
  381. position: absolute;
  382. height: 100%;
  383. > .bamboo {
  384. height: 100%;
  385. }
  386. }
  387. > .layer-2 {
  388. position: absolute;
  389. height: 100%;
  390. > .bamboo {
  391. height: 100%;
  392. }
  393. }
  394. > .layer-1 {
  395. position: absolute;
  396. height: 100%;
  397. > .bamboo {
  398. height: 100%;
  399. }
  400. > .hotspot {
  401. position: absolute;
  402. top: calc((721px - 71px) * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  403. left: calc(515px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  404. }
  405. > .shuang-gou-she-se-group {
  406. position: absolute;
  407. top: calc((314px - 71px) * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  408. left: calc(276px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  409. > .watch-detail {
  410. position: absolute;
  411. top: calc(
  412. 208px * v-bind("windowHeight") / v-bind("windowHeightDesign")
  413. );
  414. left: 0;
  415. background-image: url(@/assets/images/fade-chapter-btn-bg-big.png);
  416. background-size: contain;
  417. background-repeat: no-repeat;
  418. background-position: center center;
  419. padding-top: calc(3px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  420. .button-common-style();
  421. }
  422. > div.group-title {
  423. position: absolute;
  424. top: 0;
  425. left: calc(41px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  426. .group-title-common-style();
  427. > img.deco {
  428. position: absolute;
  429. bottom: 0.9em;
  430. right: -0.05em;
  431. width: calc(16px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  432. height: calc(16px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  433. }
  434. }
  435. }
  436. > .mo-zhu-group {
  437. position: absolute;
  438. top: calc((314px - 71px) * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  439. left: calc(1100px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  440. > .button-group {
  441. position: absolute;
  442. width: calc(20px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  443. top: calc(75px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  444. left: 0;
  445. display: flex;
  446. flex-direction: column;
  447. gap: calc(20px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  448. > div {
  449. .button-common-style();
  450. background-image: url(@/assets/images/fade-chapter-btn-bg-small.png);
  451. background-size: contain;
  452. background-repeat: no-repeat;
  453. background-position: center center;
  454. padding-top: calc(3px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  455. }
  456. }
  457. > div.group-title {
  458. position: absolute;
  459. top: 0;
  460. left: calc(41px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  461. .group-title-common-style();
  462. > img.deco {
  463. position: absolute;
  464. bottom: 0.9em;
  465. right: 0.1em;
  466. width: calc(16px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  467. height: calc(16px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  468. }
  469. }
  470. }
  471. .painting-creation-group {
  472. position: absolute;
  473. left: calc(2100px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  474. top: calc(243px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  475. > .button-group {
  476. position: absolute;
  477. width: calc(20px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  478. top: calc(232px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  479. left: 0;
  480. display: flex;
  481. flex-direction: column;
  482. gap: calc(20px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  483. > div {
  484. .button-common-style();
  485. background-image: url(@/assets/images/fade-chapter-btn-bg-big.png);
  486. background-size: contain;
  487. background-repeat: no-repeat;
  488. background-position: center center;
  489. padding-top: calc(3px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  490. }
  491. }
  492. > div.group-title {
  493. position: absolute;
  494. top: 0;
  495. left: calc(41px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  496. .group-title-common-style();
  497. > img.deco {
  498. position: absolute;
  499. bottom: 0.9em;
  500. right: 0.65em;
  501. width: calc(16px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  502. height: calc(16px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  503. }
  504. }
  505. }
  506. > .page-4-group {
  507. position: absolute;
  508. top: 0;
  509. height: 100%;
  510. left: calc(3700px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  511. font-family: "KingHwa_OldSong";
  512. z-index: 2;
  513. display: flex;
  514. flex-direction: column;
  515. align-items: center;
  516. & > img.logo {
  517. margin-top: calc((200px - 71px) * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  518. width: calc(151px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  519. }
  520. > .go-to-online-museum {
  521. width: calc(244px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  522. height: calc(110px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  523. background-image: url(@/assets/images/btn-online-museum-bg.png);
  524. background-size: cover;
  525. background-repeat: no-repeat;
  526. background-position: center center;
  527. white-space: nowrap;
  528. display: flex;
  529. justify-content: center;
  530. align-items: center;
  531. margin-top: calc(62px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  532. font-size: calc(26px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  533. color: white;
  534. cursor: pointer;
  535. }
  536. > .restart {
  537. margin-top: calc(20px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  538. font-size: calc(26px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  539. color: #476446;
  540. white-space: nowrap;
  541. cursor: pointer;
  542. }
  543. >.line{
  544. white-space: pre;
  545. margin-top: calc(8px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  546. font-family: Source Han Sans CN, Source Han Sans CN;
  547. font-size: calc(20px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  548. color: #688067;
  549. }
  550. >.line-1{
  551. margin-top: calc(190px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  552. >.key{
  553. font-weight: bold;
  554. }
  555. .value{
  556. }
  557. }
  558. >.line-2{
  559. margin-top: calc(8px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  560. font-weight: bold;
  561. }
  562. >.line-3{
  563. margin-top: calc(8px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  564. }
  565. >.line-4{
  566. margin-top: calc(8px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
  567. }
  568. }
  569. }
  570. }
  571. > .operation-tip {
  572. position: absolute;
  573. right: calc(
  574. 44 / v-bind("windowSizeWhenDesignForRef") *
  575. v-bind("windowSizeInCssForRef")
  576. );
  577. bottom: calc(
  578. 74 / v-bind("windowSizeWhenDesignForRef") *
  579. v-bind("windowSizeInCssForRef")
  580. );
  581. }
  582. .RWbox {
  583. position: absolute;
  584. left: 0;
  585. top: 0;
  586. width: 100%;
  587. height: 100%;
  588. .RWvideoTxt {
  589. width: 18%;
  590. position: absolute;
  591. z-index: 10;
  592. top: 32%;
  593. left: 44%;
  594. }
  595. & > video {
  596. width: 100%;
  597. }
  598. }
  599. > .fade-to-other-page {
  600. position: absolute;
  601. left: 0;
  602. top: 0;
  603. width: 100%;
  604. height: 100%;
  605. object-fit: cover;
  606. object-position: top;
  607. }
  608. }
  609. </style>