UserGuide.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <div class="user-guide">
  3. <template v-if="showVideo">
  4. <video
  5. ref="videoRef"
  6. autoplay
  7. src="@/assets/videos/guide.mp4"
  8. x5-playsinline="true"
  9. playsinline="true"
  10. webkit-playsinline="true"
  11. x-webkit-airplay="true"
  12. x5-video-player-type="h5-page"
  13. @play="showVideoPlay = false"
  14. @ended="showVideo = false"
  15. />
  16. <img
  17. v-if="$isMobile && showVideoPlay"
  18. class="play-icon"
  19. src="@/assets/images/play.png"
  20. @click="() => {
  21. videoRef?.play()
  22. showVideoPlay = false
  23. }"
  24. >
  25. <img
  26. class="video-skip"
  27. src="@/assets/images/startup-video-skip.png"
  28. @click="() => {
  29. showVideo = false
  30. showVideoPlay = false
  31. }"
  32. >
  33. </template>
  34. <template v-else>
  35. <div
  36. class="btn"
  37. @click="handleClose"
  38. >
  39. {{ curStep === 6 ? '我知道了' : '下一步' }}
  40. </div>
  41. <template v-if="curStep === 0">
  42. <div :class="['user-guide-1', $isMobile && 'is-mobile']" />
  43. </template>
  44. <template v-else>
  45. <template v-if="curStep > 1">
  46. <div class="guide-home">
  47. <div
  48. class="left-line"
  49. >
  50. 返回首页
  51. </div>
  52. </div>
  53. <div class="guide-game">
  54. <div
  55. class="left-line"
  56. >
  57. 游戏入口
  58. </div>
  59. </div>
  60. <div class="guide-guide">
  61. <div
  62. class="left-line"
  63. >
  64. 操作指引
  65. </div>
  66. </div>
  67. </template>
  68. <div
  69. class="guide-dot"
  70. >
  71. <div
  72. class="left-line"
  73. >
  74. <span>场景互动</span>
  75. </div>
  76. </div>
  77. <div class="guide-box">
  78. <div class="guide-box__contain">
  79. <img
  80. src="https://4dkk.4dage.com/720yun_fd_manage/fodder/20231227_155535175.png"
  81. >
  82. </div>
  83. <div
  84. class="left-line"
  85. >
  86. <span>探索文物</span>
  87. </div>
  88. </div>
  89. <template v-if="curStep > 5">
  90. <div
  91. class="character"
  92. style="overflow: visible;"
  93. >
  94. <div class="top-line">
  95. 对话赵孟頫
  96. </div>
  97. </div>
  98. <div class="character">
  99. <img
  100. class="default-frames"
  101. src="@/assets/images/pose1-min.png"
  102. alt=""
  103. draggable="false"
  104. >
  105. </div>
  106. </template>
  107. <template v-if="curStep > 2">
  108. <div class="guide-menu">
  109. 营都人员与机构
  110. <div
  111. class="top-line"
  112. >
  113. 阅读历史
  114. </div>
  115. </div>
  116. </template>
  117. <template v-if="curStep > 3">
  118. <div
  119. class="guide-tab"
  120. :style="guideTabStyle"
  121. >
  122. <span>帝都</span>
  123. <div
  124. class="top-line"
  125. >
  126. <p>改变场景位置</p>
  127. </div>
  128. </div>
  129. </template>
  130. <div
  131. v-if="curStep > 4"
  132. class="qhcj"
  133. >
  134. <div
  135. class="top-line"
  136. >
  137. 切换场景
  138. </div>
  139. </div>
  140. </template>
  141. </template>
  142. </div>
  143. </template>
  144. <script setup>
  145. import { onMounted, ref, inject } from "vue"
  146. const curStep = ref(0)
  147. const guideTabStyle = ref('')
  148. const showVideo = ref(true)
  149. const showVideoPlay = ref(true)
  150. const videoRef = ref()
  151. const $isMobile = inject('$isMobile')
  152. const emits = defineEmits(['close'])
  153. onMounted(() => {
  154. const dom = document.querySelector('.bg-active')
  155. if (dom) {
  156. const rect = dom.getBoundingClientRect()
  157. guideTabStyle.value = `width:${rect.width}px;height:${rect.height}px;top:${rect.top}px;left:${rect.left}px;display:block`
  158. }
  159. })
  160. const handleClose = () => {
  161. if (curStep.value > 5) {
  162. emits('close')
  163. localStorage.setItem('is-open-guide', 1)
  164. } else {
  165. curStep.value += 1
  166. }
  167. }
  168. </script>
  169. <style lang="less" scoped>
  170. .video-skip {
  171. position: absolute;
  172. right: 43px;
  173. bottom: 20px;
  174. width: 291px;
  175. cursor: pointer;
  176. z-index: 1;
  177. }
  178. .play-icon {
  179. position: absolute;
  180. top: 50%;
  181. left: 50%;
  182. width: 120px;
  183. transform: translate(-50%, -50%);
  184. z-index: 1;
  185. }
  186. .user-guide {
  187. .character {
  188. position: absolute;
  189. left: -157px;
  190. bottom: -18px;
  191. margin-left: constant(safe-area-inset-left);
  192. margin-left: env(safe-area-inset-left);
  193. height: 480px;
  194. width: 640px;
  195. overflow: hidden;
  196. z-index: 5;
  197. >.default-frames{
  198. position: absolute;
  199. left: 0;
  200. height: 100%;
  201. animation-name: character-default-animation;
  202. animation-timing-function: steps(60, end);
  203. animation-duration: 2.5s;
  204. animation-iteration-count: infinite;
  205. }
  206. .top-line {
  207. margin-left: 2px;
  208. bottom: 550px;
  209. }
  210. img {
  211. width: 38400px;
  212. }
  213. }
  214. span,
  215. p {
  216. font-family: "Source Han Sans SC Regular" !important;
  217. }
  218. }
  219. .guide-tab {
  220. display: none;
  221. position: absolute;
  222. background: url('@/assets/images/camera-list-item-bg-active-1.png') no-repeat center / cover;
  223. span {
  224. position: absolute;
  225. left: 50%;
  226. bottom: 18px;
  227. font-size: 21px;
  228. color: #794A00;
  229. font-weight: 600;
  230. transform: translateX(-50%);
  231. letter-spacing: 9px;
  232. font-family: Source Han Serif CN;
  233. }
  234. .top-line {
  235. top: -110px;
  236. margin-left: -10px;
  237. }
  238. }
  239. .guide-menu {
  240. position: absolute;
  241. left: 367px;
  242. bottom: 306px;
  243. margin-left: constant(safe-area-inset-left);
  244. margin-left: env(safe-area-inset-left);
  245. padding-left: 107px;
  246. width: 390px;
  247. height: 104px;
  248. line-height: 104px;
  249. font-size: 23px;
  250. color: #FFF1BE;
  251. letter-spacing: 5px;
  252. box-sizing: border-box;
  253. font-family: Source Han Serif CN;
  254. background: url('@/assets/images/camera-btn-1-1-2-active.png') no-repeat center / contain;
  255. .top-line {
  256. top: -130px;
  257. left: 55px;
  258. }
  259. }
  260. .qhcj {
  261. position: absolute;
  262. right: 70px;
  263. bottom: 250px;
  264. width: 42px;
  265. height: 11px;
  266. .top-line {
  267. bottom: 0;
  268. }
  269. &::after {
  270. content: '';
  271. position: absolute;
  272. left: -40px;
  273. bottom: -230px;
  274. width: 120px;
  275. height: 120px;
  276. border-radius: 4px;
  277. box-shadow: 0px 0px 5px 0px #FFE88B;
  278. }
  279. }
  280. .guide-home {
  281. position: absolute;
  282. width: 77px;
  283. height: 77px;
  284. top: 43px;
  285. right: 51px;
  286. background: url('@/assets/images/btn-return-home-1.png') no-repeat center / contain;
  287. z-index: 1;
  288. }
  289. .guide-guide {
  290. position: absolute;
  291. width: 77px;
  292. height: 77px;
  293. top: 213px;
  294. right: 51px;
  295. background: url('@/assets/images/guide/tbn_help-min.png') no-repeat center / cover;
  296. }
  297. .guide-game {
  298. position: absolute;
  299. width: 77px;
  300. height: 77px;
  301. top: 128px;
  302. right: 51px;
  303. background: url('@/assets/images/btn-game-entry-page-1.png') no-repeat center / cover;
  304. }
  305. .guide-dot {
  306. position: absolute;
  307. top: 118px;
  308. right: 860px;
  309. width: 35px;
  310. height: 35px;
  311. background: url('@/assets/images/guide/Dots.png') no-repeat center / contain;
  312. z-index: 1;
  313. }
  314. .guide-box {
  315. position: absolute;
  316. top: 188px;
  317. right: 850px;
  318. width: 60px;
  319. height: 60px;
  320. z-index: 1;
  321. &__contain {
  322. position: relative;
  323. width: inherit;
  324. height: inherit;
  325. overflow: hidden;
  326. }
  327. img {
  328. position: absolute;
  329. top: 0;
  330. left: 0;
  331. width: inherit;
  332. animation-name: hotspot-icon-animation;
  333. animation-timing-function: steps(24, end);
  334. animation-duration: 1s;
  335. animation-iteration-count: infinite;
  336. }
  337. }
  338. .top-line {
  339. position: absolute;
  340. left: 50%;
  341. bottom: 550px;
  342. height: fit-content;
  343. font-size: 18px;
  344. color: rgba(255,255,255,0.85);
  345. line-height: 21px;
  346. letter-spacing: 3px;
  347. white-space: nowrap;
  348. transform: translateX(-50%);
  349. text-shadow: 2px 2px 15px #C9AA79;
  350. &::before {
  351. content: '';
  352. position: absolute;
  353. left: 50%;
  354. bottom: -10px;
  355. width: 6px;
  356. height: 6px;
  357. border-radius: 50%;
  358. background-color: #FFEAA8;
  359. transform: translateX(-50%);
  360. }
  361. &::after {
  362. content: '';
  363. position: absolute;
  364. bottom: -102px;
  365. left: 50%;
  366. width: 1px;
  367. height: 92px;
  368. border-right: 1px dotted #FFEAA8;
  369. box-sizing: border-box;
  370. transform: translateX(-50%);
  371. }
  372. }
  373. .left-line {
  374. position: absolute;
  375. top: 50%;
  376. left: -230px;
  377. font-size: 18px;
  378. color: rgba(255,255,255,0.85);
  379. line-height: 21px;
  380. letter-spacing: 3px;
  381. white-space: nowrap;
  382. text-shadow: 2px 2px 15px #C9AA79;
  383. transform: translateY(-50%);
  384. &::before {
  385. content: '';
  386. position: absolute;
  387. top: 50%;
  388. right: -20px;
  389. width: 5px;
  390. height: 5px;
  391. border-radius: 50%;
  392. background-color: #FFEAA8;
  393. transform: translateY(-50%);
  394. }
  395. &::after {
  396. content: '';
  397. position: absolute;
  398. top: 50%;
  399. right: -125px;
  400. width: 107px;
  401. height: 1px;
  402. border-top: 1px dotted #FFEAA8;
  403. transform: translateY(-50%);
  404. }
  405. }
  406. .user-guide {
  407. position: fixed;
  408. top: 0;
  409. left: 0;
  410. right: 0;
  411. bottom: 0;
  412. background: rgba(0, 0, 0, 0.6);
  413. z-index: 9999;
  414. .btn {
  415. position: absolute;
  416. top: 50%;
  417. left: 50%;
  418. margin-top: 150px;
  419. width: 228px;
  420. height: 88px;
  421. line-height: 88px;
  422. transform: translate(-50%, -50%);
  423. text-align: center;
  424. letter-spacing: 4px;
  425. font-size: 21px;
  426. color: rgba(255,255,255,0.85);
  427. cursor: pointer;
  428. font-family: "Source Han Sans SC Regular";
  429. background: url('@/assets/images/guide/Rectangle346-min.png') no-repeat center / contain;
  430. }
  431. &-1 {
  432. position: absolute;
  433. top: 50%;
  434. left: 50%;
  435. margin-top: -100px;
  436. width: 509px;
  437. height: 294px;
  438. transform: translate(-50%, -50%);
  439. background: url("@/assets/images/guide/Group479-min.png") no-repeat center / contain;
  440. &.is-mobile {
  441. background-image: url("@/assets/images/mobile/tips_mobile-min.png");
  442. &::after {
  443. display: none;
  444. }
  445. }
  446. &::after {
  447. content: '';
  448. position: absolute;
  449. bottom: 44px;
  450. left: calc(50% - 10px);
  451. width: 116px;
  452. height: 116px;
  453. transform: translateX(-50%);
  454. background: url('@/assets/images/guide/icon_mouse-min.png') no-repeat center / contain;
  455. }
  456. }
  457. video {
  458. width: 100%;
  459. height: 100%;
  460. object-fit: cover;
  461. }
  462. }
  463. @media screen and (max-height: 480px) {
  464. .user-guide {
  465. .btn,
  466. .left-line,
  467. .top-line,
  468. .top-line p {
  469. font-size: 1.5vw !important;
  470. }
  471. }
  472. .guide-tab span {
  473. font-size: 1.3vw;
  474. }
  475. }
  476. </style>