123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378 |
- <template>
- <div class="user-guide">
- <video
- v-if="showVideo"
- autoplay
- src="@/assets/videos/guide.mp4"
- @ended="showVideo = false"
- />
- <template v-else>
- <div
- class="btn"
- @click="handleClose"
- >
- {{ curStep === 6 ? '我知道了' : '下一步' }}
- </div>
- <template v-if="curStep === 0">
- <div :class="['user-guide-1', $isMobile && 'is-mobile']" />
- </template>
- <template v-else>
- <template v-if="curStep > 1">
- <div class="guide-home">
- <div
- class="left-line"
- >
- 返回首页
- </div>
- </div>
- <div class="guide-guide">
- <div
- class="left-line"
- >
- 操作指引
- </div>
- </div>
- </template>
- <div
- class="guide-dot"
- >
- <div
- class="left-line"
- >
- <span>场景互动</span>
- </div>
- </div>
- <template v-if="curStep > 5">
- <div
- class="character"
- style="overflow: visible;"
- >
- <div class="top-line">
- 对话赵孟頫
- </div>
- </div>
- <div class="character">
- <img
- class="default-frames"
- src="@/assets/images/pose1-min.png"
- alt=""
- draggable="false"
- >
- </div>
- </template>
- <template v-if="curStep > 2">
- <div
- class="top-line"
- style="left: 382px; bottom: 520px;"
- >
- 阅读历史
- </div>
- <div class="guide-menu">
- 营都人员与机构
- </div>
- </template>
- <template v-if="curStep > 3">
- <div
- class="guide-tab"
- :style="guideTabStyle"
- >
- <span>帝都</span>
- <div
- class="top-line"
- >
- <p>改变场景位置</p>
- </div>
- </div>
- </template>
- <div
- v-if="curStep > 4"
- class="qhcj"
- >
- <div
- class="top-line"
- >
- 切换场景
- </div>
- </div>
- </template>
- </template>
- </div>
- </template>
- <script setup>
- import { onMounted, ref, inject } from "vue"
- const curStep = ref(0)
- const guideTabStyle = ref('')
- const showVideo = ref(true)
- const $isMobile = inject('$isMobile')
- const emits = defineEmits(['close'])
- onMounted(() => {
- const dom = document.querySelector('.bg-active')
- if (dom) {
- const rect = dom.getBoundingClientRect()
- guideTabStyle.value = `width:${rect.width}px;height:${rect.height}px;top:${rect.top}px;left:${rect.left}px;display:block`
- }
- })
- const handleClose = () => {
- if (curStep.value > 5) {
- emits('close')
- localStorage.setItem('is-open-guide', 1)
- } else {
- curStep.value += 1
- }
- }
- </script>
- <style lang="less" scoped>
- .user-guide {
- .character {
- position: absolute;
- left: -157px;
- bottom: -18px;
- height: 480px;
- width: 640px;
- overflow: hidden;
- z-index: 5;
- >.default-frames{
- position: absolute;
- left: 0;
- height: 100%;
- animation-name: character-default-animation;
- animation-timing-function: steps(60, end);
- animation-duration: 2.5s;
- animation-iteration-count: infinite;
- }
- .top-line {
- margin-left: 2px;
- bottom: 550px;
- }
- }
- span,
- p {
- font-family: "Source Han Sans SC Regular" !important;
- }
- }
- @keyframes character-default-animation {
- 0% {
- translate: 0 0;
- }
- 100% {
- translate: -100% 0;
- }
- }
- .guide-tab {
- display: none;
- position: absolute;
- background: url('@/assets/images/camera-list-item-bg-active-1.png') no-repeat center / cover;
- span {
- position: absolute;
- left: 50%;
- bottom: 18px;
- font-size: 21px;
- color: #794A00;
- font-weight: 600;
- transform: translateX(-50%);
- letter-spacing: 9px;
- font-family: Source Han Serif CN;
- }
- .top-line {
- top: -110px;
- margin-left: -10px;
- }
- }
- .guide-menu {
- position: absolute;
- left: 367px;
- bottom: 306px;
- padding-left: 107px;
- width: 390px;
- height: 104px;
- line-height: 104px;
- font-size: 23px;
- color: #FFF1BE;
- letter-spacing: 5px;
- box-sizing: border-box;
- font-family: Source Han Serif CN;
- background: url('@/assets/images/camera-btn-1-1-2-active.png') no-repeat center / contain;
- }
- .qhcj {
- position: absolute;
- right: 70px;
- bottom: 250px;
- width: 42px;
- height: 11px;
- .top-line {
- bottom: 0;
- }
- }
- .guide-home {
- position: absolute;
- width: 77px;
- height: 77px;
- top: 43px;
- right: 51px;
- background: url('@/assets/images/btn-return-home-1.png') no-repeat center / contain;
- z-index: 1;
- }
- .guide-guide {
- position: absolute;
- width: 77px;
- height: 77px;
- top: 128px;
- right: 51px;
- background: url('@/assets/images/guide/tbn_help-min.png') no-repeat center / cover;
- }
- .guide-dot {
- position: absolute;
- top: 118px;
- right: 860px;
- width: 35px;
- height: 35px;
- background: url('@/assets/images/guide/Dots.png') no-repeat center / contain;
- z-index: 1;
- }
- .top-line {
- position: absolute;
- left: 50%;
- bottom: 550px;
- height: fit-content;
- font-size: 18px;
- color: rgba(255,255,255,0.85);
- line-height: 21px;
- letter-spacing: 3px;
- white-space: nowrap;
- transform: translateX(-50%);
- text-shadow: 2px 2px 15px #C9AA79;
- &::before {
- content: '';
- position: absolute;
- left: 50%;
- bottom: -10px;
- width: 6px;
- height: 6px;
- border-radius: 50%;
- background-color: #FFEAA8;
- transform: translateX(-50%);
- }
- &::after {
- content: '';
- position: absolute;
- bottom: -102px;
- left: 50%;
- width: 1px;
- height: 92px;
- border-right: 1px dotted #FFEAA8;
- box-sizing: border-box;
- transform: translateX(-50%);
- }
- }
- .left-line {
- position: absolute;
- top: 50%;
- left: -230px;
- font-size: 18px;
- color: rgba(255,255,255,0.85);
- line-height: 21px;
- letter-spacing: 3px;
- white-space: nowrap;
- text-shadow: 2px 2px 15px #C9AA79;
- transform: translateY(-50%);
- &::before {
- content: '';
- position: absolute;
- top: 50%;
- right: -20px;
- width: 5px;
- height: 5px;
- border-radius: 50%;
- background-color: #FFEAA8;
- transform: translateY(-50%);
- }
- &::after {
- content: '';
- position: absolute;
- top: 50%;
- right: -125px;
- width: 107px;
- height: 1px;
- border-top: 1px dotted #FFEAA8;
- transform: translateY(-50%);
- }
- }
- .user-guide {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.6);
- z-index: 9999;
- .btn {
- position: absolute;
- top: 50%;
- left: 50%;
- margin-top: 150px;
- width: 228px;
- height: 88px;
- line-height: 88px;
- transform: translate(-50%, -50%);
- text-align: center;
- letter-spacing: 4px;
- font-size: 21px;
- color: rgba(255,255,255,0.85);
- cursor: pointer;
- font-family: "Source Han Sans SC Regular";
- background: url('@/assets/images/guide/Rectangle346-min.png') no-repeat center / contain;
- }
- &-1 {
- position: absolute;
- top: 50%;
- left: 50%;
- margin-top: -100px;
- width: 509px;
- height: 294px;
- transform: translate(-50%, -50%);
- background: url("@/assets/images/guide/Group479-min.png") no-repeat center / contain;
- &.is-mobile {
- background-image: url("@/assets/images/mobile/tips_mobile-min.png");
- &::after {
- display: none;
- }
- }
- &::after {
- content: '';
- position: absolute;
- bottom: 44px;
- left: calc(50% - 10px);
- width: 116px;
- height: 116px;
- transform: translateX(-50%);
- background: url('@/assets/images/guide/icon_mouse-min.png') no-repeat center / contain;
- }
- }
- video {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- </style>
|