123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <template>
- <div class="startup-view">
- <span class="font-load-trigger">这是为了尽早触发字体文件加载</span>
- <!-- 背景序列帧 -->
- <!-- <SerialFrames
- class="bg-serial-frames"
- :image-src="require(`@/assets/images/serial-frame-startup.png`)"
- :total-width="28800 / 900 * windowHeight"
- :height="windowHeight"
- :frame-number="48"
- :frame-duration="1000 / 12"
- /> -->
- <img
- class="bg-serial-frames"
- src="@/assets/images/loding_apng.png"
- alt=""
- draggable="false"
- >
- <img
- class="title"
- src="@/assets/images/startup-title.png"
- alt=""
- draggable="false"
- >
- <Transition name="fade-in">
- <img
- v-if="isShowLoadingTip"
- class="loading-tip"
- src="@/assets/images/loading.png"
- alt=""
- draggable="false"
- >
- </Transition>
- <SerialFrames
- v-if="!isShowLoadingTip"
- class="btn-start"
- :class="isStartBtnBlink ? 'animation-show-hide' : ''"
- :image-src="require(`@/assets/images/btn-start.png`)"
- :total-width="864 / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)"
- :height="72 / windowSizeWhenDesignForRef * windowSizeInCssForRef.substring(0, windowSizeInCssForRef.length - 2)"
- :frame-number="12"
- :loop="false"
- @over="isStartBtnBlink = true"
- @click="onClickStart"
- />
- <div class="start-title">
- 点击开始
- </div>
- <Transition name="fade-in">
- <video
- v-show="isShowVideo"
- ref="videoEl"
- class="transition-video"
- src="@/assets/videos/startup.mp4"
- playsinline
- webkit-playsinline="true"
- x5-video-player-type="h5"
- muted
- @ended="onVideoEnd"
- />
- </Transition>
- <Transition name="fade-in">
- <BtnSkip
- v-if="isShowSkip"
- @click="onVideoEnd"
- />
- </Transition>
- </div>
- </template>
- <script setup>
- import useSizeAdapt from "@/useFunctions/useSizeAdapt"
- import { ref, computed, watch, onMounted, inject, nextTick } from "vue"
- import { useRoute, useRouter } from "vue-router"
- import { useStore } from "vuex"
- import { useWindowSize } from '@vueuse/core'
- const route = useRoute()
- const router = useRouter()
- const store = useStore()
- const $env = inject('$env')
- const {
- windowSizeInCssForRef,
- windowSizeWhenDesignForRef,
- } = useSizeAdapt()
- const { width: windowWidth, height: windowHeight } = useWindowSize()
- const isShowLoadingTip = ref(true)
- setTimeout(() => {
- isShowLoadingTip.value = false
- }, 3000)
- const isStartBtnBlink = ref(false)
- const isShowVideo = ref(false)
- const isShowSkip = ref(false)
- const videoEl = ref(null)
- function onClickStart() {
- isShowVideo.value = true
- const audioEl = document.getElementById('bg-music')
- nextTick(() => {
- videoEl.value.play()
- audioEl.play()
- })
- setTimeout(() => {
- isShowSkip.value = true
- }, 2000)
- }
- function onVideoEnd() {
- store.dispatch('recordShownStartup')
- }
- </script>
- <style lang="less" scoped>
- .startup-view{
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background-color: #fff;
- background-image: url(@/assets/images/startup-bg.png);
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center center;
- >.font-load-trigger{
- pointer-events: none;
- opacity: 0;
- font-family: KaiTi;
- }
- >.bg-serial-frames{
- position: absolute;
- left: 50%;
- top: 0;
- transform: translateX(-50%);
- mix-blend-mode: multiply;
- width: 100%;
- height: 100%;
- }
- >img.title{
- position: absolute;
- left: 50%;
- top: 40%;
- transform: translate(-50%, -50%);
- width: 152px;
- }
- >.loading-tip{
- position: absolute;
- left: 50%;
- bottom: 100px;
- transform: translateX(-48%);
- width: 72px;
- height: 72px;
- }
- >.btn-start{
- position: absolute;
- left: 50%;
- bottom: 100px;
- transform: translateX(-48%);
- cursor: pointer;
- }
- >.start-title{
- color: #FFFFFF;
- font-size: 24px;
- font-family: KaiTi;
- position: absolute;
- bottom: 60px;
- left: 50%;
- transform: translateX(-48%);
- }
- >video.transition-video{
- position: absolute;
- left: 50%;
- top: 0;
- width: 100%;
- height: 100%;
- object-fit: cover;
- transform: translateX(-50%);
- }
- // @keyframes spin {
- // 0% {
- // transform: translate(-50%, -50%) rotate(0deg);
- // }
- // 100% {
- // transform: translate(-50%, -50%) rotate(360deg);
- // }
- // }
- }
- </style>
|