HomeView.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394
  1. <template>
  2. <div
  3. class="home"
  4. >
  5. <div class="bg-mask" />
  6. <Transition name="fade-out">
  7. <Startup
  8. v-if="!store.state.haveShownStartup"
  9. class="startup"
  10. />
  11. </Transition>
  12. <!-- 标题 -->
  13. <div
  14. class="title-wrap"
  15. :style="{
  16. opacity: titleOpacity,
  17. }"
  18. >
  19. <img
  20. class="title"
  21. src="@/assets/images/home-title.png"
  22. alt=""
  23. draggable="false"
  24. >
  25. <div class="sub-text">
  26. 南京博物院<br>
  27. 绢本 墨笔<br>
  28. 元 李衎<br>
  29. </div>
  30. </div>
  31. <!-- 画作 -->
  32. <div
  33. class="painting-wrap"
  34. :style="{
  35. top: summaryOpacity > 0 ? `${90 / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px` : `${paintingTop / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  36. width: summaryOpacity > 0 ? `calc(225 / 308 * 100%)`: paintingWidth == 485 ? `110%`: `${paintingWidth / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  37. height: summaryOpacity > 0 ? `${523 / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px` :`${paintingHeight / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  38. }"
  39. >
  40. <div
  41. class="size-sign-h"
  42. :style="{
  43. opacity: 0,
  44. }"
  45. >
  46. <img
  47. class=""
  48. src="@/assets/images/size-sign-h.png"
  49. alt=""
  50. draggable="false"
  51. >
  52. <span>100.6cm</span>
  53. </div>
  54. <div
  55. class="size-sign-v"
  56. :style="{
  57. opacity: 0,
  58. }"
  59. >
  60. <img
  61. class=""
  62. src="@/assets/images/size-sign-v.png"
  63. alt=""
  64. draggable="false"
  65. >
  66. <span>151.7cm</span>
  67. </div>
  68. <!-- 绿色幕布层 -->
  69. <div
  70. class="green-box"
  71. :style="{opacity: stemGreenOpacity || leafGreenOpacity || stoneGreenOpacity}"
  72. />
  73. <img
  74. class="painting-border"
  75. src="@/assets/images/painting-border-new.png"
  76. alt=""
  77. draggable="false"
  78. >
  79. <img
  80. class="painting-stem"
  81. src="@/assets/images/home-painting.jpg"
  82. alt=""
  83. draggable="false"
  84. >
  85. <img
  86. class="painting-stem"
  87. src="@/assets/images/home-painting.jpg"
  88. alt=""
  89. draggable="false"
  90. >
  91. <img
  92. class="painting-stem"
  93. :style="{
  94. opacity: stemOpacity,
  95. }"
  96. src="@/assets/images/home-1.jpg"
  97. alt=""
  98. draggable="false"
  99. >
  100. <img
  101. class="painting-stem"
  102. :style="{
  103. opacity: stemOpacity1,
  104. zIndex: 2,
  105. }"
  106. src="@/assets/images/home-1-1.jpg"
  107. alt=""
  108. draggable="false"
  109. >
  110. <img
  111. class="painting-stem"
  112. :style="{
  113. opacity: stemOpacity2,
  114. zIndex: 2,
  115. }"
  116. src="@/assets/images/home-1-2.jpg"
  117. alt=""
  118. draggable="false"
  119. >
  120. <img
  121. class="painting-leaf"
  122. :style="{
  123. opacity: leafOpacity,
  124. zIndex: 2,
  125. }"
  126. src="@/assets/images/home-2.jpg"
  127. alt=""
  128. draggable="false"
  129. >
  130. <img
  131. class="painting-leaf"
  132. :style="{
  133. opacity: leafOpacity1,
  134. zIndex: 2,
  135. }"
  136. src="@/assets/images/home-2-1.jpg"
  137. alt=""
  138. draggable="false"
  139. >
  140. <img
  141. class="painting-leaf"
  142. :style="{
  143. opacity: leafOpacity2,
  144. zIndex: 2,
  145. }"
  146. src="@/assets/images/home-2-2.jpg"
  147. alt=""
  148. draggable="false"
  149. >
  150. <img
  151. class="painting-leaf"
  152. :style="{
  153. opacity: leafOpacity3,
  154. zIndex: 2,
  155. }"
  156. src="@/assets/images/home-2-3.jpg"
  157. alt=""
  158. draggable="false"
  159. >
  160. <img
  161. class="painting-stone"
  162. :style="{
  163. opacity: stoneOpacity,
  164. }"
  165. src="@/assets/images/home-3.jpg"
  166. alt=""
  167. draggable="false"
  168. >
  169. <img
  170. class="painting-stone"
  171. :style="{
  172. opacity: stoneOpacity1,
  173. zIndex: 2,
  174. }"
  175. src="@/assets/images/home-3-1.jpg"
  176. alt=""
  177. draggable="false"
  178. >
  179. </div>
  180. <!-- 热点层 -->
  181. <div
  182. class="hotspot-wrap"
  183. :style="{
  184. top: `${paintingTop / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`
  185. }"
  186. >
  187. <HotspotForHomepage
  188. v-show="isShowHotspot"
  189. class="hotspot-1"
  190. @click="isShowHotspotDetail1 = true"
  191. />
  192. <HotspotForHomepage
  193. v-show="false"
  194. class="hotspot-2"
  195. @click="showBigPainting"
  196. />
  197. <HotspotForHomepage
  198. v-show="isShowHotspot"
  199. class="hotspot-3"
  200. @click="isShowHotspotDetail3 = true"
  201. />
  202. </div>
  203. <!-- 文字介绍 -->
  204. <div
  205. ref="longDesc"
  206. v-touch:swipe.left="onSwipeLeft"
  207. v-touch:swipe.right="onSwipeRight"
  208. class="long-desc"
  209. :style="{
  210. top: `${(paintingTop + paintingHeight + 53) / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  211. opacity: longDescOpacity,
  212. }"
  213. >
  214. <h3>作品简介:</h3>
  215. <p
  216. v-for="(item, index) in homepagePaintingDesc"
  217. :key="index"
  218. >
  219. {{ item }}
  220. </p>
  221. <h3>作者简介:</h3>
  222. <p
  223. v-for="(item, index) in homepageAuthorDesc"
  224. :key="index"
  225. >
  226. {{ item }}
  227. </p>
  228. </div>
  229. <!-- stem title -->
  230. <div
  231. class="fixed-desc detail-title-stem"
  232. :style="{
  233. top: `${( stemOpacity1 > 0 || stemOpacity2 >0? paintingTop + 670 : paintingTop + 750 ) / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  234. opacity: stemTextOpacity,
  235. }"
  236. >
  237. 三竿修竹
  238. </div>
  239. <div
  240. class="fixed-desc detail-title-stem"
  241. :style="{
  242. top: `${( stoneOpacity1 > 0 ? paintingTop + 500 : paintingTop + 580 ) / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  243. opacity: stoneTextOpacity,
  244. }"
  245. >
  246. 卧石
  247. </div>
  248. <div
  249. class="fixed-desc detail-title-stem"
  250. :style="{
  251. top: `${( leafOpacity1 > 0 || leafOpacity2 >0 || leafOpacity3 >0? paintingTop + 330 : paintingTop + 410 ) / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  252. opacity: leafTextOpacity,
  253. }"
  254. >
  255. 竹叶
  256. </div>
  257. <div
  258. class="fixed-desc detail-desc-stem"
  259. :style="{
  260. top: `${(paintingTop + 750) / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  261. opacity: stemGreenOpacity,
  262. }"
  263. >
  264. {{ detailDescStem }}
  265. </div>
  266. <div
  267. class="fixed-desc detail-desc-leaf"
  268. :style="{
  269. top: `${(paintingTop + 750) / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  270. opacity: leafGreenOpacity,
  271. }"
  272. >
  273. {{ detailDescLeaf }}
  274. </div>
  275. <div
  276. class="fixed-desc detail-desc-stone"
  277. :style="{
  278. top: `${(paintingTop + 750) / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  279. opacity: stoneGreenOpacity,
  280. }"
  281. >
  282. {{ detailDescStone }}
  283. </div>
  284. <div
  285. class="fixed-desc summary-desc"
  286. :style="{
  287. top: `${(paintingTop + 700) / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)}px`,
  288. opacity: summaryOpacity,
  289. }"
  290. >
  291. {{ summaryDesc }}
  292. </div>
  293. <div class="progress-bar">
  294. <div
  295. class="bar-artwork-desc"
  296. />
  297. <img
  298. class="progress-bar-node-1"
  299. src="@/assets/images/progress-bar-node-1.png"
  300. alt=""
  301. draggable="false"
  302. >
  303. <div class="bar-author-desc" />
  304. <img
  305. class="progress-bar-node-2"
  306. src="@/assets/images/progress-bar-node-2.png"
  307. alt=""
  308. draggable="false"
  309. >
  310. <div class="bar-artwork-enjoy" />
  311. <img
  312. class="progress-bar-node-3"
  313. src="@/assets/images/progress-bar-node-3.png"
  314. alt=""
  315. draggable="false"
  316. >
  317. <div
  318. class="mask"
  319. :style="{
  320. width: `${(1 - scrollerElScrollTop / summaryHideAt) * 100}%`,
  321. backgroundColor:stemGreenOpacity > 0 || leafGreenOpacity > 0 || stoneGreenOpacity > 0?'rgba(85,116,83,0.8)':''
  322. }"
  323. />
  324. </div>
  325. <OperationTip
  326. v-if="isStartupOver"
  327. class="operation-tip"
  328. text="向左划动"
  329. direction="h"
  330. :is-show="isShowOperationTip"
  331. />
  332. <div
  333. ref="scrollerEl"
  334. v-touch:swipe.left="onSwipeLeft"
  335. v-touch:swipe.right="onSwipeRight"
  336. class="scroller"
  337. >
  338. <div
  339. class="inner"
  340. :style="{
  341. height: summaryHideAt + windowHeight + 'px',
  342. }"
  343. />
  344. </div>
  345. <!-- 热点详情页 -->
  346. <Transition name="fade-in-out">
  347. <HotspotDetail1
  348. v-if="isShowHotspotDetail1"
  349. class="hotspot-detail"
  350. @close="isShowHotspotDetail1 = false"
  351. />
  352. </Transition>
  353. <!-- <Transition name="fade-in-out">
  354. <PaintingDetail
  355. v-if="isShowPaintingDetail"
  356. :thumb="require(`@/assets/images/home-painting.jpg`)"
  357. :title="'修篁树石图'"
  358. :author="'李衎'"
  359. :age="'元'"
  360. :subtitle="'轴 绢本 墨笔'"
  361. :location="'南京博物院藏'"
  362. :painting-desc="homepagePaintingDesc.join('\n\n')"
  363. :author-desc="homepageAuthorDesc.join('\n\n')"
  364. :big-painting="require(`@/assets/images/home-painting-big.jpg`)"
  365. :need-operation-tip="true"
  366. class="hotspot-detail painting-detail"
  367. @close="isShowPaintingDetail = false"
  368. />
  369. </Transition> -->
  370. <Transition name="fade-in-out">
  371. <HotspotDetail3
  372. v-if="isShowHotspotDetail3"
  373. class="hotspot-detail"
  374. @close="isShowHotspotDetail3 = false"
  375. />
  376. </Transition>
  377. <Transition name="fade-in">
  378. <video
  379. v-if="isShowVideoFadeToNextPage"
  380. ref="videoFadeToNextPageEl"
  381. class="fade-to-next-page"
  382. src="@/assets/videos/fade-from-home-to-more-content.mp4"
  383. playsinline
  384. webkit-playsinline="true"
  385. x5-video-player-type="h5"
  386. @ended="router.push({
  387. name: 'MoreContent',
  388. })"
  389. />
  390. </Transition>
  391. <Transition name="fade-in">
  392. <BtnSkip
  393. v-if="isShowSkip"
  394. @click="router.push({
  395. name: 'MoreContent',
  396. })"
  397. />
  398. </Transition>
  399. <BtnClickMe
  400. class="go-next-page"
  401. text="点击继续"
  402. :is-show="isShowBtnGoNextPage"
  403. @click="onClickGoNextPage"
  404. />
  405. </div>
  406. </template>
  407. <script setup>
  408. import { ref, computed, watch, onMounted, inject, onBeforeUnmount, onUnmounted, nextTick } from "vue"
  409. import { useRoute, useRouter } from "vue-router"
  410. import { useStore } from "vuex"
  411. import Startup from '@/views/StartupView.vue'
  412. import useSizeAdapt from "@/useFunctions/useSizeAdapt"
  413. import HotspotDetail1 from '@/views/HotspotDetail1.vue'
  414. // import PaintingDetail from '@/views/PaintingDetail.vue'
  415. import HotspotDetail3 from '@/views/HotspotDetail3.vue'
  416. import { api as viewerApi } from 'v-viewer'
  417. import { useWindowSize } from '@vueuse/core'
  418. const { width: windowWidth, height: windowHeight } = useWindowSize()
  419. const route = useRoute()
  420. const router = useRouter()
  421. const store = useStore()
  422. const $env = inject('$env')
  423. const {
  424. windowSizeInCssForRef,
  425. windowSizeWhenDesignForRef,
  426. } = useSizeAdapt()
  427. const homepagePaintingDesc = configText.homepagePaintingDesc
  428. const homepageAuthorDesc = configText.homepageAuthorDesc
  429. const detailDescStem = configText.homepagePaintingDetailDescStem
  430. const detailDescLeaf = configText.homepagePaintingDetailDescLeaf
  431. const detailDescStone = configText.homepagePaintingDetailDescStone
  432. const summaryDesc = configText.homepagePaintingSummary
  433. const scrollerEl = ref(null)
  434. const scrollerElScrollTop = ref(0)
  435. function onScroll() {
  436. scrollerElScrollTop.value = scrollerEl.value.scrollTop
  437. }
  438. onMounted(() => {
  439. scrollerEl.value.addEventListener('scroll', onScroll)
  440. })
  441. onBeforeUnmount(() => {
  442. scrollerEl.value.removeEventListener('scroll', onScroll)
  443. })
  444. const isShowOperationTip = ref(true)
  445. watch(scrollerElScrollTop, (v) => {
  446. if (v > 0) {
  447. isShowOperationTip.value = false
  448. }
  449. })
  450. const haveShownStartup = computed(() => {
  451. return store.state.haveShownStartup
  452. })
  453. const isStartupOver = ref(false)
  454. const unwatch = watch(haveShownStartup, (v) => {
  455. if (v) {
  456. setTimeout(() => {
  457. isStartupOver.value = true
  458. }, 2000)
  459. unwatch()
  460. }
  461. })
  462. const titleHideAt = window.innerHeight * 0
  463. const titleHideFinishAt = window.innerHeight * 0.75
  464. const titleOpacity = computed(() => {
  465. let ret = null
  466. if (scrollerElScrollTop.value <= titleHideAt) {
  467. ret = 1
  468. } else {
  469. ret = 1 - (scrollerElScrollTop.value - titleHideAt) / (titleHideFinishAt - titleHideAt)
  470. }
  471. return ret
  472. })
  473. const paintingMoveUpAt = window.innerHeight * 0
  474. const paintingTopInitial = 236
  475. const paintingMoveUpFinishAt = paintingMoveUpAt + window.innerHeight * 1
  476. const paintingTopMovedUp = 41
  477. const paintingMoveDownAt = paintingMoveUpFinishAt + window.innerHeight * 0.5
  478. const paintingMoveDownFinishAt = paintingMoveDownAt + window.innerHeight * 0.25
  479. const paingtingTopMovedDown = -80
  480. const paintingTop = computed(() => {
  481. let ret = null
  482. if (scrollerElScrollTop.value <= paintingMoveUpAt) {
  483. ret = paintingTopInitial
  484. } else if (scrollerElScrollTop.value > paintingMoveUpAt && scrollerElScrollTop.value <= paintingMoveUpFinishAt) {
  485. ret = (scrollerElScrollTop.value - paintingMoveUpAt) / (paintingMoveUpFinishAt - paintingMoveUpAt) * (paintingTopMovedUp - paintingTopInitial) + paintingTopInitial
  486. } else if (scrollerElScrollTop.value > paintingMoveUpFinishAt && scrollerElScrollTop.value <= paintingMoveDownAt) {
  487. ret = paintingTopMovedUp
  488. } else if (scrollerElScrollTop.value > paintingMoveDownAt && scrollerElScrollTop.value <= paintingMoveDownFinishAt) {
  489. ret = (scrollerElScrollTop.value - paintingMoveDownAt) / (paintingMoveDownFinishAt - paintingMoveDownAt) * (paingtingTopMovedDown - paintingTopMovedUp) + paintingTopMovedUp
  490. } else {
  491. ret = paingtingTopMovedDown
  492. }
  493. return ret
  494. })
  495. const paintingWidthInitial = 308
  496. const paintingWidthMovedUp = 250
  497. const paintingWidthMovedDown = 485
  498. const paintingWidth = computed(() => {
  499. let ret = null
  500. if (scrollerElScrollTop.value <= paintingMoveUpAt) {
  501. ret = paintingWidthInitial
  502. } else if (scrollerElScrollTop.value > paintingMoveUpAt && scrollerElScrollTop.value <= paintingMoveUpFinishAt) {
  503. ret = (scrollerElScrollTop.value - paintingMoveUpAt) / (paintingMoveUpFinishAt - paintingMoveUpAt) * (paintingWidthMovedUp - paintingWidthInitial) + paintingWidthInitial
  504. } else if (scrollerElScrollTop.value > paintingMoveUpFinishAt && scrollerElScrollTop.value <= paintingMoveDownAt) {
  505. ret = paintingWidthMovedUp
  506. } else if (scrollerElScrollTop.value > paintingMoveDownAt && scrollerElScrollTop.value <= paintingMoveDownFinishAt) {
  507. ret = (scrollerElScrollTop.value - paintingMoveDownAt) / (paintingMoveDownFinishAt - paintingMoveDownAt) * (paintingWidthMovedDown - paintingWidthMovedUp) + paintingWidthMovedUp
  508. } else {
  509. ret = paintingWidthMovedDown
  510. }
  511. return ret
  512. })
  513. const paintingHeightInitial = 523
  514. const paintingHeightMovedUp = 425
  515. let paintingHeightMovedDown = 758
  516. const paintingHeight = computed(() => {
  517. let ret = null
  518. if (scrollerElScrollTop.value <= paintingMoveUpAt) {
  519. ret = paintingHeightInitial
  520. } else if (scrollerElScrollTop.value > paintingMoveUpAt && scrollerElScrollTop.value <= paintingMoveUpFinishAt) {
  521. ret = (scrollerElScrollTop.value - paintingMoveUpAt) / (paintingMoveUpFinishAt - paintingMoveUpAt) * (paintingHeightMovedUp - paintingHeightInitial) + paintingHeightInitial
  522. } else if (scrollerElScrollTop.value > paintingMoveUpFinishAt && scrollerElScrollTop.value <= paintingMoveDownAt) {
  523. ret = paintingHeightMovedUp
  524. } else if (scrollerElScrollTop.value > paintingMoveDownAt && scrollerElScrollTop.value <= paintingMoveDownFinishAt) {
  525. ret = (scrollerElScrollTop.value - paintingMoveDownAt) / (paintingMoveDownFinishAt - paintingMoveDownAt) * (paintingHeightMovedDown - paintingHeightMovedUp) + paintingHeightMovedUp
  526. } else {
  527. ret = paintingHeightMovedDown
  528. }
  529. return ret
  530. })
  531. const longDesc = ref(null)
  532. const longDescShowFinishAt = window.innerHeight * 0.25
  533. const longDescHideAt = longDescShowFinishAt + window.innerHeight * 1
  534. const longDescHideFinishAt = longDescHideAt + window.innerHeight * 0.25
  535. const longDescOpacity = computed(() => {
  536. let ret = null
  537. if (scrollerElScrollTop.value <= longDescShowFinishAt) {
  538. ret = 1 - (longDescShowFinishAt - scrollerElScrollTop.value) / (longDescShowFinishAt)
  539. } else if (scrollerElScrollTop.value > longDescShowFinishAt && scrollerElScrollTop.value < longDescHideAt) {
  540. ret = 1
  541. } else {
  542. ret = 1 - (scrollerElScrollTop.value - longDescHideAt) / (longDescHideFinishAt - longDescHideAt)
  543. }
  544. return ret
  545. })
  546. watch(scrollerElScrollTop, (vNew, vOld) => {
  547. console.log('scrollerElScrollTop', vNew / scrollerEl.value.scrollHeight)
  548. if (vNew > paintingMoveUpFinishAt) {
  549. // longDesc.value.scrollTop = vNew - paintingMoveUpFinishAt
  550. } else if (vNew < vOld && vNew <= paintingMoveUpFinishAt) {
  551. // longDesc.value.scrollTop = 0
  552. }
  553. })
  554. // 第一页
  555. const stemShowAt = longDescHideFinishAt + window.innerHeight * 0
  556. const stemShowFinishAt = stemShowAt + window.innerHeight * 0.25
  557. const stemHideAt = stemShowFinishAt + window.innerHeight * 0.3
  558. const stemHideFisishAt = stemHideAt + window.innerHeight * 0.25
  559. const stemOpacity = computed(() => {
  560. let ret = null
  561. if (scrollerElScrollTop.value <= stemShowAt) {
  562. ret = 0
  563. } else if (scrollerElScrollTop.value > stemShowAt && scrollerElScrollTop.value < stemShowFinishAt) {
  564. ret = (scrollerElScrollTop.value - stemShowAt) / (stemShowFinishAt - stemShowAt)
  565. } else if (scrollerElScrollTop.value >= stemShowFinishAt && scrollerElScrollTop.value <= stemHideAt) {
  566. ret = 1
  567. } else if (scrollerElScrollTop.value > stemHideAt && scrollerElScrollTop.value < stemHideFisishAt) {
  568. ret = 1 - (scrollerElScrollTop.value - stemHideAt) / (stemHideFisishAt - stemHideAt)
  569. } else {
  570. ret = 0
  571. }
  572. return ret
  573. })
  574. const stemShowAt1 = stemHideFisishAt + window.innerHeight * 0
  575. const stemShowFinishAt1 = stemShowAt1 + window.innerHeight * 0.25
  576. const stemHideAt1 = stemShowFinishAt1 + window.innerHeight * 0.3
  577. const stemHideFisishAt1 = stemHideAt1 + window.innerHeight * 0.25
  578. const stemOpacity1 = computed(() => {
  579. let ret = null
  580. if (scrollerElScrollTop.value <= stemShowAt1) {
  581. ret = 0
  582. } else if (scrollerElScrollTop.value > stemShowAt1 && scrollerElScrollTop.value < stemShowFinishAt1) {
  583. ret = (scrollerElScrollTop.value - stemShowAt1) / (stemShowFinishAt1 - stemShowAt1)
  584. } else if (scrollerElScrollTop.value >= stemShowFinishAt1 && scrollerElScrollTop.value <= stemHideAt1) {
  585. ret = 1
  586. } else if (scrollerElScrollTop.value > stemHideAt1 && scrollerElScrollTop.value < stemHideFisishAt1) {
  587. ret = 1 - (scrollerElScrollTop.value - stemHideAt1) / (stemHideFisishAt1 - stemHideAt1)
  588. } else {
  589. ret = 0
  590. }
  591. return ret
  592. })
  593. const stemShowAt2 = stemHideFisishAt1 + window.innerHeight * 0
  594. const stemShowFinishAt2 = stemShowAt2 + window.innerHeight * 0.25
  595. const stemHideAt2 = stemShowFinishAt2 + window.innerHeight * 0.3
  596. const stemHideFisishAt2 = stemHideAt2 + window.innerHeight * 0.25
  597. const stemOpacity2 = computed(() => {
  598. let ret = null
  599. if (scrollerElScrollTop.value <= stemShowAt1) {
  600. ret = 0
  601. } else if (scrollerElScrollTop.value > stemShowAt2 && scrollerElScrollTop.value < stemShowFinishAt2) {
  602. ret = (scrollerElScrollTop.value - stemShowAt2) / (stemShowFinishAt2 - stemShowAt2)
  603. } else if (scrollerElScrollTop.value >= stemShowFinishAt2 && scrollerElScrollTop.value <= stemHideAt2) {
  604. ret = 1
  605. } else if (scrollerElScrollTop.value > stemHideAt2 && scrollerElScrollTop.value < stemHideFisishAt2) {
  606. ret = 1 - (scrollerElScrollTop.value - stemHideAt2) / (stemHideFisishAt - stemHideAt2)
  607. } else {
  608. ret = 0
  609. }
  610. return ret
  611. })
  612. const stemShowText = stemShowAt
  613. const stemShowTextFinishAt = stemShowFinishAt
  614. const stemTextHideAt = stemHideAt2
  615. const stemHideTextFisishAt = stemHideFisishAt2
  616. const stemTextOpacity = computed(() => {
  617. let ret = null
  618. if (scrollerElScrollTop.value <= stemShowText) {
  619. ret = 0
  620. } else if (scrollerElScrollTop.value > stemShowText && scrollerElScrollTop.value < stemShowTextFinishAt) {
  621. ret = (scrollerElScrollTop.value - stemShowText) / (stemShowTextFinishAt - stemShowText)
  622. } else if (scrollerElScrollTop.value >= stemShowTextFinishAt && scrollerElScrollTop.value <= stemTextHideAt) {
  623. ret = 1
  624. } else if (scrollerElScrollTop.value > stemTextHideAt && scrollerElScrollTop.value < stemHideTextFisishAt) {
  625. ret = 1 - (scrollerElScrollTop.value - stemTextHideAt) / (stemHideTextFisishAt - stemTextHideAt)
  626. } else {
  627. ret = 0
  628. }
  629. return ret
  630. })
  631. const stemShowGreen = stemShowAt1
  632. const stemShowGreenFinishAt = stemShowFinishAt1
  633. const stemGreenHideAt = stemHideAt2
  634. const stemHideGreenFisishAt = stemHideFisishAt2
  635. const stemGreenOpacity = computed(() => {
  636. let ret = null
  637. if (scrollerElScrollTop.value <= stemShowGreen) {
  638. ret = 0
  639. } else if (scrollerElScrollTop.value > stemShowGreen && scrollerElScrollTop.value < stemShowGreenFinishAt) {
  640. ret = (scrollerElScrollTop.value - stemShowGreen) / (stemShowGreenFinishAt - stemShowGreen)
  641. } else if (scrollerElScrollTop.value >= stemShowGreenFinishAt && scrollerElScrollTop.value <= stemGreenHideAt) {
  642. ret = 1
  643. } else if (scrollerElScrollTop.value > stemGreenHideAt && scrollerElScrollTop.value < stemHideGreenFisishAt) {
  644. ret = 1 - (scrollerElScrollTop.value - stemGreenHideAt) / (stemHideGreenFisishAt - stemGreenHideAt)
  645. } else {
  646. ret = 0
  647. }
  648. return ret
  649. })
  650. const leafShowAt = stemHideFisishAt2 + (0 * window.innerHeight)
  651. const leafShowFinishAt = leafShowAt + (0.25 * window.innerHeight)
  652. const leafHideAt = leafShowFinishAt + (0.3 * window.innerHeight)
  653. const leafHideFisishAt = leafHideAt + (0.25 * window.innerHeight)
  654. const leafOpacity = computed(() => {
  655. let ret = null
  656. if (scrollerElScrollTop.value <= leafShowAt) {
  657. ret = 0
  658. } else if (scrollerElScrollTop.value > leafShowAt && scrollerElScrollTop.value < leafShowFinishAt) {
  659. ret = (scrollerElScrollTop.value - leafShowAt) / (leafShowFinishAt - leafShowAt)
  660. } else if (scrollerElScrollTop.value >= leafShowFinishAt && scrollerElScrollTop.value <= leafHideAt) {
  661. ret = 1
  662. } else if (scrollerElScrollTop.value > leafHideAt && scrollerElScrollTop.value < leafHideFisishAt) {
  663. ret = 1 - (scrollerElScrollTop.value - leafHideAt) / (leafHideFisishAt - leafHideAt)
  664. } else {
  665. ret = 0
  666. }
  667. return ret
  668. })
  669. const leafShowAt1 = leafHideFisishAt + (0 * window.innerHeight)
  670. const leafShowFinishAt1 = leafShowAt1 + (0.25 * window.innerHeight)
  671. const leafHideAt1 = leafShowFinishAt1 + (0.3 * window.innerHeight)
  672. const leafHideFisishAt1 = leafHideAt1 + (0.25 * window.innerHeight)
  673. const leafOpacity1 = computed(() => {
  674. let ret = null
  675. if (scrollerElScrollTop.value <= leafShowAt1) {
  676. ret = 0
  677. } else if (scrollerElScrollTop.value > leafShowAt1 && scrollerElScrollTop.value < leafShowFinishAt1) {
  678. ret = (scrollerElScrollTop.value - leafShowAt1) / (leafShowFinishAt1 - leafShowAt1)
  679. } else if (scrollerElScrollTop.value >= leafShowFinishAt1 && scrollerElScrollTop.value <= leafHideAt1) {
  680. ret = 1
  681. } else if (scrollerElScrollTop.value > leafHideAt1 && scrollerElScrollTop.value < leafHideFisishAt1) {
  682. ret = 1 - (scrollerElScrollTop.value - leafHideAt1) / (leafHideFisishAt1 - leafHideAt1)
  683. } else {
  684. ret = 0
  685. }
  686. return ret
  687. })
  688. const leafShowAt2 = leafHideFisishAt1 + (0 * window.innerHeight)
  689. const leafShowFinishAt2 = leafShowAt2 + (0.25 * window.innerHeight)
  690. const leafHideAt2 = leafShowFinishAt2 + (0.3 * window.innerHeight)
  691. const leafHideFisishAt2 = leafHideAt2 + (0.25 * window.innerHeight)
  692. const leafOpacity2 = computed(() => {
  693. let ret = null
  694. if (scrollerElScrollTop.value <= leafShowAt2) {
  695. ret = 0
  696. } else if (scrollerElScrollTop.value > leafShowAt2 && scrollerElScrollTop.value < leafShowFinishAt2) {
  697. ret = (scrollerElScrollTop.value - leafShowAt2) / (leafShowFinishAt2 - leafShowAt2)
  698. } else if (scrollerElScrollTop.value >= leafShowFinishAt2 && scrollerElScrollTop.value <= leafHideAt2) {
  699. ret = 1
  700. } else if (scrollerElScrollTop.value > leafHideAt2 && scrollerElScrollTop.value < leafHideFisishAt2) {
  701. ret = 1 - (scrollerElScrollTop.value - leafHideAt2) / (leafHideFisishAt2 - leafHideAt2)
  702. } else {
  703. ret = 0
  704. }
  705. return ret
  706. })
  707. const leafShowAt3 = leafHideFisishAt2 + (0 * window.innerHeight)
  708. const leafShowFinishAt3 = leafShowAt3 + (0.25 * window.innerHeight)
  709. const leafHideAt3 = leafShowFinishAt3 + (0.3 * window.innerHeight)
  710. const leafHideFisishAt3 = leafHideAt3 + (0.25 * window.innerHeight)
  711. const leafOpacity3 = computed(() => {
  712. let ret = null
  713. if (scrollerElScrollTop.value <= leafShowAt3) {
  714. ret = 0
  715. } else if (scrollerElScrollTop.value > leafShowAt3 && scrollerElScrollTop.value < leafShowFinishAt3) {
  716. ret = (scrollerElScrollTop.value - leafShowAt3) / (leafShowFinishAt3 - leafShowAt3)
  717. } else if (scrollerElScrollTop.value >= leafShowFinishAt3 && scrollerElScrollTop.value <= leafHideAt3) {
  718. ret = 1
  719. } else if (scrollerElScrollTop.value > leafHideAt3 && scrollerElScrollTop.value < leafHideFisishAt3) {
  720. ret = 1 - (scrollerElScrollTop.value - leafHideAt3) / (leafHideFisishAt3 - leafHideAt3)
  721. } else {
  722. ret = 0
  723. }
  724. return ret
  725. })
  726. const leafShowText = leafShowAt
  727. const leafShowTextFinishAt = leafShowFinishAt
  728. const leafTextHideAt = leafHideAt3
  729. const leafHideTextFisishAt = leafHideFisishAt3
  730. const leafTextOpacity = computed(() => {
  731. let ret = null
  732. if (scrollerElScrollTop.value <= leafShowText) {
  733. ret = 0
  734. } else if (scrollerElScrollTop.value > leafShowText && scrollerElScrollTop.value < leafShowTextFinishAt) {
  735. ret = (scrollerElScrollTop.value - leafShowText) / (leafShowTextFinishAt - leafShowText)
  736. } else if (scrollerElScrollTop.value >= leafShowTextFinishAt && scrollerElScrollTop.value <= leafTextHideAt) {
  737. ret = 1
  738. } else if (scrollerElScrollTop.value > leafTextHideAt && scrollerElScrollTop.value < leafHideTextFisishAt) {
  739. ret = 1 - (scrollerElScrollTop.value - leafTextHideAt) / (leafHideTextFisishAt - leafTextHideAt)
  740. } else {
  741. ret = 0
  742. }
  743. return ret
  744. })
  745. const leafShowGreen = leafShowAt1
  746. const leafShowGreenFinishAt = leafShowFinishAt1
  747. const leafGreenHideAt = leafHideAt3
  748. const leafHideGreenFisishAt = leafHideFisishAt3
  749. const leafGreenOpacity = computed(() => {
  750. let ret = null
  751. if (scrollerElScrollTop.value <= leafShowGreen) {
  752. ret = 0
  753. } else if (scrollerElScrollTop.value > leafShowGreen && scrollerElScrollTop.value < leafShowGreenFinishAt) {
  754. ret = (scrollerElScrollTop.value - leafShowGreen) / (leafShowGreenFinishAt - leafShowGreen)
  755. } else if (scrollerElScrollTop.value >= leafShowGreenFinishAt && scrollerElScrollTop.value <= leafGreenHideAt) {
  756. ret = 1
  757. } else if (scrollerElScrollTop.value > leafGreenHideAt && scrollerElScrollTop.value < leafHideGreenFisishAt) {
  758. ret = 1 - (scrollerElScrollTop.value - leafGreenHideAt) / (leafHideGreenFisishAt - leafGreenHideAt)
  759. } else {
  760. ret = 0
  761. }
  762. return ret
  763. })
  764. const stoneShowAt = leafHideFisishAt3 + (0 * window.innerHeight)
  765. const stoneShowFinishAt = stoneShowAt + (0.25 * window.innerHeight)
  766. const stoneHideAt = stoneShowFinishAt + (0.3 * window.innerHeight)
  767. const stoneHideFinishAt = stoneHideAt + (0.25 * window.innerHeight)
  768. const stoneOpacity = computed(() => {
  769. let ret = null
  770. if (scrollerElScrollTop.value <= stoneShowAt) {
  771. ret = 0
  772. } else if (scrollerElScrollTop.value > stoneShowAt && scrollerElScrollTop.value < stoneShowFinishAt) {
  773. ret = (scrollerElScrollTop.value - stoneShowAt) / (stoneShowFinishAt - stoneShowAt)
  774. } else if (scrollerElScrollTop.value >= stoneShowFinishAt && scrollerElScrollTop.value <= stoneHideAt) {
  775. ret = 1
  776. } else if (scrollerElScrollTop.value > stoneHideAt && scrollerElScrollTop.value < stoneHideFinishAt) {
  777. ret = 1 - (scrollerElScrollTop.value - stoneHideAt) / (stoneHideFinishAt - stoneHideAt)
  778. } else {
  779. ret = 0
  780. }
  781. return ret
  782. })
  783. const stoneShowAt1 = stoneHideFinishAt + (0 * window.innerHeight)
  784. const stoneShowFinishAt1 = stoneShowAt1 + (0.25 * window.innerHeight)
  785. const stoneHideAt1 = stoneShowFinishAt1 + (0.3 * window.innerHeight)
  786. const stoneHideFinishAt1 = stoneHideAt1 + (0.25 * window.innerHeight)
  787. const stoneOpacity1 = computed(() => {
  788. let ret = null
  789. if (scrollerElScrollTop.value <= stoneShowAt1) {
  790. ret = 0
  791. } else if (scrollerElScrollTop.value > stoneShowAt1 && scrollerElScrollTop.value < stoneShowFinishAt1) {
  792. ret = (scrollerElScrollTop.value - stoneShowAt1) / (stoneShowFinishAt1 - stoneShowAt1)
  793. } else if (scrollerElScrollTop.value >= stoneShowFinishAt1 && scrollerElScrollTop.value <= stoneHideAt1) {
  794. ret = 1
  795. } else if (scrollerElScrollTop.value > stoneHideAt1 && scrollerElScrollTop.value < stoneHideFinishAt1) {
  796. ret = 1 - (scrollerElScrollTop.value - stoneHideAt1) / (stoneHideFinishAt1 - stoneHideAt1)
  797. } else {
  798. ret = 0
  799. }
  800. return ret
  801. })
  802. const stoneShowGreen = stoneShowAt1
  803. const stoneShowGreenFinishAt = stoneShowFinishAt1
  804. const stoneGreenHideAt = stoneHideAt1
  805. const stoneHideGreenFisishAt = stoneHideFinishAt1
  806. const stoneGreenOpacity = computed(() => {
  807. let ret = null
  808. if (scrollerElScrollTop.value <= stoneShowGreen) {
  809. ret = 0
  810. } else if (scrollerElScrollTop.value > stoneShowGreen && scrollerElScrollTop.value < stoneShowGreenFinishAt) {
  811. ret = (scrollerElScrollTop.value - stoneShowGreen) / (stoneShowGreenFinishAt - stoneShowGreen)
  812. } else if (scrollerElScrollTop.value >= stoneShowGreenFinishAt && scrollerElScrollTop.value <= stoneGreenHideAt) {
  813. ret = 1
  814. } else if (scrollerElScrollTop.value > stoneGreenHideAt && scrollerElScrollTop.value < stoneHideGreenFisishAt) {
  815. ret = 1 - (scrollerElScrollTop.value - stoneGreenHideAt) / (stoneHideGreenFisishAt - stoneGreenHideAt)
  816. } else {
  817. ret = 0
  818. }
  819. return ret
  820. })
  821. const stoneShowText = stoneShowAt
  822. const stoneShowTextFinishAt = stoneShowFinishAt
  823. const stoneTextHideAt = stoneHideAt1
  824. const stoneHideTextFisishAt = stoneHideFinishAt1
  825. const stoneTextOpacity = computed(() => {
  826. let ret = null
  827. if (scrollerElScrollTop.value <= stoneShowText) {
  828. ret = 0
  829. } else if (scrollerElScrollTop.value > stoneShowText && scrollerElScrollTop.value < stoneShowTextFinishAt) {
  830. ret = (scrollerElScrollTop.value - stoneShowText) / (stoneShowTextFinishAt - stoneShowText)
  831. } else if (scrollerElScrollTop.value >= stoneShowTextFinishAt && scrollerElScrollTop.value <= stoneTextHideAt) {
  832. ret = 1
  833. } else if (scrollerElScrollTop.value > stoneTextHideAt && scrollerElScrollTop.value < stoneHideTextFisishAt) {
  834. ret = 1 - (scrollerElScrollTop.value - stoneTextHideAt) / (stoneHideTextFisishAt - stoneTextHideAt)
  835. } else {
  836. ret = 0
  837. }
  838. return ret
  839. })
  840. const summaryShowAt = stoneHideFinishAt1 + window.innerHeight * 0
  841. const summaryShowFinishAt = summaryShowAt + window.innerHeight * 0.25
  842. const summaryHideAt = summaryShowFinishAt + window.innerHeight * 0.3
  843. const summaryHideFisishAt = summaryHideAt + window.innerHeight * 0.25
  844. const summaryOpacity = computed(() => {
  845. let ret = null
  846. if (scrollerElScrollTop.value <= summaryShowAt) {
  847. ret = 0
  848. } else if (scrollerElScrollTop.value > summaryShowAt && scrollerElScrollTop.value < summaryShowFinishAt) {
  849. ret = (scrollerElScrollTop.value - summaryShowAt) / (summaryShowFinishAt - summaryShowAt)
  850. } else if (scrollerElScrollTop.value >= summaryShowFinishAt && scrollerElScrollTop.value <= summaryHideAt) {
  851. ret = 1
  852. } else if (scrollerElScrollTop.value > summaryHideAt && scrollerElScrollTop.value < summaryHideFisishAt) {
  853. ret = 1 - (scrollerElScrollTop.value - summaryHideAt) / (summaryHideFisishAt - summaryHideAt)
  854. } else {
  855. ret = 0
  856. }
  857. return ret
  858. })
  859. const sizeShowAt = stemShowAt
  860. const sizeShowFinishAt = stemShowFinishAt
  861. const sizeHideAt = stoneHideAt
  862. const sizeHideFisishAt = stoneHideFinishAt
  863. const sizeOpacity = computed(() => {
  864. let ret = null
  865. if (scrollerElScrollTop.value <= sizeShowAt) {
  866. ret = 0
  867. } else if (scrollerElScrollTop.value > sizeShowAt && scrollerElScrollTop.value < sizeShowFinishAt) {
  868. ret = (scrollerElScrollTop.value - sizeShowAt) / (sizeShowFinishAt - sizeShowAt)
  869. } else if (scrollerElScrollTop.value >= sizeShowFinishAt && scrollerElScrollTop.value <= sizeHideAt) {
  870. ret = 1
  871. } else if (scrollerElScrollTop.value > sizeHideAt && scrollerElScrollTop.value < sizeHideFisishAt) {
  872. ret = 1 - (scrollerElScrollTop.value - sizeHideAt) / (sizeHideFisishAt - sizeHideAt)
  873. } else {
  874. ret = 0
  875. }
  876. return ret
  877. })
  878. const isShowHotspot = computed(() => {
  879. let ret = null
  880. // console.log('scrollerElScrollTop.value', scrollerElScrollTop.value <= sizeShowAt)
  881. if (scrollerElScrollTop.value <= sizeShowAt && scrollerElScrollTop.value > 0) {
  882. ret = true
  883. } else {
  884. return false
  885. }
  886. return ret
  887. })
  888. const isShowHotspotDetail1 = ref(false)
  889. // const isShowPaintingDetail = ref(false)
  890. const isShowHotspotDetail3 = ref(false)
  891. function showBigPainting() {
  892. viewerApi({
  893. images: [require(`@/assets/images/home-painting-big.jpg`)],
  894. })
  895. }
  896. /**
  897. * 跳转新页面
  898. */
  899. const videoFadeToNextPageEl = ref(null)
  900. const isShowVideoFadeToNextPage = ref(false)
  901. const isShowSkip = ref(false)
  902. const isShowBtnGoNextPage = ref(false)
  903. watch(scrollerElScrollTop, (v) => {
  904. if (Math.abs(v + windowHeight.value - scrollerEl.value.scrollHeight) < 3) {
  905. isShowBtnGoNextPage.value = true
  906. } else {
  907. isShowBtnGoNextPage.value = false
  908. }
  909. })
  910. function smoothScrollTo(element, finalPosition, duration = 500, startTime = performance.now()) {
  911. const currentTime = performance.now()
  912. const timeElapsed = currentTime - startTime
  913. const progress = Math.min(timeElapsed / duration, 1) // 确保进度不超过1
  914. const currentPos = element.scrollTop
  915. const newPos = currentPos + (finalPosition - currentPos) * progress
  916. element.scrollTop = newPos
  917. if (progress < 1 && finalPosition == scrollerPositionList[curStep.value] * scrollerEl.value.scrollHeight) {
  918. // console.log('最后位置', finalPosition)
  919. requestAnimationFrame(() => smoothScrollTo(element, finalPosition, duration, startTime))
  920. }
  921. }
  922. const curStep = ref(0)
  923. const scrollerPositionList = [0, 0.115, 0.173, 0.265, 0.346, 0.416, 0.508, 0.589, 0.658, 0.716, 0.809, 1]
  924. const scrollerPositionTimeRight = [12000, 12000, 12000, 12000, 12000, 6000, 6000, 6000, 6000, 6000, 6000, 6000]
  925. const scrollerPositionTimeLeft = [12000, 12000, 12000, 12000, 12000, 6000, 6000, 6000, 6000, 6000, 6000, 6000]
  926. const onSwipeLeft = () => {
  927. if (curStep.value < scrollerPositionList.length - 1) {
  928. curStep.value ++
  929. const pp = scrollerPositionList[curStep.value]
  930. const startTime = performance.now()
  931. requestAnimationFrame(() => {smoothScrollTo(scrollerEl.value, pp * scrollerEl.value.scrollHeight, scrollerPositionTimeRight[curStep.value], startTime)})
  932. }
  933. }
  934. const onSwipeRight = () => {
  935. if (curStep.value > 0) {
  936. curStep.value --
  937. const pp = scrollerPositionList[curStep.value] * scrollerEl.value.scrollHeight
  938. const startTime = performance.now()
  939. requestAnimationFrame(() => {smoothScrollTo(scrollerEl.value, pp, scrollerPositionTimeLeft[curStep.value], startTime)})
  940. }
  941. }
  942. function onClickGoNextPage() {
  943. isShowBtnGoNextPage.value = false
  944. isShowVideoFadeToNextPage.value = true
  945. nextTick(() => {
  946. videoFadeToNextPageEl.value.play()
  947. })
  948. setTimeout(() => {
  949. isShowSkip.value = true
  950. }, 2000)
  951. }
  952. </script>
  953. <style lang="less" scoped>
  954. .home {
  955. width: 100%;
  956. height: 100%;
  957. background-image: url(@/assets/images/home-painting-line-small.jpg);
  958. background-size: cover;
  959. background-repeat: no-repeat;
  960. background-position: center center;
  961. // 滚动条,只设置某一项可能导致不生效。
  962. ::-webkit-scrollbar {
  963. width: 0;
  964. height: 0;
  965. }
  966. >.bg-mask {
  967. position: absolute;
  968. left: 0;
  969. top: 0;
  970. width: 100%;
  971. height: 100%;
  972. background: rgba(60, 89, 71, 0.65);
  973. backdrop-filter: blur(calc(22 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  974. }
  975. >.startup {
  976. z-index: 20;
  977. }
  978. >.title-wrap {
  979. position: absolute;
  980. left: 50%;
  981. top: calc(36 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  982. transform: translate(-50%);
  983. width: calc(43 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  984. height: calc(180 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  985. z-index: 5;
  986. >img.title {
  987. position: absolute;
  988. left: 0;
  989. top: 0;
  990. width: 100%;
  991. height: 100%;
  992. }
  993. >.sub-text {
  994. position: absolute;
  995. left: 110%;
  996. top: 46%;
  997. transform: translateY(-50%);
  998. writing-mode: vertical-lr;
  999. font-family: KaiTi, KaiTi;
  1000. font-weight: 400;
  1001. font-size: calc(18 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1002. color: #FFFFFF;
  1003. line-height: calc(21 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1004. white-space: pre;
  1005. letter-spacing: 0.2em;
  1006. text-align: center;
  1007. }
  1008. }
  1009. >.painting-wrap {
  1010. position: absolute;
  1011. left: 50%;
  1012. transform: translate(-50%, 0);
  1013. z-index: 1;
  1014. >.green-box{
  1015. width: 200vw;
  1016. height: 200vh;
  1017. background: rgba(85, 116, 83, 0.8);
  1018. position: fixed;
  1019. top: 0;
  1020. left: 0;
  1021. z-index: 2;
  1022. overflow: hidden;
  1023. transition: opacity 1s ease;
  1024. }
  1025. >.size-sign-h {
  1026. position: absolute;
  1027. left: 50%;
  1028. top: 0;
  1029. transform: translate(-50%, -105%);
  1030. width: calc(245 / 308 * 100%);
  1031. >img {
  1032. width: 100%;
  1033. }
  1034. >span {
  1035. position: absolute;
  1036. left: 50%;
  1037. top: 50%;
  1038. transform: translate(-50%, -50%);
  1039. font-family: KaiTi, KaiTi;
  1040. font-weight: 400;
  1041. font-size: calc(16 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1042. color: #FFFFFF;
  1043. line-height: calc(23 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1044. text-shadow: 0px 0px calc(4 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')) #F8DD86;
  1045. }
  1046. }
  1047. >.size-sign-v {
  1048. position: absolute;
  1049. right: 0;
  1050. top: 54%;
  1051. transform: translate(80%, -50%);
  1052. height: calc(371 / 523 * 100%);
  1053. >img {
  1054. height: 100%;
  1055. }
  1056. >span {
  1057. position: absolute;
  1058. left: 50%;
  1059. top: 50%;
  1060. transform: translate(-50%, -50%);
  1061. font-family: KaiTi, KaiTi;
  1062. font-weight: 400;
  1063. font-size: calc(16 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1064. color: #FFFFFF;
  1065. line-height: calc(23 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1066. text-shadow: 0px 0px calc(4 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')) #F8DD86;
  1067. writing-mode: vertical-lr;
  1068. }
  1069. }
  1070. >img.painting-border {
  1071. position: absolute;
  1072. left: 0;
  1073. top: 0;
  1074. width: 100%;
  1075. height: 100%;
  1076. }
  1077. >img.painting,
  1078. img.painting-stem,
  1079. img.painting-leaf,
  1080. img.painting-stone {
  1081. position: absolute;
  1082. left: 50%;
  1083. top: 54%;
  1084. transform: translate(-50%, -50%);
  1085. width: calc(225 / 308 * 100%);
  1086. }
  1087. }
  1088. >.hotspot-wrap {
  1089. position: absolute;
  1090. left: 50%;
  1091. transform: translate(-50%, 0);
  1092. width: calc(264 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1093. height: calc(434 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1094. z-index: 7;
  1095. pointer-events: none;
  1096. &>div {
  1097. z-index: 100;
  1098. }
  1099. >.hotspot-1 {
  1100. position: absolute;
  1101. top: calc(54 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1102. right: calc(0 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1103. pointer-events: initial;
  1104. }
  1105. >.hotspot-2 {
  1106. position: absolute;
  1107. left: calc(60 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1108. top: calc(222 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1109. pointer-events: initial;
  1110. }
  1111. >.hotspot-3 {
  1112. position: absolute;
  1113. bottom: calc(-10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1114. right: calc(-10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1115. pointer-events: initial;
  1116. }
  1117. }
  1118. >.long-desc {
  1119. position: absolute;
  1120. left: 50%;
  1121. bottom: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1122. width: calc(309 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1123. transform: translate(-50%, 0);
  1124. color: white;
  1125. overflow: auto;
  1126. font-family: KaiTi, KaiTi;
  1127. color: #FFFFFF;
  1128. animation: none;
  1129. z-index: 10;
  1130. >h3 {
  1131. font-size: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1132. margin-bottom: 0.5em;
  1133. font-weight: 600;
  1134. }
  1135. >p {
  1136. font-weight: 400;
  1137. font-size: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1138. line-height: calc(25 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1139. text-align: justify;
  1140. margin-bottom: 0.5em;
  1141. }
  1142. }
  1143. >.fixed-desc {
  1144. position: absolute;
  1145. left: 50%;
  1146. transform: translateX(-50%);
  1147. width: calc(309 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1148. height: 20%;
  1149. display: flex;
  1150. justify-content: center;
  1151. align-items: center;
  1152. font-family: KaiTi, KaiTi;
  1153. color: #FFFFFF;
  1154. font-weight: 400;
  1155. font-size: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1156. line-height: calc(25 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1157. text-align: justify;
  1158. z-index:2;
  1159. }
  1160. >.detail-title-stem{
  1161. font-size: calc(24 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1162. letter-spacing: 2px;
  1163. transition: top 1s ease;
  1164. position:relative;
  1165. z-index:2;
  1166. }
  1167. >.progress-bar {
  1168. position: absolute;
  1169. left: 0;
  1170. bottom: 0;
  1171. width: 100%;
  1172. height: 15px;
  1173. z-index: 3;
  1174. >.bar-artwork-desc {
  1175. position: absolute;
  1176. left: 0;
  1177. bottom: 0;
  1178. right: 10px;
  1179. height: 3px;
  1180. background-color: #A9D185;
  1181. }
  1182. >img.progress-bar-node-1 {
  1183. position: absolute;
  1184. left: calc(0.6 * v-bind('longDescHideFinishAt') / v-bind('summaryHideAt') * 100%);
  1185. bottom: 1px;
  1186. width: 2.41px;
  1187. height: 10.23px
  1188. }
  1189. >.bar-author-desc {
  1190. position: absolute;
  1191. left: 12px;
  1192. bottom: 0;
  1193. right: calc(v-bind('longDescHideFinishAt') / v-bind('summaryHideAt') * 100%);
  1194. height: 3px;
  1195. background: #A9D185;
  1196. }
  1197. >img.progress-bar-node-2 {
  1198. position: absolute;
  1199. left: calc(v-bind('longDescHideFinishAt') / v-bind('summaryHideAt') * 100%);
  1200. bottom: 1px;
  1201. width: 7.5px;
  1202. height: 10.8px
  1203. }
  1204. >.bar-artwork-enjoy {
  1205. position: absolute;
  1206. left: calc(v-bind('stoneShowAt') / v-bind('summaryHideAt') * 100%);
  1207. bottom: 0;
  1208. right: 0;
  1209. height: 3px;
  1210. background: #A9D185;
  1211. }
  1212. >img.progress-bar-node-3 {
  1213. position: absolute;
  1214. right: 0;
  1215. bottom: 1px;
  1216. width: 9.7px;
  1217. height: 10.8px
  1218. }
  1219. >.mask {
  1220. position: absolute;
  1221. right: 0;
  1222. bottom: 0;
  1223. height: 15px;
  1224. background-color: #6e8175;
  1225. }
  1226. }
  1227. >.operation-tip {
  1228. position: absolute;
  1229. left: 50%;
  1230. transform: translateX(-50%);
  1231. // bottom: calc(77 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1232. bottom: calc(30 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1233. }
  1234. >.scroller {
  1235. position: absolute;
  1236. left: 0;
  1237. top: 0;
  1238. width: 100%;
  1239. height: 100%;
  1240. overflow: auto;
  1241. transition: transform 2s ease;
  1242. z-index:3;
  1243. >.inner {
  1244. width: 100%;
  1245. }
  1246. }
  1247. >.hotspot-detail {
  1248. z-index: 21;
  1249. }
  1250. >.hotspot-detail.painting-detail {
  1251. backdrop-filter: blur(calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  1252. }
  1253. >video.fade-to-next-page {
  1254. position: absolute;
  1255. left: 0;
  1256. top: 0;
  1257. width: 100%;
  1258. height: 100%;
  1259. object-fit: cover;
  1260. z-index: 20;
  1261. }
  1262. >button.go-next-page {
  1263. position: absolute;
  1264. left: 50%;
  1265. bottom: calc(25 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  1266. z-index: 20;
  1267. transform: translate(-50%, 0);
  1268. }
  1269. }
  1270. </style>