|
@@ -1,5 +1,5 @@
|
|
|
<script setup>
|
|
|
-import { ref, computed, inject, nextTick } from "vue"
|
|
|
+import { ref, computed, inject, nextTick, onMounted } from "vue"
|
|
|
import { useRouter } from "vue-router"
|
|
|
import { useStore } from "vuex"
|
|
|
|
|
@@ -7,6 +7,8 @@ import HotspotDetail1 from "@/views/HotspotDetail1.vue"
|
|
|
import HotspotDetail3 from "@/views/HotspotDetail3.vue"
|
|
|
import { api as viewerApi } from "v-viewer"
|
|
|
import Startup from "@/views/StartupView.vue"
|
|
|
+import { useWindowSize } from '@vueuse/core'
|
|
|
+
|
|
|
|
|
|
const store = useStore()
|
|
|
|
|
@@ -20,6 +22,8 @@ const detailDescLeaf = configText.homepagePaintingDetailDescLeaf
|
|
|
const router = useRouter()
|
|
|
|
|
|
const { windowSizeInCssForRef, windowSizeWhenDesignForRef } = useSizeAdapt()
|
|
|
+const { width: windowWidth, height: windowHeight } = useWindowSize()
|
|
|
+
|
|
|
|
|
|
const isShowPaintingDesc = ref(false)
|
|
|
const isShowAuthorDesc = ref(false)
|
|
@@ -125,6 +129,28 @@ function onClickGoNextPage() {
|
|
|
}, 2000)
|
|
|
}
|
|
|
|
|
|
+// 将视频资源转换成blob
|
|
|
+const videoData = ref()
|
|
|
+const initVideoSrc = () => {
|
|
|
+ let xhr = new XMLHttpRequest()
|
|
|
+ /*通过get请求获取项目中的mp4文件流,因为axios修改responseType稍微有点麻烦,所以干脆写原生xhr请求了 */
|
|
|
+ xhr.open('GET', require(`@/assets/videos/fade-from-home-to-more-content${windowWidth >= 600 ? '-768' : ''}.mp4`), true)
|
|
|
+ //设置请求结果类型为blob
|
|
|
+ xhr.responseType = 'blob'
|
|
|
+ //回调
|
|
|
+ xhr.onload = function(e) {
|
|
|
+ if (this.status == 200) {
|
|
|
+ //创建blob对象,并把值赋给video的src
|
|
|
+ videoData.value = URL.createObjectURL(this.response)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ xhr.send()
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ initVideoSrc()
|
|
|
+})
|
|
|
+
|
|
|
const backFu = () => {
|
|
|
if (
|
|
|
curPageIndex.value === 4 ||
|
|
@@ -160,14 +186,15 @@ const backFu = () => {
|
|
|
<!-- 了解更多视频 -->
|
|
|
<Transition name="fade-in">
|
|
|
<video
|
|
|
- v-if="isShowVideoFadeToNextPage"
|
|
|
+ v-show="isShowVideoFadeToNextPage"
|
|
|
ref="videoFadeToNextPageEl"
|
|
|
class="fade-to-next-page"
|
|
|
- src="@/assets/videos/fade-from-home-to-more-content.mp4"
|
|
|
+ :src="videoData"
|
|
|
playsinline
|
|
|
webkit-playsinline="true"
|
|
|
x5-video-player-type="h5"
|
|
|
muted
|
|
|
+ :controls="false"
|
|
|
@ended="
|
|
|
router.replace({
|
|
|
name: 'MoreContentChange',
|
|
@@ -197,6 +224,10 @@ const backFu = () => {
|
|
|
v-if="!store.state.haveShownStartup"
|
|
|
class="startup"
|
|
|
/>
|
|
|
+ <!-- <Startup
|
|
|
+ v-if="true"
|
|
|
+ class="startup"
|
|
|
+ /> -->
|
|
|
</Transition>
|
|
|
<!-- 首页标题 -->
|
|
|
<div
|
|
@@ -257,7 +288,7 @@ const backFu = () => {
|
|
|
alt=""
|
|
|
:style="{
|
|
|
opacity: curPageIndex == 4 ? 1 : 0,
|
|
|
- zIndex: 2,
|
|
|
+ zIndex: 3,
|
|
|
}"
|
|
|
draggable="false"
|
|
|
>
|
|
@@ -267,7 +298,7 @@ const backFu = () => {
|
|
|
src="@/assets/images/img_stone_all-min.png"
|
|
|
:style="{
|
|
|
opacity: curPageIndex == 5 ? 1 : 0,
|
|
|
- zIndex: 2,
|
|
|
+ zIndex: 3,
|
|
|
}"
|
|
|
alt=""
|
|
|
draggable="false"
|
|
@@ -567,8 +598,10 @@ img,
|
|
|
div {
|
|
|
-webkit-backface-visibility: hidden;
|
|
|
backface-visibility: hidden;
|
|
|
- // transition: opacity 1.5s, top 1.5s, transform 1.5s;
|
|
|
transition: opacity 1.5s, top 1.5s, width 1.5s, height 1.5s;
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
+ transition: auto;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
::-webkit-scrollbar {
|
|
@@ -592,6 +625,9 @@ div {
|
|
|
height: 100%;
|
|
|
object-fit: cover;
|
|
|
z-index: 20;
|
|
|
+ &&::-webkit-media-controls{
|
|
|
+ display: none !important;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
> .bg-mask {
|
|
@@ -680,8 +716,6 @@ div {
|
|
|
);
|
|
|
z-index: 7;
|
|
|
pointer-events: none;
|
|
|
- will-change: transform;
|
|
|
- backface-visibility: hidden;
|
|
|
z-index: 10;
|
|
|
|
|
|
& > div {
|
|
@@ -794,7 +828,7 @@ div {
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
transition: all 1.5s ease-in-out;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
width: 40px;
|
|
|
height: 40px;
|
|
|
right: 5px;
|
|
@@ -819,9 +853,16 @@ div {
|
|
|
v-bind("windowSizeInCssForRef")
|
|
|
);
|
|
|
// background: green;
|
|
|
+ will-change: translate;
|
|
|
transform: translate(-50%, 0);
|
|
|
z-index: 1;
|
|
|
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
+ transition: top 1.5s, width 1.5s, height 1.5s;
|
|
|
+ -webkit-backface-visibility: hidden;
|
|
|
+ backface-visibility: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
> .painting-border {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
@@ -840,6 +881,11 @@ div {
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
transform: translate(-50%, 26%);
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
+ transition: left 1.5s, width 1.5s, height 1.5s;
|
|
|
+ -webkit-backface-visibility: hidden;
|
|
|
+ backface-visibility: hidden;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -865,7 +911,7 @@ div {
|
|
|
-80 / v-bind("windowSizeWhenDesignForRef") * v-bind("windowSizeInCssForRef")
|
|
|
);
|
|
|
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
width: 75%;
|
|
|
}
|
|
|
|
|
@@ -890,7 +936,7 @@ div {
|
|
|
z-index: 2;
|
|
|
overflow: hidden;
|
|
|
transition: opacity 1.5s ease;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
transform: translateX(-20%);
|
|
|
}
|
|
|
}
|
|
@@ -928,7 +974,7 @@ div {
|
|
|
);
|
|
|
transform: translate(-40%, -39%);
|
|
|
transform-origin: center center;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
transform: translate(-45%, -39%);
|
|
|
}
|
|
|
> .painting-stem {
|
|
@@ -1013,7 +1059,7 @@ div {
|
|
|
30 / v-bind("windowSizeWhenDesignForRef") *
|
|
|
v-bind("windowSizeInCssForRef")
|
|
|
);
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
width:80%;
|
|
|
}
|
|
|
}
|
|
@@ -1048,7 +1094,7 @@ div {
|
|
|
);
|
|
|
z-index: 10;
|
|
|
opacity: 0;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
width: 65px;
|
|
|
height: 65px;
|
|
|
}
|
|
@@ -1201,7 +1247,7 @@ div {
|
|
|
> img {
|
|
|
width: 45%;
|
|
|
margin-bottom: 10px;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
width: 55%;
|
|
|
}
|
|
|
}
|
|
@@ -1224,7 +1270,7 @@ div {
|
|
|
transform: translate(-50%, 0);
|
|
|
z-index: 5;
|
|
|
opacity: 1;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
bottom: calc(
|
|
|
100 / v-bind("windowSizeWhenDesignForRef") *
|
|
|
v-bind("windowSizeInCssForRef")
|
|
@@ -1249,7 +1295,7 @@ div {
|
|
|
padding-top: 15%;
|
|
|
padding-left: 10%;
|
|
|
padding-right: 10%;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
padding-top: 10%;
|
|
|
padding-left: 15%;
|
|
|
padding-right: 15%;
|
|
@@ -1285,7 +1331,7 @@ div {
|
|
|
> .painting-img {
|
|
|
width: 70%;
|
|
|
margin-bottom: 20px;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
width: 60%;
|
|
|
margin-bottom: 40px;
|
|
|
}
|
|
@@ -1295,7 +1341,7 @@ div {
|
|
|
width: 100%;
|
|
|
overflow: auto;
|
|
|
padding: 0 0px 40px 0px;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
max-height: 30%;
|
|
|
}
|
|
|
&::-webkit-scrollbar {
|
|
@@ -1315,7 +1361,7 @@ div {
|
|
|
v-bind("windowSizeInCssForRef")
|
|
|
);
|
|
|
font-family: KaiTi;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
font-size: calc(
|
|
|
20 / v-bind("windowSizeWhenDesignForRef") *
|
|
|
v-bind("windowSizeInCssForRef")
|
|
@@ -1373,7 +1419,7 @@ div {
|
|
|
padding-top: 15%;
|
|
|
padding-left: 10%;
|
|
|
padding-right: 10%;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
padding-top: 10%;
|
|
|
padding-left: 15%;
|
|
|
padding-right: 15%;
|
|
@@ -1452,7 +1498,7 @@ div {
|
|
|
v-bind("windowSizeInCssForRef")
|
|
|
);
|
|
|
font-family: KaiTi;
|
|
|
- @media screen and (min-width: 768px) {
|
|
|
+ @media screen and (min-width: 600px) {
|
|
|
font-size: calc(
|
|
|
20 / v-bind("windowSizeWhenDesignForRef") *
|
|
|
v-bind("windowSizeInCssForRef")
|