|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="CollectionsInfo" tabindex="0" :style="{
|
|
|
+ <div class="CollectionsInfo" :style="{
|
|
|
top: needPaddingTop ? '105px' : '0',
|
|
|
bottom: needPaddingBottom ? '219px' : '0',
|
|
|
}">
|
|
@@ -16,7 +16,7 @@
|
|
|
aria-label="Image"
|
|
|
:aria-description="infoObj.h3.replace(/(<([^>]+)>)/ig, '')"
|
|
|
/>
|
|
|
- <span :style="{ opacity: num, left: numLeft, top: numTop }"></span>
|
|
|
+ <span :style="{ opacity: smallImageLogoOpacity, left: numLeft, top: numTop }"></span>
|
|
|
</div>
|
|
|
<!-- 看大图 -->
|
|
|
<div class="look" @click="lookBig" @keydown.enter.passive="lookBig"
|
|
@@ -54,11 +54,11 @@
|
|
|
<img :src="`/data/Collections/${infoObj.url}/big${infoObj.id}.png`"
|
|
|
alt=""
|
|
|
tabindex="0"
|
|
|
- aria-label="Big image"
|
|
|
+ aria-label="Image"
|
|
|
:aria-description="infoObj.h3.replace(/(<([^>]+)>)/ig, '')"
|
|
|
/>
|
|
|
<span
|
|
|
- :style="{ opacity: num, left: bigNumLeft, top: bigNumTop }"
|
|
|
+ :style="{ opacity: bigImageLogoOpacity, left: bigNumLeft, top: bigNumTop }"
|
|
|
></span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -84,7 +84,8 @@ export default {
|
|
|
return {
|
|
|
bigShow: false,
|
|
|
// 从0到1的随机小数
|
|
|
- num: 1,
|
|
|
+ smallImageLogoOpacity: 1,
|
|
|
+ bigImageLogoOpacity: 1,
|
|
|
// 从0到100的随机整数
|
|
|
numTop: "0px",
|
|
|
numLeft: "0px",
|
|
@@ -121,11 +122,14 @@ export default {
|
|
|
let maxLeft = bDom.offsetWidth - 64;
|
|
|
let maxTop = bDom.offsetHeight - 133;
|
|
|
this.timeIdBig = setInterval(() => {
|
|
|
- if (this.num === 0) {
|
|
|
+ this.bigImageLogoOpacity = 0;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.bigImageLogoOpacity = 1;
|
|
|
+ // 控制位移
|
|
|
this.bigNumLeft = Math.ceil(Math.random() * maxLeft) + "px";
|
|
|
this.bigNumTop = Math.ceil(Math.random() * maxTop) + "px";
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
+ }, 500);
|
|
|
+ }, 3000);
|
|
|
}, 100);
|
|
|
});
|
|
|
},
|
|
@@ -174,16 +178,15 @@ export default {
|
|
|
let bigLeft = dom.offsetWidth - 64;
|
|
|
// 最大Top
|
|
|
let bigTop = dom.offsetHeight - 133;
|
|
|
- // 生成随机整数
|
|
|
this.timeId = setInterval(() => {
|
|
|
- // 控制透明度
|
|
|
- if (this.num === 0) {
|
|
|
- this.num = 1;
|
|
|
+ this.smallImageLogoOpacity = 0;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.smallImageLogoOpacity = 1;
|
|
|
// 控制位移
|
|
|
this.numLeft = Math.ceil(Math.random() * bigLeft) + "px";
|
|
|
this.numTop = Math.ceil(Math.random() * bigTop) + "px";
|
|
|
- } else this.num = 0;
|
|
|
- }, 1000);
|
|
|
+ }, 500);
|
|
|
+ }, 3000);
|
|
|
}, 100);
|
|
|
});
|
|
|
},
|
|
@@ -240,7 +243,7 @@ export default {
|
|
|
width: 100%;
|
|
|
}
|
|
|
& > span {
|
|
|
- transition: opacity 0.3s;
|
|
|
+ transition: opacity 0.5s;
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
@@ -317,7 +320,7 @@ export default {
|
|
|
object-fit: cover;
|
|
|
}
|
|
|
& > span {
|
|
|
- transition: opacity 0.3s;
|
|
|
+ transition: opacity 0.5s;
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
top: 0;
|