UserGuide.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <div class="user-guide">
  3. <video
  4. v-if="showVideo"
  5. autoplay
  6. src="@/assets/videos/guide.mp4"
  7. @ended="showVideo = false"
  8. />
  9. <template v-else>
  10. <div
  11. class="btn"
  12. @click="handleClose"
  13. >
  14. {{ curStep === 6 ? '我知道了' : '下一步' }}
  15. </div>
  16. <template v-if="curStep === 0">
  17. <div :class="['user-guide-1', $isMobile && 'is-mobile']" />
  18. </template>
  19. <template v-else>
  20. <template v-if="curStep > 1">
  21. <div class="guide-home">
  22. <div
  23. class="left-line"
  24. >
  25. 返回首页
  26. </div>
  27. </div>
  28. <div class="guide-guide">
  29. <div
  30. class="left-line"
  31. >
  32. 操作指引
  33. </div>
  34. </div>
  35. </template>
  36. <div
  37. class="guide-dot"
  38. >
  39. <div
  40. class="left-line"
  41. >
  42. <span>场景互动</span>
  43. </div>
  44. </div>
  45. <template v-if="curStep > 5">
  46. <div
  47. class="character"
  48. style="overflow: visible;"
  49. >
  50. <div class="top-line">
  51. 对话赵孟頫
  52. </div>
  53. </div>
  54. <div class="character">
  55. <img
  56. class="default-frames"
  57. src="@/assets/images/pose1-min.png"
  58. alt=""
  59. draggable="false"
  60. >
  61. </div>
  62. </template>
  63. <template v-if="curStep > 2">
  64. <div
  65. class="top-line"
  66. style="left: 382px; bottom: 520px;"
  67. >
  68. 阅读历史
  69. </div>
  70. <div class="guide-menu">
  71. 营都人员与机构
  72. </div>
  73. </template>
  74. <template v-if="curStep > 3">
  75. <div
  76. class="guide-tab"
  77. :style="guideTabStyle"
  78. >
  79. <span>帝都</span>
  80. <div
  81. class="top-line"
  82. >
  83. <p>改变场景位置</p>
  84. </div>
  85. </div>
  86. </template>
  87. <div
  88. v-if="curStep > 4"
  89. class="qhcj"
  90. >
  91. <div
  92. class="top-line"
  93. >
  94. 切换场景
  95. </div>
  96. </div>
  97. </template>
  98. </template>
  99. </div>
  100. </template>
  101. <script setup>
  102. import { onMounted, ref, inject } from "vue"
  103. const curStep = ref(0)
  104. const guideTabStyle = ref('')
  105. const showVideo = ref(true)
  106. const $isMobile = inject('$isMobile')
  107. const emits = defineEmits(['close'])
  108. onMounted(() => {
  109. const dom = document.querySelector('.bg-active')
  110. if (dom) {
  111. const rect = dom.getBoundingClientRect()
  112. guideTabStyle.value = `width:${rect.width}px;height:${rect.height}px;top:${rect.top}px;left:${rect.left}px;display:block`
  113. }
  114. })
  115. const handleClose = () => {
  116. if (curStep.value > 5) {
  117. emits('close')
  118. localStorage.setItem('is-open-guide', 1)
  119. } else {
  120. curStep.value += 1
  121. }
  122. }
  123. </script>
  124. <style lang="less" scoped>
  125. .user-guide {
  126. .character {
  127. position: absolute;
  128. left: -157px;
  129. bottom: -18px;
  130. height: 480px;
  131. width: 640px;
  132. overflow: hidden;
  133. z-index: 5;
  134. >.default-frames{
  135. position: absolute;
  136. left: 0;
  137. height: 100%;
  138. animation-name: character-default-animation;
  139. animation-timing-function: steps(60, end);
  140. animation-duration: 2.5s;
  141. animation-iteration-count: infinite;
  142. }
  143. .top-line {
  144. margin-left: 2px;
  145. bottom: 550px;
  146. }
  147. }
  148. span,
  149. p {
  150. font-family: "Source Han Sans SC Regular" !important;
  151. }
  152. }
  153. @keyframes character-default-animation {
  154. 0% {
  155. translate: 0 0;
  156. }
  157. 100% {
  158. translate: -100% 0;
  159. }
  160. }
  161. .guide-tab {
  162. display: none;
  163. position: absolute;
  164. background: url('@/assets/images/camera-list-item-bg-active-1.png') no-repeat center / cover;
  165. span {
  166. position: absolute;
  167. left: 50%;
  168. bottom: 18px;
  169. font-size: 21px;
  170. color: #794A00;
  171. font-weight: 600;
  172. transform: translateX(-50%);
  173. letter-spacing: 9px;
  174. font-family: Source Han Serif CN;
  175. }
  176. .top-line {
  177. top: -110px;
  178. margin-left: -10px;
  179. }
  180. }
  181. .guide-menu {
  182. position: absolute;
  183. left: 367px;
  184. bottom: 306px;
  185. padding-left: 107px;
  186. width: 390px;
  187. height: 104px;
  188. line-height: 104px;
  189. font-size: 23px;
  190. color: #FFF1BE;
  191. letter-spacing: 5px;
  192. box-sizing: border-box;
  193. font-family: Source Han Serif CN;
  194. background: url('@/assets/images/camera-btn-1-1-2-active.png') no-repeat center / contain;
  195. }
  196. .qhcj {
  197. position: absolute;
  198. right: 70px;
  199. bottom: 250px;
  200. width: 42px;
  201. height: 11px;
  202. .top-line {
  203. bottom: 0;
  204. }
  205. }
  206. .guide-home {
  207. position: absolute;
  208. width: 77px;
  209. height: 77px;
  210. top: 43px;
  211. right: 51px;
  212. background: url('@/assets/images/btn-return-home-1.png') no-repeat center / contain;
  213. z-index: 1;
  214. }
  215. .guide-guide {
  216. position: absolute;
  217. width: 77px;
  218. height: 77px;
  219. top: 128px;
  220. right: 51px;
  221. background: url('@/assets/images/guide/tbn_help-min.png') no-repeat center / cover;
  222. }
  223. .guide-dot {
  224. position: absolute;
  225. top: 118px;
  226. right: 860px;
  227. width: 35px;
  228. height: 35px;
  229. background: url('@/assets/images/guide/Dots.png') no-repeat center / contain;
  230. z-index: 1;
  231. }
  232. .top-line {
  233. position: absolute;
  234. left: 50%;
  235. bottom: 550px;
  236. height: fit-content;
  237. font-size: 18px;
  238. color: rgba(255,255,255,0.85);
  239. line-height: 21px;
  240. letter-spacing: 3px;
  241. white-space: nowrap;
  242. transform: translateX(-50%);
  243. text-shadow: 2px 2px 15px #C9AA79;
  244. &::before {
  245. content: '';
  246. position: absolute;
  247. left: 50%;
  248. bottom: -10px;
  249. width: 6px;
  250. height: 6px;
  251. border-radius: 50%;
  252. background-color: #FFEAA8;
  253. transform: translateX(-50%);
  254. }
  255. &::after {
  256. content: '';
  257. position: absolute;
  258. bottom: -102px;
  259. left: 50%;
  260. width: 1px;
  261. height: 92px;
  262. border-right: 1px dotted #FFEAA8;
  263. box-sizing: border-box;
  264. transform: translateX(-50%);
  265. }
  266. }
  267. .left-line {
  268. position: absolute;
  269. top: 50%;
  270. left: -230px;
  271. font-size: 18px;
  272. color: rgba(255,255,255,0.85);
  273. line-height: 21px;
  274. letter-spacing: 3px;
  275. white-space: nowrap;
  276. text-shadow: 2px 2px 15px #C9AA79;
  277. transform: translateY(-50%);
  278. &::before {
  279. content: '';
  280. position: absolute;
  281. top: 50%;
  282. right: -20px;
  283. width: 5px;
  284. height: 5px;
  285. border-radius: 50%;
  286. background-color: #FFEAA8;
  287. transform: translateY(-50%);
  288. }
  289. &::after {
  290. content: '';
  291. position: absolute;
  292. top: 50%;
  293. right: -125px;
  294. width: 107px;
  295. height: 1px;
  296. border-top: 1px dotted #FFEAA8;
  297. transform: translateY(-50%);
  298. }
  299. }
  300. .user-guide {
  301. position: fixed;
  302. top: 0;
  303. left: 0;
  304. right: 0;
  305. bottom: 0;
  306. background: rgba(0, 0, 0, 0.6);
  307. z-index: 9999;
  308. .btn {
  309. position: absolute;
  310. top: 50%;
  311. left: 50%;
  312. margin-top: 150px;
  313. width: 228px;
  314. height: 88px;
  315. line-height: 88px;
  316. transform: translate(-50%, -50%);
  317. text-align: center;
  318. letter-spacing: 4px;
  319. font-size: 21px;
  320. color: rgba(255,255,255,0.85);
  321. cursor: pointer;
  322. font-family: "Source Han Sans SC Regular";
  323. background: url('@/assets/images/guide/Rectangle346-min.png') no-repeat center / contain;
  324. }
  325. &-1 {
  326. position: absolute;
  327. top: 50%;
  328. left: 50%;
  329. margin-top: -100px;
  330. width: 509px;
  331. height: 294px;
  332. transform: translate(-50%, -50%);
  333. background: url("@/assets/images/guide/Group479-min.png") no-repeat center / contain;
  334. &.is-mobile {
  335. background-image: url("@/assets/images/mobile/tips_mobile-min.png");
  336. &::after {
  337. display: none;
  338. }
  339. }
  340. &::after {
  341. content: '';
  342. position: absolute;
  343. bottom: 44px;
  344. left: calc(50% - 10px);
  345. width: 116px;
  346. height: 116px;
  347. transform: translateX(-50%);
  348. background: url('@/assets/images/guide/icon_mouse-min.png') no-repeat center / contain;
  349. }
  350. }
  351. video {
  352. width: 100%;
  353. height: 100%;
  354. object-fit: cover;
  355. }
  356. }
  357. </style>